VERY experimental Nintendo Switch 2 emulator
C++
Shader_Ir: Downgrade precision and rounding asserts to debug asserts.
Fernando Sahmkowa13b47f080bd
diff --git a/src/video_core/shader/decode/arithmetic.cpp b/src/video_core/shader/decode/arithmetic.cppindex 87d8fecaa3..05a5f19d28 100644--- a/src/video_core/shader/decode/arithmetic.cpp+++ b/src/video_core/shader/decode/arithmetic.cpp@@ -42,10 +42,10 @@ u32 ShaderIR::DecodeArithmetic(NodeBlock& bb, u32 pc) {case OpCode::Id::FMUL_R:case OpCode::Id::FMUL_IMM: {// FMUL does not have 'abs' bits and only the second operand has a 'neg' bit.- UNIMPLEMENTED_IF_MSG(instr.fmul.tab5cb8_2 != 0, "FMUL tab5cb8_2({}) is not implemented",- instr.fmul.tab5cb8_2.Value());- UNIMPLEMENTED_IF_MSG(- instr.fmul.tab5c68_0 != 1, "FMUL tab5cb8_0({}) is not implemented",+ DEBUG_ASSERT_MSG(instr.fmul.tab5cb8_2 == 0, "FMUL tab5cb8_2({}) is not implemented",+ instr.fmul.tab5cb8_2.Value());+ DEBUG_ASSERT_MSG(+ instr.fmul.tab5c68_0 == 1, "FMUL tab5cb8_0({}) is not implemented",instr.fmul.tab5c68_0.Value()); // SMO typical sends 1 here which seems to be the defaultop_b = GetOperandAbsNegFloat(op_b, false, instr.fmul.negate_b);diff --git a/src/video_core/shader/decode/arithmetic_half_immediate.cpp b/src/video_core/shader/decode/arithmetic_half_immediate.cppindex 7bcf38f233..60381b4827 100644--- a/src/video_core/shader/decode/arithmetic_half_immediate.cpp+++ b/src/video_core/shader/decode/arithmetic_half_immediate.cpp@@ -23,7 +23,7 @@ u32 ShaderIR::DecodeArithmeticHalfImmediate(NodeBlock& bb, u32 pc) {LOG_WARNING(HW_GPU, "{} FTZ not implemented", opcode->get().GetName());}} else {- UNIMPLEMENTED_IF(instr.alu_half_imm.precision != Tegra::Shader::HalfPrecision::None);+ DEBUG_ASSERT(instr.alu_half_imm.precision == Tegra::Shader::HalfPrecision::None);}Node op_a = UnpackHalfFloat(GetRegister(instr.gpr8), instr.alu_half_imm.type_a);diff --git a/src/video_core/shader/decode/ffma.cpp b/src/video_core/shader/decode/ffma.cppindex 29be25ca32..a39283a9c2 100644--- a/src/video_core/shader/decode/ffma.cpp+++ b/src/video_core/shader/decode/ffma.cpp@@ -18,9 +18,9 @@ u32 ShaderIR::DecodeFfma(NodeBlock& bb, u32 pc) {const auto opcode = OpCode::Decode(instr);UNIMPLEMENTED_IF_MSG(instr.ffma.cc != 0, "FFMA cc not implemented");- UNIMPLEMENTED_IF_MSG(instr.ffma.tab5980_0 != 1, "FFMA tab5980_0({}) not implemented",+ DEBUG_ASSERT_MSG(instr.ffma.tab5980_0 == 1, "FFMA tab5980_0({}) not implemented",instr.ffma.tab5980_0.Value()); // Seems to be 1 by default based on SMO- UNIMPLEMENTED_IF_MSG(instr.ffma.tab5980_1 != 0, "FFMA tab5980_1({}) not implemented",+ DEBUG_ASSERT_MSG(instr.ffma.tab5980_1 == 0, "FFMA tab5980_1({}) not implemented",instr.ffma.tab5980_1.Value());const Node op_a = GetRegister(instr.gpr8);diff --git a/src/video_core/shader/decode/half_set_predicate.cpp b/src/video_core/shader/decode/half_set_predicate.cppindex d59d15bd8a..4587dbd00e 100644--- a/src/video_core/shader/decode/half_set_predicate.cpp+++ b/src/video_core/shader/decode/half_set_predicate.cpp@@ -18,7 +18,7 @@ u32 ShaderIR::DecodeHalfSetPredicate(NodeBlock& bb, u32 pc) {const Instruction instr = {program_code[pc]};const auto opcode = OpCode::Decode(instr);- UNIMPLEMENTED_IF(instr.hsetp2.ftz != 0);+ DEBUG_ASSERT(instr.hsetp2.ftz == 0);Node op_a = UnpackHalfFloat(GetRegister(instr.gpr8), instr.hsetp2.type_a);op_a = GetOperandAbsNegHalf(op_a, instr.hsetp2.abs_a, instr.hsetp2.negate_a);diff --git a/src/video_core/shader/decode/hfma2.cpp b/src/video_core/shader/decode/hfma2.cppindex c3bcf1ae9d..5b44cb79cb 100644--- a/src/video_core/shader/decode/hfma2.cpp+++ b/src/video_core/shader/decode/hfma2.cpp@@ -22,9 +22,9 @@ u32 ShaderIR::DecodeHfma2(NodeBlock& bb, u32 pc) {const auto opcode = OpCode::Decode(instr);if (opcode->get().GetId() == OpCode::Id::HFMA2_RR) {- UNIMPLEMENTED_IF(instr.hfma2.rr.precision != HalfPrecision::None);+ DEBUG_ASSERT(instr.hfma2.rr.precision == HalfPrecision::None);} else {- UNIMPLEMENTED_IF(instr.hfma2.precision != HalfPrecision::None);+ DEBUG_ASSERT(instr.hfma2.precision == HalfPrecision::None);}constexpr auto identity = HalfType::H0_H1;