diff options
Diffstat (limited to 'src/shader_recompiler/backend/glsl')
3 files changed, 9 insertions, 9 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 | ||
| 451 | void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 451 | void 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); |
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h index 8d0a65047..acebaa785 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h +++ b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h | |||
| @@ -651,7 +651,7 @@ void EmitImageGatherDref(EmitContext& ctx, IR::Inst& inst, const IR::Value& inde | |||
| 651 | std::string_view coords, const IR::Value& offset, const IR::Value& offset2, | 651 | std::string_view coords, const IR::Value& offset, const IR::Value& offset2, |
| 652 | std::string_view dref); | 652 | std::string_view dref); |
| 653 | void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 653 | void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 654 | std::string_view coords, std::string_view offset, std::string_view lod, | 654 | std::string_view coords, const IR::Value& offset, std::string_view lod, |
| 655 | std::string_view ms); | 655 | std::string_view ms); |
| 656 | void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 656 | void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 657 | std::string_view lod, const IR::Value& skip_mips); | 657 | std::string_view lod, const IR::Value& skip_mips); |
diff --git a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp index b2ceeefc4..c5ac7b8f2 100644 --- a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp | |||
| @@ -608,8 +608,8 @@ std::string EmitContext::DefineGlobalMemoryFunctions() { | |||
| 608 | const auto aligned_low_addr{fmt::format("{}&{}", addr_xy[0], ssbo_align_mask)}; | 608 | const auto aligned_low_addr{fmt::format("{}&{}", addr_xy[0], ssbo_align_mask)}; |
| 609 | const auto aligned_addr{fmt::format("uvec2({},{})", aligned_low_addr, addr_xy[1])}; | 609 | const auto aligned_addr{fmt::format("uvec2({},{})", aligned_low_addr, addr_xy[1])}; |
| 610 | const auto addr_pack{fmt::format("packUint2x32({})", aligned_addr)}; | 610 | const auto addr_pack{fmt::format("packUint2x32({})", aligned_addr)}; |
| 611 | const auto addr_statment{fmt::format("uint64_t {}={};", ssbo_addr, addr_pack)}; | 611 | const auto addr_statement{fmt::format("uint64_t {}={};", ssbo_addr, addr_pack)}; |
| 612 | func += addr_statment; | 612 | func += addr_statement; |
| 613 | 613 | ||
| 614 | const auto size_vec{fmt::format("uvec2({},{})", size_xy[0], size_xy[1])}; | 614 | const auto size_vec{fmt::format("uvec2({},{})", size_xy[0], size_xy[1])}; |
| 615 | const auto comp_lhs{fmt::format("(addr>={})", ssbo_addr)}; | 615 | const auto comp_lhs{fmt::format("(addr>={})", ssbo_addr)}; |