diff options
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_spirv_image.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp index f0f8db8c3..815ca6299 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | |||
| @@ -43,11 +43,13 @@ public: | |||
| 43 | // LOG_WARNING("Not all arguments in PTP are immediate, STUBBING"); | 43 | // LOG_WARNING("Not all arguments in PTP are immediate, STUBBING"); |
| 44 | return; | 44 | return; |
| 45 | } | 45 | } |
| 46 | const IR::Opcode opcode{values[0]->Opcode()}; | 46 | const IR::Opcode opcode{values[0]->GetOpcode()}; |
| 47 | if (opcode != values[1]->Opcode() || opcode != IR::Opcode::CompositeConstructU32x4) { | 47 | if (opcode != values[1]->GetOpcode() || opcode != IR::Opcode::CompositeConstructU32x4) { |
| 48 | throw LogicError("Invalid PTP arguments"); | 48 | throw LogicError("Invalid PTP arguments"); |
| 49 | } | 49 | } |
| 50 | auto read{[&](int a, int b) { return ctx.Constant(ctx.U32[1], values[a]->Arg(b).U32()); }}; | 50 | auto read{[&](unsigned int a, unsigned int b) { |
| 51 | return ctx.Constant(ctx.U32[1], values[a]->Arg(b).U32()); | ||
| 52 | }}; | ||
| 51 | 53 | ||
| 52 | const Id offsets{ | 54 | const Id offsets{ |
| 53 | ctx.ConstantComposite(ctx.TypeArray(ctx.U32[2], ctx.Constant(ctx.U32[1], 4)), | 55 | ctx.ConstantComposite(ctx.TypeArray(ctx.U32[2], ctx.Constant(ctx.U32[1], 4)), |
| @@ -297,13 +299,14 @@ Id EmitImageGather(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id | |||
| 297 | 299 | ||
| 298 | Id EmitImageGatherDref(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, | 300 | Id EmitImageGatherDref(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, |
| 299 | const IR::Value& offset, const IR::Value& offset2, Id dref) { | 301 | const IR::Value& offset, const IR::Value& offset2, Id dref) { |
| 300 | const auto info{inst->Flags<IR::TextureInstInfo>()}; | ||
| 301 | const ImageOperands operands(ctx, offset, offset2); | 302 | const ImageOperands operands(ctx, offset, offset2); |
| 302 | return Emit(&EmitContext::OpImageSparseDrefGather, &EmitContext::OpImageDrefGather, ctx, inst, | 303 | return Emit(&EmitContext::OpImageSparseDrefGather, &EmitContext::OpImageDrefGather, ctx, inst, |
| 303 | ctx.F32[4], Texture(ctx, index), coords, dref, operands.Mask(), operands.Span()); | 304 | ctx.F32[4], Texture(ctx, index), coords, dref, operands.Mask(), operands.Span()); |
| 304 | } | 305 | } |
| 305 | 306 | ||
| 307 | #ifdef _WIN32 | ||
| 306 | #pragma optimize("", off) | 308 | #pragma optimize("", off) |
| 309 | #endif | ||
| 307 | 310 | ||
| 308 | Id EmitImageFetch(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, Id offset, | 311 | Id EmitImageFetch(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, Id offset, |
| 309 | Id lod, Id ms) { | 312 | Id lod, Id ms) { |