From 3319719f0fb41823341f705e0af6a72b17c33df6 Mon Sep 17 00:00:00 2001 From: Wunkolo Date: Sat, 17 Aug 2024 12:56:45 -0700 Subject: [PATCH] shader_jit_x64: Zero-extend conditional-code bytes `mov` was doing a partial update of bits within the register, allowing garbage to be introduced in the upper bits of the register. --- src/video_core/shader/shader_jit_x64_compiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video_core/shader/shader_jit_x64_compiler.cpp b/src/video_core/shader/shader_jit_x64_compiler.cpp index ae80b694f..2dd3720b0 100644 --- a/src/video_core/shader/shader_jit_x64_compiler.cpp +++ b/src/video_core/shader/shader_jit_x64_compiler.cpp @@ -1002,8 +1002,8 @@ void JitShader::Compile(const std::array* program_ mov(LOOPCOUNT_REG, dword[STATE + offsetof(ShaderUnit, address_registers[2])]); // Load conditional code - mov(COND0, byte[STATE + offsetof(ShaderUnit, conditional_code[0])]); - mov(COND1, byte[STATE + offsetof(ShaderUnit, conditional_code[1])]); + movzx(COND0, byte[STATE + offsetof(ShaderUnit, conditional_code[0])]); + movzx(COND1, byte[STATE + offsetof(ShaderUnit, conditional_code[1])]); // Used to set a register to one static const __m128 one = {1.f, 1.f, 1.f, 1.f};