diff options
| author | MaranBr <maranbr@outlook.com> | 2026-02-12 01:34:25 +0100 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2026-02-12 01:34:25 +0100 |
| commit | 7d81a724ef9d0e438f0060369b3edf44ecb807f3 (patch) | |
| tree | 5732421248613add7f2dd4bf5b9ca8cb39f089e7 /src | |
| parent | 634686d59b250c26b05f3ca46f3fe5be53f258af (diff) | |
[shader_recompiler] Fix Shuffle handling for Position attributes (#3406)
This fixes the rescaling path to properly convert to F32, matching native 1x behavior for any resolution.
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3406
Reviewed-by: DraVee <dravee@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Co-authored-by: MaranBr <maranbr@outlook.com>
Co-committed-by: MaranBr <maranbr@outlook.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/shader_recompiler/frontend/maxwell/translate_program.cpp | 10 | ||||
| -rw-r--r-- | src/shader_recompiler/ir_opt/rescaling_pass.cpp | 10 |
2 files changed, 8 insertions, 12 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate_program.cpp b/src/shader_recompiler/frontend/maxwell/translate_program.cpp index dfd5f405fb..81aee6453a 100644 --- a/src/shader_recompiler/frontend/maxwell/translate_program.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate_program.cpp @@ -304,17 +304,9 @@ IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::Blo Optimization::GlobalMemoryToStorageBufferPass(program, host_info); Optimization::TexturePass(env, program, host_info); - bool should_rescale = -#ifdef __ANDROID__ - Settings::values.resolution_info.active; -#else - true; -#endif - - if (should_rescale) { + if (Settings::values.resolution_info.active) { Optimization::RescalingPass(program); } - Optimization::DeadCodeEliminationPass(program); if (Settings::values.renderer_debug) { Optimization::VerificationPass(program); diff --git a/src/shader_recompiler/ir_opt/rescaling_pass.cpp b/src/shader_recompiler/ir_opt/rescaling_pass.cpp index 9198fa5f2e..cae8110a26 100644 --- a/src/shader_recompiler/ir_opt/rescaling_pass.cpp +++ b/src/shader_recompiler/ir_opt/rescaling_pass.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -63,10 +66,11 @@ void VisitMark(IR::Block& block, IR::Inst& inst) { } if (must_patch_outside) { const auto it{IR::Block::InstructionList::s_iterator_to(inst)}; - IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; - const IR::F32 new_inst{&*block.PrependNewInst(it, inst)}; + IR::IREmitter ir{block, it}; + IR::Inst* const new_inst{&*block.PrependNewInst(it, inst)}; + const IR::F32 new_bitcast{ir.ConvertUToF(32, 32, IR::Value{new_inst})}; const IR::F32 up_factor{ir.FPRecip(ir.ResolutionDownFactor())}; - const IR::Value converted{ir.FPMul(new_inst, up_factor)}; + const IR::Value converted{ir.FPMul(new_bitcast, up_factor)}; inst.ReplaceUsesWith(converted); } break; |
