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 | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp index 647804814..3588f052b 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | |||
| @@ -109,7 +109,7 @@ private: | |||
| 109 | return; | 109 | return; |
| 110 | } | 110 | } |
| 111 | if (offset.IsImmediate()) { | 111 | if (offset.IsImmediate()) { |
| 112 | Add(spv::ImageOperandsMask::ConstOffset, ctx.SConst(offset.U32())); | 112 | Add(spv::ImageOperandsMask::ConstOffset, ctx.SConst(static_cast<s32>(offset.U32()))); |
| 113 | return; | 113 | return; |
| 114 | } | 114 | } |
| 115 | IR::Inst* const inst{offset.InstRecursive()}; | 115 | IR::Inst* const inst{offset.InstRecursive()}; |
| @@ -117,16 +117,21 @@ private: | |||
| 117 | switch (inst->GetOpcode()) { | 117 | switch (inst->GetOpcode()) { |
| 118 | case IR::Opcode::CompositeConstructU32x2: | 118 | case IR::Opcode::CompositeConstructU32x2: |
| 119 | Add(spv::ImageOperandsMask::ConstOffset, | 119 | Add(spv::ImageOperandsMask::ConstOffset, |
| 120 | ctx.SConst(inst->Arg(0).U32(), inst->Arg(1).U32())); | 120 | ctx.SConst(static_cast<s32>(inst->Arg(0).U32()), |
| 121 | static_cast<s32>(inst->Arg(1).U32()))); | ||
| 121 | return; | 122 | return; |
| 122 | case IR::Opcode::CompositeConstructU32x3: | 123 | case IR::Opcode::CompositeConstructU32x3: |
| 123 | Add(spv::ImageOperandsMask::ConstOffset, | 124 | Add(spv::ImageOperandsMask::ConstOffset, |
| 124 | ctx.SConst(inst->Arg(0).U32(), inst->Arg(1).U32(), inst->Arg(2).U32())); | 125 | ctx.SConst(static_cast<s32>(inst->Arg(0).U32()), |
| 126 | static_cast<s32>(inst->Arg(1).U32()), | ||
| 127 | static_cast<s32>(inst->Arg(2).U32()))); | ||
| 125 | return; | 128 | return; |
| 126 | case IR::Opcode::CompositeConstructU32x4: | 129 | case IR::Opcode::CompositeConstructU32x4: |
| 127 | Add(spv::ImageOperandsMask::ConstOffset, | 130 | Add(spv::ImageOperandsMask::ConstOffset, |
| 128 | ctx.SConst(inst->Arg(0).U32(), inst->Arg(1).U32(), inst->Arg(2).U32(), | 131 | ctx.SConst(static_cast<s32>(inst->Arg(0).U32()), |
| 129 | inst->Arg(3).U32())); | 132 | static_cast<s32>(inst->Arg(1).U32()), |
| 133 | static_cast<s32>(inst->Arg(2).U32()), | ||
| 134 | static_cast<s32>(inst->Arg(3).U32()))); | ||
| 130 | return; | 135 | return; |
| 131 | default: | 136 | default: |
| 132 | break; | 137 | break; |