summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp
diff options
context:
space:
mode:
authorGravatar lat9nq2021-04-05 22:25:22 -0400
committerGravatar ameerj2021-07-22 21:51:26 -0400
commit0bb85f6a753c769266c95c4ba146b25b9eaaaffd (patch)
treee5d818ae7dc1d0025bb115c7a63235d866e53286 /src/shader_recompiler/backend/spirv/emit_spirv_image.cpp
parentshader: Fix FCMP immediate variant (diff)
downloadyuzu-0bb85f6a753c769266c95c4ba146b25b9eaaaffd.tar.gz
yuzu-0bb85f6a753c769266c95c4ba146b25b9eaaaffd.tar.xz
yuzu-0bb85f6a753c769266c95c4ba146b25b9eaaaffd.zip
shader_recompiler,video_core: Cleanup some GCC and Clang errors
Mostly fixing unused *, implicit conversion, braced scalar init, fpermissive, and some others. Some Clang errors likely remain in video_core, and std::ranges is still a pertinent issue in shader_recompiler shader_recompiler: cmake: Force bracket depth to 1024 on Clang Increases the maximum fold expression depth thread_worker: Include condition_variable Don't use list initializers in control flow Co-authored-by: ReinUsesLisp <reinuseslisp@airmail.cc>
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_spirv_image.cpp')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_image.cpp11
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
298Id EmitImageGatherDref(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, 300Id 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
308Id EmitImageFetch(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, Id offset, 311Id EmitImageFetch(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, Id offset,
309 Id lod, Id ms) { 312 Id lod, Id ms) {