diff options
Diffstat (limited to 'src/shader_recompiler')
3 files changed, 8 insertions, 8 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/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp index 89ebab08e..0442adc83 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp | |||
| @@ -1440,7 +1440,7 @@ void EmitContext::DefineInputs(const IR::Program& program) { | |||
| 1440 | if (profile.support_vertex_instance_id) { | 1440 | if (profile.support_vertex_instance_id) { |
| 1441 | instance_id = DefineInput(*this, U32[1], true, spv::BuiltIn::InstanceId); | 1441 | instance_id = DefineInput(*this, U32[1], true, spv::BuiltIn::InstanceId); |
| 1442 | if (loads[IR::Attribute::BaseInstance]) { | 1442 | if (loads[IR::Attribute::BaseInstance]) { |
| 1443 | base_instance = DefineInput(*this, U32[1], true, spv::BuiltIn::BaseVertex); | 1443 | base_instance = DefineInput(*this, U32[1], true, spv::BuiltIn::BaseInstance); |
| 1444 | } | 1444 | } |
| 1445 | } else { | 1445 | } else { |
| 1446 | instance_index = DefineInput(*this, U32[1], true, spv::BuiltIn::InstanceIndex); | 1446 | instance_index = DefineInput(*this, U32[1], true, spv::BuiltIn::InstanceIndex); |