Browse Source
Merge pull request #8015 from FernandoS27/fix-global-mem
Shader decompiler: Fix storage tracking in deko3d.
pull/15/merge
bunnei
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
4 additions and
3 deletions
-
src/shader_recompiler/frontend/maxwell/translate_program.cpp
-
src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.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); |
|
|
|
} |
|
|
|
|
|
|
|
@ -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)}; |
|
|
|
|