From bd9872894411060e8b72c8eada341406a350d21d Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Tue, 26 Nov 2024 23:23:41 +0300 Subject: [PATCH] Remove "has bone" specialization constant. --- ShaderRecomp/shader_common.h | 9 ++++----- ShaderRecomp/shader_recompiler.cpp | 16 ++++------------ 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/ShaderRecomp/shader_common.h b/ShaderRecomp/shader_common.h index ecf1d04..7ce0d8a 100644 --- a/ShaderRecomp/shader_common.h +++ b/ShaderRecomp/shader_common.h @@ -2,11 +2,10 @@ #define SHADER_COMMON_H_INCLUDED #define SPEC_CONSTANT_R11G11B10_NORMAL (1 << 0) -#define SPEC_CONSTANT_HAS_BONE (1 << 1) -#define SPEC_CONSTANT_BICUBIC_GI_FILTER (1 << 2) -#define SPEC_CONSTANT_ALPHA_TEST (1 << 3) -#define SPEC_CONSTANT_ALPHA_TO_COVERAGE (1 << 4) -#define SPEC_CONSTANT_REVERSE_Z (1 << 5) +#define SPEC_CONSTANT_BICUBIC_GI_FILTER (1 << 1) +#define SPEC_CONSTANT_ALPHA_TEST (1 << 2) +#define SPEC_CONSTANT_ALPHA_TO_COVERAGE (1 << 3) +#define SPEC_CONSTANT_REVERSE_Z (1 << 4) #if !defined(__cplusplus) || defined(__INTELLISENSE__) diff --git a/ShaderRecomp/shader_recompiler.cpp b/ShaderRecomp/shader_recompiler.cpp index cf39d1a..779b5f0 100644 --- a/ShaderRecomp/shader_recompiler.cpp +++ b/ShaderRecomp/shader_recompiler.cpp @@ -1653,19 +1653,11 @@ void ShaderRecompiler::recompile(const uint8_t* shaderData, const std::string_vi } else { - if (!isPixelShader && cfInstr.condJmp.boolAddress == 0) // mrgHasBone - { - specConstantsMask |= SPEC_CONSTANT_HAS_BONE; - println("if ((g_SpecConstants() & SPEC_CONSTANT_HAS_BONE) {}= 0)", cfInstr.condJmp.condition ^ simpleControlFlow ? "!" : "="); - } + auto findResult = boolConstants.find(cfInstr.condJmp.boolAddress); + if (findResult != boolConstants.end()) + println("if ((g_Booleans & {}) {}= 0)", findResult->second, cfInstr.condJmp.condition ^ simpleControlFlow ? "!" : "="); else - { - auto findResult = boolConstants.find(cfInstr.condJmp.boolAddress); - if (findResult != boolConstants.end()) - println("if ((g_Booleans & {}) {}= 0)", findResult->second, cfInstr.condJmp.condition ^ simpleControlFlow ? "!" : "="); - else - println("if (b{} {}= 0)", uint32_t(cfInstr.condJmp.boolAddress), cfInstr.condJmp.condition ^ simpleControlFlow ? "!" : "="); - } + println("if (b{} {}= 0)", uint32_t(cfInstr.condJmp.boolAddress), cfInstr.condJmp.condition ^ simpleControlFlow ? "!" : "="); } if (simpleControlFlow)