diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/surface_atomic_operations.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/surface_atomic_operations.cpp index c4f11e3929..b7d9d468b6 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/surface_atomic_operations.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/surface_atomic_operations.cpp @@ -12,14 +12,19 @@ namespace Shader::Maxwell { namespace { enum class Type : u64 { - _1D, - BUFFER_1D, - ARRAY_1D, - _2D, - ARRAY_2D, - _3D, + _1D = 0, + _1D_BUFFER = 1, + _1D_ARRAY = 2, + _2D = 3, + _2D_ARRAY = 4, + _3D = 5, + _UNK6 = 6, + _UNK7 = 7, }; +/// For any would be newcomer to here: Yes - GPU dissasembly says S64 should +/// be after F16x2FTZRN. However if you do plan to revert this, you MUST test +/// ToTK beforehand. As the game will break with the subtle change enum class Size : u64 { U32, S32, @@ -53,18 +58,19 @@ TextureType GetType(Type type) { switch (type) { case Type::_1D: return TextureType::Color1D; - case Type::BUFFER_1D: + case Type::_1D_BUFFER: return TextureType::Buffer; - case Type::ARRAY_1D: + case Type::_1D_ARRAY: return TextureType::ColorArray1D; case Type::_2D: return TextureType::Color2D; - case Type::ARRAY_2D: + case Type::_2D_ARRAY: return TextureType::ColorArray2D; case Type::_3D: return TextureType::Color3D; + default: + throw NotImplementedException("Invalid type {}", type); } - throw NotImplementedException("Invalid type {}", type); } IR::Value MakeCoords(TranslatorVisitor& v, IR::Reg reg, Type type) { @@ -73,20 +79,19 @@ IR::Value MakeCoords(TranslatorVisitor& v, IR::Reg reg, Type type) { }}; switch (type) { case Type::_1D: - case Type::BUFFER_1D: + case Type::_1D_BUFFER: return v.X(reg); - case Type::ARRAY_1D: + case Type::_1D_ARRAY: return v.ir.CompositeConstruct(v.X(reg), array(1)); case Type::_2D: return v.ir.CompositeConstruct(v.X(reg), v.X(reg + 1)); - case Type::ARRAY_2D: + case Type::_2D_ARRAY: return v.ir.CompositeConstruct(v.X(reg), v.X(reg + 1), array(2)); case Type::_3D: return v.ir.CompositeConstruct(v.X(reg), v.X(reg + 1), v.X(reg + 2)); default: - break; + throw NotImplementedException("Invalid type {}", type); } - throw NotImplementedException("Invalid type {}", type); } IR::Value ApplyAtomicOp(IR::IREmitter& ir, const IR::U32& handle, const IR::Value& coords, diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp index c881e22d64..f5bf995d00 100644 --- a/src/video_core/renderer_opengl/gl_device.cpp +++ b/src/video_core/renderer_opengl/gl_device.cpp @@ -243,7 +243,7 @@ Device::Device(Core::Frontend::EmuWindow& emu_window) { } if (shader_backend == Settings::ShaderBackend::Glsl && is_nvidia) { - const std::string_view driver_version = version.substr(13); + const std::string driver_version = version.substr(13); const int version_major = std::atoi(driver_version.substr(0, driver_version.find(".")).data()); if (version_major >= 495) {