summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
diff options
context:
space:
mode:
authorGravatar liamwhite2024-01-04 15:53:44 -0500
committerGravatar GitHub2024-01-04 15:53:44 -0500
commit92a331af76cba638f01490eeb0045ca4d6d27df7 (patch)
tree2f66b3dad2ee7c47cb8be910e0cbbaeced97ce6d /src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
parentMerge pull request #12575 from t895/inconsistent-settings-application (diff)
parentSettings: Indicate AMD's compatibility with SPIR-V on OGL (diff)
downloadyuzu-92a331af76cba638f01490eeb0045ca4d6d27df7.tar.gz
yuzu-92a331af76cba638f01490eeb0045ca4d6d27df7.tar.xz
yuzu-92a331af76cba638f01490eeb0045ca4d6d27df7.zip
Merge pull request #12437 from ameerj/gl-amd-fixes
OpenGL: Fixes and workaround updates for AMD
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_glsl_image.cpp')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_image.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
index 6e940bd5a..ad39f44c3 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
@@ -449,7 +449,7 @@ void EmitImageGatherDref(EmitContext& ctx, IR::Inst& inst, const IR::Value& inde
449} 449}
450 450
451void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, 451void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
452 std::string_view coords, std::string_view offset, std::string_view lod, 452 std::string_view coords, const IR::Value& offset, std::string_view lod,
453 std::string_view ms) { 453 std::string_view ms) {
454 const auto info{inst.Flags<IR::TextureInstInfo>()}; 454 const auto info{inst.Flags<IR::TextureInstInfo>()};
455 if (info.has_bias) { 455 if (info.has_bias) {
@@ -470,9 +470,9 @@ void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
470 const auto int_coords{CoordsCastToInt(coords, info)}; 470 const auto int_coords{CoordsCastToInt(coords, info)};
471 if (!ms.empty()) { 471 if (!ms.empty()) {
472 ctx.Add("{}=texelFetch({},{},int({}));", texel, texture, int_coords, ms); 472 ctx.Add("{}=texelFetch({},{},int({}));", texel, texture, int_coords, ms);
473 } else if (!offset.empty()) { 473 } else if (!offset.IsEmpty()) {
474 ctx.Add("{}=texelFetchOffset({},{},int({}),{});", texel, texture, int_coords, lod, 474 ctx.Add("{}=texelFetchOffset({},{},int({}),{});", texel, texture, int_coords, lod,
475 CoordsCastToInt(offset, info)); 475 GetOffsetVec(ctx, offset));
476 } else { 476 } else {
477 if (info.type == TextureType::Buffer) { 477 if (info.type == TextureType::Buffer) {
478 ctx.Add("{}=texelFetch({},int({}));", texel, texture, coords); 478 ctx.Add("{}=texelFetch({},int({}));", texel, texture, coords);
@@ -485,10 +485,10 @@ void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
485 if (!ms.empty()) { 485 if (!ms.empty()) {
486 throw NotImplementedException("EmitImageFetch Sparse MSAA samples"); 486 throw NotImplementedException("EmitImageFetch Sparse MSAA samples");
487 } 487 }
488 if (!offset.empty()) { 488 if (!offset.IsEmpty()) {
489 ctx.AddU1("{}=sparseTexelsResidentARB(sparseTexelFetchOffsetARB({},{},int({}),{},{}));", 489 ctx.AddU1("{}=sparseTexelsResidentARB(sparseTexelFetchOffsetARB({},{},int({}),{},{}));",
490 *sparse_inst, texture, CastToIntVec(coords, info), lod, 490 *sparse_inst, texture, CastToIntVec(coords, info), lod, GetOffsetVec(ctx, offset),
491 CastToIntVec(offset, info), texel); 491 texel);
492 } else { 492 } else {
493 ctx.AddU1("{}=sparseTexelsResidentARB(sparseTexelFetchARB({},{},int({}),{}));", 493 ctx.AddU1("{}=sparseTexelsResidentARB(sparseTexelFetchARB({},{},int({}),{}));",
494 *sparse_inst, texture, CastToIntVec(coords, info), lod, texel); 494 *sparse_inst, texture, CastToIntVec(coords, info), lod, texel);