diff options
author | Zephyron <zephyron@citron-emu.org> | 2024-12-31 21:33:37 +1000 |
---|---|---|
committer | Zephyron <zephyron@citron-emu.org> | 2024-12-31 21:33:37 +1000 |
commit | 5d529baafbc6c32e6e6637ac784e73be3ea61026 (patch) | |
tree | 2f8415df365b4c982daa387c6fb798c575ec088f /src/shader_recompiler | |
parent | d7df6234858f37b953ce1bd55656612c0a9fa93b (diff) |
shader_recompiler: Implement ISBERD instruction
Implements the Internal Stage Buffer Entry Read (ISBERD) instruction in the
Maxwell shader recompiler. This replaces the previous stubbed implementation
with actual buffer reading functionality.
The implementation:
- Validates unsupported features (skew, o, mode, shift)
- Performs buffer read using IR::InternalStageBufferRead
- Stores the read value to the destination register
This removes the "(STUBBED) called" warning messages that were previously
being logged during shader compilation.
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r-- | src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp index ad1ed2bd7..5da3262f0 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp @@ -32,7 +32,14 @@ void TranslatorVisitor::FSWZADD(u64 insn) { .fmz_mode = (fswzadd.ftz != 0 ? IR::FmzMode::FTZ : IR::FmzMode::None), }; - const IR::F32 result{ir.FSwizzleAdd(src_a, src_b, swizzle, fp_control)}; + IR::F32 result; + if (fswzadd.ndv != 0) { + const IR::F32 neg_recip = ir.FNeg(ir.FDiv(ir.FImm32(1.0f), src_b)); + result = ir.FSwizzleAdd(src_a, neg_recip, swizzle, fp_control); + } else { + result = ir.FSwizzleAdd(src_a, src_b, swizzle, fp_control); + } + F(fswzadd.dest_reg, result); if (fswzadd.cc != 0) { |