summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-03-15 00:03:23 +0100
committerGitHub <noreply@github.com>2022-03-15 00:03:23 +0100
commitcc285b992436c0616dfb1e6ec04ba384dea48f6f (patch)
tree0347a1e07b8a5de7659d01ccbdd41a841634174f /src/shader_recompiler
parentMerge pull request #8016 from merryhime/kill-mem-use (diff)
parentShader decompiler: do constant propgation before texture pass. (diff)
downloadyuzu-cc285b992436c0616dfb1e6ec04ba384dea48f6f.tar
yuzu-cc285b992436c0616dfb1e6ec04ba384dea48f6f.tar.gz
yuzu-cc285b992436c0616dfb1e6ec04ba384dea48f6f.tar.bz2
yuzu-cc285b992436c0616dfb1e6ec04ba384dea48f6f.tar.lz
yuzu-cc285b992436c0616dfb1e6ec04ba384dea48f6f.tar.xz
yuzu-cc285b992436c0616dfb1e6ec04ba384dea48f6f.tar.zst
yuzu-cc285b992436c0616dfb1e6ec04ba384dea48f6f.zip
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate_program.cpp4
-rw-r--r--src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate_program.cpp b/src/shader_recompiler/frontend/maxwell/translate_program.cpp
index 248ad3ced..b22725584 100644
--- a/src/shader_recompiler/frontend/maxwell/translate_program.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate_program.cpp
@@ -212,11 +212,11 @@ IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::Blo
}
Optimization::SsaRewritePass(program);
+ Optimization::ConstantPropagationPass(program);
+
Optimization::GlobalMemoryToStorageBufferPass(program);
Optimization::TexturePass(env, program);
- Optimization::ConstantPropagationPass(program);
-
if (Settings::values.resolution_info.active) {
Optimization::RescalingPass(program);
}
diff --git a/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp b/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp
index 38592afd0..ddf497e32 100644
--- a/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp
+++ b/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp
@@ -334,7 +334,8 @@ std::optional<LowAddrInfo> TrackLowAddress(IR::Inst* inst) {
/// Tries to track the storage buffer address used by a global memory instruction
std::optional<StorageBufferAddr> Track(const IR::Value& value, const Bias* bias) {
const auto pred{[bias](const IR::Inst* inst) -> std::optional<StorageBufferAddr> {
- if (inst->GetOpcode() != IR::Opcode::GetCbufU32) {
+ if (inst->GetOpcode() != IR::Opcode::GetCbufU32 &&
+ inst->GetOpcode() != IR::Opcode::GetCbufU32x2) {
return std::nullopt;
}
const IR::Value index{inst->Arg(0)};