summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/ir_opt
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-08-01 18:57:45 -0300
committerGravatar Fernando Sahmkow2021-11-16 22:11:29 +0100
commite66d5b88a6f1c2d85c5cd8e351c6ed52c96a0ecf (patch)
tree0107548906df0b9d42e89451489be6a54ed71bf3 /src/shader_recompiler/ir_opt
parentshader: Properly blacklist and scale image loads (diff)
downloadyuzu-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/ir_opt')
-rw-r--r--src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp1
-rw-r--r--src/shader_recompiler/ir_opt/rescaling_pass.cpp3
2 files changed, 2 insertions, 2 deletions
diff --git a/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp b/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
index ed82fa2ac..1e476d83d 100644
--- a/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
+++ b/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
@@ -432,6 +432,7 @@ void VisitUsages(Info& info, IR::Inst& inst) {
432 break; 432 break;
433 case IR::Opcode::ResolutionDownFactor: 433 case IR::Opcode::ResolutionDownFactor:
434 case IR::Opcode::IsTextureScaled: 434 case IR::Opcode::IsTextureScaled:
435 case IR::Opcode::IsImageScaled:
435 info.uses_rescaling_uniform = true; 436 info.uses_rescaling_uniform = true;
436 break; 437 break;
437 case IR::Opcode::LaneId: 438 case IR::Opcode::LaneId:
diff --git a/src/shader_recompiler/ir_opt/rescaling_pass.cpp b/src/shader_recompiler/ir_opt/rescaling_pass.cpp
index 86c8f0c69..2af12fc07 100644
--- a/src/shader_recompiler/ir_opt/rescaling_pass.cpp
+++ b/src/shader_recompiler/ir_opt/rescaling_pass.cpp
@@ -129,8 +129,7 @@ void PatchImageFetch(IR::Block& block, IR::Inst& inst) {
129void PatchImageRead(IR::Block& block, IR::Inst& inst) { 129void PatchImageRead(IR::Block& block, IR::Inst& inst) {
130 IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; 130 IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)};
131 const auto info{inst.Flags<IR::TextureInstInfo>()}; 131 const auto info{inst.Flags<IR::TextureInstInfo>()};
132 // TODO: Scale conditionally 132 const IR::U1 is_scaled{ir.IsImageScaled(ir.Imm32(info.descriptor_index))};
133 const IR::U1 is_scaled{IR::Value{true}};
134 ScaleIntegerCoord(ir, inst, is_scaled); 133 ScaleIntegerCoord(ir, inst, is_scaled);
135} 134}
136 135