diff options
author | FernandoS27 <fsahmkow27@gmail.com> | 2021-03-26 16:02:04 +0100 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:24 +0200 |
commit | 742d11c2ad948c8630be15901514ec9e5e5fcd20 (patch) | |
tree | 4d9e0976f8c95fbb5c8006b46579200315b04f0f /src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | |
parent | shader: Fix Array Indices in TEX/TLD4 (diff) | |
download | yuzu-742d11c2ad948c8630be15901514ec9e5e5fcd20.tar yuzu-742d11c2ad948c8630be15901514ec9e5e5fcd20.tar.gz yuzu-742d11c2ad948c8630be15901514ec9e5e5fcd20.tar.bz2 yuzu-742d11c2ad948c8630be15901514ec9e5e5fcd20.tar.lz yuzu-742d11c2ad948c8630be15901514ec9e5e5fcd20.tar.xz yuzu-742d11c2ad948c8630be15901514ec9e5e5fcd20.tar.zst yuzu-742d11c2ad948c8630be15901514ec9e5e5fcd20.zip |
Diffstat (limited to '')
-rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp index 589013773..776afd4ab 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp @@ -30,10 +30,13 @@ public: } } - explicit ImageOperands([[maybe_unused]] EmitContext& ctx, Id offset) { + explicit ImageOperands([[maybe_unused]] EmitContext& ctx, Id offset, Id offset2) { if (Sirit::ValidId(offset)) { Add(spv::ImageOperandsMask::Offset, offset); } + if (Sirit::ValidId(offset2)) { + Add(spv::ImageOperandsMask::ConstOffsets, offset2); + } } void Add(spv::ImageOperandsMask new_mask, Id value) { @@ -177,7 +180,7 @@ Id EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Va Id EmitImageGather(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, Id offset, [[maybe_unused]] Id offset2) { const auto info{inst->Flags<IR::TextureInstInfo>()}; - const ImageOperands operands(ctx, offset); + const ImageOperands operands(ctx, offset, offset2); return Emit(&EmitContext::OpImageSparseGather, &EmitContext::OpImageGather, ctx, inst, ctx.F32[4], Texture(ctx, index), coords, ctx.Constant(ctx.U32[1], info.gather_component.Value()), operands.Mask(), @@ -187,7 +190,7 @@ Id EmitImageGather(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id Id EmitImageGatherDref(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, Id offset, [[maybe_unused]] Id offset2, Id dref) { const auto info{inst->Flags<IR::TextureInstInfo>()}; - const ImageOperands operands(ctx, offset); + const ImageOperands operands(ctx, offset, offset2); return Emit(&EmitContext::OpImageSparseDrefGather, &EmitContext::OpImageDrefGather, ctx, inst, ctx.F32[4], Texture(ctx, index), coords, dref, operands.Mask(), operands.Span()); } |