summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-09-27 04:43:06 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2021-11-16 22:11:30 +0100
commitdd663844513c82a24456dbc68b9ad6665506bea9 (patch)
tree0877807f3f75ab8c4ee5c9c814b6075675fdeeae /src/shader_recompiler
parentvk_texture_cache: Simplify scaled image management (diff)
downloadyuzu-dd663844513c82a24456dbc68b9ad6665506bea9.tar
yuzu-dd663844513c82a24456dbc68b9ad6665506bea9.tar.gz
yuzu-dd663844513c82a24456dbc68b9ad6665506bea9.tar.bz2
yuzu-dd663844513c82a24456dbc68b9ad6665506bea9.tar.lz
yuzu-dd663844513c82a24456dbc68b9ad6665506bea9.tar.xz
yuzu-dd663844513c82a24456dbc68b9ad6665506bea9.tar.zst
yuzu-dd663844513c82a24456dbc68b9ad6665506bea9.zip
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r--src/shader_recompiler/ir_opt/rescaling_pass.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/shader_recompiler/ir_opt/rescaling_pass.cpp b/src/shader_recompiler/ir_opt/rescaling_pass.cpp
index 357e41f2b..51125f45a 100644
--- a/src/shader_recompiler/ir_opt/rescaling_pass.cpp
+++ b/src/shader_recompiler/ir_opt/rescaling_pass.cpp
@@ -249,6 +249,7 @@ void PatchImageRead(IR::Block& block, IR::Inst& inst) {
void Visit(const IR::Program& program, IR::Block& block, IR::Inst& inst) {
const bool is_fragment_shader{program.stage == Stage::Fragment};
+ const bool is_compute_shader{program.stage == Stage::Compute};
switch (inst.GetOpcode()) {
case IR::Opcode::GetAttribute: {
const IR::Attribute attr{inst.Arg(0).Attribute()};
@@ -265,21 +266,19 @@ void Visit(const IR::Program& program, IR::Block& block, IR::Inst& inst) {
break;
}
case IR::Opcode::ImageQueryDimensions:
- if (program.stage == Stage::Compute) {
- PatchImageQueryDimensions(block, inst);
- }
+ PatchImageQueryDimensions(block, inst);
break;
case IR::Opcode::ImageFetch:
if (is_fragment_shader) {
SubScaleImageFetch(block, inst);
- } else if (program.stage == Stage::Compute) {
+ } else if (is_compute_shader) {
PatchImageFetch(block, inst);
}
break;
case IR::Opcode::ImageRead:
if (is_fragment_shader) {
SubScaleImageRead(block, inst);
- } else if (program.stage == Stage::Compute) {
+ } else if (is_compute_shader) {
PatchImageRead(block, inst);
}
break;