From 632c9e4ee3417aaa89db377777377d91c69c7887 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Mon, 7 Oct 2019 14:48:58 -0300 Subject: [PATCH 1/2] shader/half_set_predicate: Reduce DEBUG_ASSERT to LOG_DEBUG --- src/video_core/shader/decode/half_set_predicate.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video_core/shader/decode/half_set_predicate.cpp b/src/video_core/shader/decode/half_set_predicate.cpp index 8406945278..26d267b4cb 100644 --- a/src/video_core/shader/decode/half_set_predicate.cpp +++ b/src/video_core/shader/decode/half_set_predicate.cpp @@ -4,6 +4,7 @@ #include "common/assert.h" #include "common/common_types.h" +#include "common/logging/log.h" #include "video_core/engines/shader_bytecode.h" #include "video_core/shader/node_helper.h" #include "video_core/shader/shader_ir.h" @@ -18,7 +19,7 @@ u32 ShaderIR::DecodeHalfSetPredicate(NodeBlock& bb, u32 pc) { const Instruction instr = {program_code[pc]}; const auto opcode = OpCode::Decode(instr); - DEBUG_ASSERT(instr.hsetp2.ftz == 0); + LOG_DEBUG(HW_GPU, "ftz={}", static_cast(instr.hsetp2.ftz)); Node op_a = UnpackHalfFloat(GetRegister(instr.gpr8), instr.hsetp2.type_a); op_a = GetOperandAbsNegHalf(op_a, instr.hsetp2.abs_a, instr.hsetp2.negate_a); From 3d0f35730734598651dc4cac830fff5158e53635 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Mon, 7 Oct 2019 14:49:47 -0300 Subject: [PATCH 2/2] shader/half_set_predicate: Fix HSETP2 for constant buffers HSETP2 when used with a constant buffer parses the second operand type as F32. This is not configurable. --- src/video_core/shader/decode/half_set_predicate.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/video_core/shader/decode/half_set_predicate.cpp b/src/video_core/shader/decode/half_set_predicate.cpp index 26d267b4cb..fec8f2dbef 100644 --- a/src/video_core/shader/decode/half_set_predicate.cpp +++ b/src/video_core/shader/decode/half_set_predicate.cpp @@ -33,6 +33,8 @@ u32 ShaderIR::DecodeHalfSetPredicate(NodeBlock& bb, u32 pc) { h_and = instr.hsetp2.cbuf_and_imm.h_and; op_b = GetOperandAbsNegHalf(GetConstBuffer(instr.cbuf34.index, instr.cbuf34.GetOffset()), instr.hsetp2.cbuf.abs_b, instr.hsetp2.cbuf.negate_b); + // F32 is hardcoded in hardware + op_b = UnpackHalfFloat(std::move(op_b), Tegra::Shader::HalfType::F32); break; case OpCode::Id::HSETP2_IMM: cond = instr.hsetp2.cbuf_and_imm.cond;