VERY experimental Nintendo Switch 2 emulator
C++
glsl: Fix image gather logic
ameerjd01344c0086f
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_image.cppindex 6cf0300abc..f022c5f300 100644--- a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp+++ b/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp@@ -343,11 +343,13 @@ void EmitImageGather([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Insif (offset.IsEmpty()) {ctx.AddU1("{}=sparseTexelsResidentARB(sparseTextureGatherARB({},{},{},int({})));",*sparse_inst, texture, coords, texel, info.gather_component);+ return;}if (offset2.IsEmpty()) {ctx.AddU1("{}=sparseTexelsResidentARB(sparseTextureGatherOffsetARB({},{},{},{},int({})));",*sparse_inst, texture, CastToIntVec(coords, info), GetOffsetVec(ctx, offset),texel, info.gather_component);+ return;}// PTPconst auto offsets{PtpOffsets(offset, offset2)};@@ -385,11 +387,13 @@ void EmitImageGatherDref([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR:if (offset.IsEmpty()) {ctx.AddU1("{}=sparseTexelsResidentARB(sparseTextureGatherARB({},{},{},{}));", *sparse_inst,texture, coords, dref, texel);+ return;}if (offset2.IsEmpty()) {ctx.AddU1("{}=sparseTexelsResidentARB(sparseTextureGatherOffsetARB({},{},{},,{},{}));",*sparse_inst, texture, CastToIntVec(coords, info), dref,GetOffsetVec(ctx, offset), texel);+ return;}// PTPconst auto offsets{PtpOffsets(offset, offset2)};