diff options
| author | 2021-08-01 18:57:45 -0300 | |
|---|---|---|
| committer | 2021-11-16 22:11:29 +0100 | |
| commit | e66d5b88a6f1c2d85c5cd8e351c6ed52c96a0ecf (patch) | |
| tree | 0107548906df0b9d42e89451489be6a54ed71bf3 /src/shader_recompiler/backend/glasm/emit_glasm_image.cpp | |
| parent | shader: Properly blacklist and scale image loads (diff) | |
| download | yuzu-e66d5b88a6f1c2d85c5cd8e351c6ed52c96a0ecf.tar.gz yuzu-e66d5b88a6f1c2d85c5cd8e351c6ed52c96a0ecf.tar.xz yuzu-e66d5b88a6f1c2d85c5cd8e351c6ed52c96a0ecf.zip | |
shader: Properly scale image reads and add GL SPIR-V support
Thanks for everything!
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_glasm_image.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_image.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp index 05e88cd97..d325d31c7 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp | |||
| @@ -617,6 +617,15 @@ void EmitIsTextureScaled(EmitContext& ctx, IR::Inst& inst, const IR::Value& inde | |||
| 617 | 1u << index.U32(), ctx.reg_alloc.Define(inst)); | 617 | 1u << index.U32(), ctx.reg_alloc.Define(inst)); |
| 618 | } | 618 | } |
| 619 | 619 | ||
| 620 | void EmitIsImageScaled(EmitContext& ctx, IR::Inst& inst, const IR::Value& index) { | ||
| 621 | if (!index.IsImmediate()) { | ||
| 622 | throw NotImplementedException("Non-constant texture rescaling"); | ||
| 623 | } | ||
| 624 | ctx.Add("AND.U RC.x,scaling[0].y,{};" | ||
| 625 | "SNE.S {},RC.x,0;", | ||
| 626 | 1u << index.U32(), ctx.reg_alloc.Define(inst)); | ||
| 627 | } | ||
| 628 | |||
| 620 | void EmitImageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coord, | 629 | void EmitImageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coord, |
| 621 | ScalarU32 value) { | 630 | ScalarU32 value) { |
| 622 | ImageAtomic(ctx, inst, index, coord, value, "ADD.U32"); | 631 | ImageAtomic(ctx, inst, index, coord, value, "ADD.U32"); |