summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/ir_opt/texture_pass.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/ir_opt/texture_pass.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/ir_opt/texture_pass.cpp')
-rw-r--r--src/shader_recompiler/ir_opt/texture_pass.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/shader_recompiler/ir_opt/texture_pass.cpp b/src/shader_recompiler/ir_opt/texture_pass.cpp
index 290ce4179..c8aee3d3d 100644
--- a/src/shader_recompiler/ir_opt/texture_pass.cpp
+++ b/src/shader_recompiler/ir_opt/texture_pass.cpp
@@ -30,7 +30,7 @@ struct TextureInst {
30using TextureInstVector = boost::container::small_vector<TextureInst, 24>; 30using TextureInstVector = boost::container::small_vector<TextureInst, 24>;
31 31
32IR::Opcode IndexedInstruction(const IR::Inst& inst) { 32IR::Opcode IndexedInstruction(const IR::Inst& inst) {
33 switch (inst.Opcode()) { 33 switch (inst.GetOpcode()) {
34 case IR::Opcode::BindlessImageSampleImplicitLod: 34 case IR::Opcode::BindlessImageSampleImplicitLod:
35 case IR::Opcode::BoundImageSampleImplicitLod: 35 case IR::Opcode::BoundImageSampleImplicitLod:
36 return IR::Opcode::ImageSampleImplicitLod; 36 return IR::Opcode::ImageSampleImplicitLod;
@@ -67,7 +67,7 @@ IR::Opcode IndexedInstruction(const IR::Inst& inst) {
67} 67}
68 68
69bool IsBindless(const IR::Inst& inst) { 69bool IsBindless(const IR::Inst& inst) {
70 switch (inst.Opcode()) { 70 switch (inst.GetOpcode()) {
71 case IR::Opcode::BindlessImageSampleImplicitLod: 71 case IR::Opcode::BindlessImageSampleImplicitLod:
72 case IR::Opcode::BindlessImageSampleExplicitLod: 72 case IR::Opcode::BindlessImageSampleExplicitLod:
73 case IR::Opcode::BindlessImageSampleDrefImplicitLod: 73 case IR::Opcode::BindlessImageSampleDrefImplicitLod:
@@ -91,7 +91,7 @@ bool IsBindless(const IR::Inst& inst) {
91 case IR::Opcode::BoundImageGradient: 91 case IR::Opcode::BoundImageGradient:
92 return false; 92 return false;
93 default: 93 default:
94 throw InvalidArgument("Invalid opcode {}", inst.Opcode()); 94 throw InvalidArgument("Invalid opcode {}", inst.GetOpcode());
95 } 95 }
96} 96}
97 97
@@ -100,7 +100,7 @@ bool IsTextureInstruction(const IR::Inst& inst) {
100} 100}
101 101
102std::optional<ConstBufferAddr> TryGetConstBuffer(const IR::Inst* inst) { 102std::optional<ConstBufferAddr> TryGetConstBuffer(const IR::Inst* inst) {
103 if (inst->Opcode() != IR::Opcode::GetCbufU32) { 103 if (inst->GetOpcode() != IR::Opcode::GetCbufU32) {
104 return std::nullopt; 104 return std::nullopt;
105 } 105 }
106 const IR::Value index{inst->Arg(0)}; 106 const IR::Value index{inst->Arg(0)};
@@ -134,14 +134,14 @@ TextureInst MakeInst(Environment& env, IR::Block* block, IR::Inst& inst) {
134 addr = *track_addr; 134 addr = *track_addr;
135 } else { 135 } else {
136 addr = ConstBufferAddr{ 136 addr = ConstBufferAddr{
137 .index{env.TextureBoundBuffer()}, 137 .index = env.TextureBoundBuffer(),
138 .offset{inst.Arg(0).U32()}, 138 .offset = inst.Arg(0).U32(),
139 }; 139 };
140 } 140 }
141 return TextureInst{ 141 return TextureInst{
142 .cbuf{addr}, 142 .cbuf{addr},
143 .inst{&inst}, 143 .inst = &inst,
144 .block{block}, 144 .block = block,
145 }; 145 };
146} 146}
147 147
@@ -211,7 +211,7 @@ void TexturePass(Environment& env, IR::Program& program) {
211 211
212 const auto& cbuf{texture_inst.cbuf}; 212 const auto& cbuf{texture_inst.cbuf};
213 auto flags{inst->Flags<IR::TextureInstInfo>()}; 213 auto flags{inst->Flags<IR::TextureInstInfo>()};
214 switch (inst->Opcode()) { 214 switch (inst->GetOpcode()) {
215 case IR::Opcode::ImageQueryDimensions: 215 case IR::Opcode::ImageQueryDimensions:
216 flags.type.Assign(env.ReadTextureType(cbuf.index, cbuf.offset)); 216 flags.type.Assign(env.ReadTextureType(cbuf.index, cbuf.offset));
217 inst->SetFlags(flags); 217 inst->SetFlags(flags);
@@ -235,16 +235,16 @@ void TexturePass(Environment& env, IR::Program& program) {
235 u32 index; 235 u32 index;
236 if (flags.type == TextureType::Buffer) { 236 if (flags.type == TextureType::Buffer) {
237 index = descriptors.Add(TextureBufferDescriptor{ 237 index = descriptors.Add(TextureBufferDescriptor{
238 .cbuf_index{cbuf.index}, 238 .cbuf_index = cbuf.index,
239 .cbuf_offset{cbuf.offset}, 239 .cbuf_offset = cbuf.offset,
240 .count{1}, 240 .count = 1,
241 }); 241 });
242 } else { 242 } else {
243 index = descriptors.Add(TextureDescriptor{ 243 index = descriptors.Add(TextureDescriptor{
244 .type{flags.type}, 244 .type = flags.type,
245 .cbuf_index{cbuf.index}, 245 .cbuf_index = cbuf.index,
246 .cbuf_offset{cbuf.offset}, 246 .cbuf_offset = cbuf.offset,
247 .count{1}, 247 .count = 1,
248 }); 248 });
249 } 249 }
250 inst->SetArg(0, IR::Value{index}); 250 inst->SetArg(0, IR::Value{index});