From 5d529baafbc6c32e6e6637ac784e73be3ea61026 Mon Sep 17 00:00:00 2001 From: Zephyron Date: Tue, 31 Dec 2024 21:33:37 +1000 Subject: [PATCH] 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. --- .../translate/impl/floating_point_swizzled_add.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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) {