From 71541c13242ef36e49ee7974d792a9e887c405df Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Thu, 7 Jul 2022 13:54:31 -0700 Subject: [PATCH] VideoCommon: Fix D3D shader warning X4000 (uninitialized variables) Initialize alpha_A and alpha_B. They were previously only initialized in cases where they were used, but D3D isn't able to figure that out. --- Source/Core/VideoCommon/UberShaderPixel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoCommon/UberShaderPixel.cpp b/Source/Core/VideoCommon/UberShaderPixel.cpp index a96b15c83d..67f7ce5524 100644 --- a/Source/Core/VideoCommon/UberShaderPixel.cpp +++ b/Source/Core/VideoCommon/UberShaderPixel.cpp @@ -889,8 +889,8 @@ ShaderCode GenPixelShader(APIType api_type, const ShaderHostConfig& host_config, out.Write( " uint alpha_compare_op = alpha_scale << 1 | uint(alpha_op);\n" "\n" - " int alpha_A;\n" - " int alpha_B;\n" + " int alpha_A = 0;\n" + " int alpha_B = 0;\n" " if (alpha_bias != 3u || alpha_compare_op > 5u) {{\n" " // Small optimisation here: alpha_A and alpha_B are unused by compare ops 0-5\n" " alpha_A = selectAlphaInput(s, ss, {0}colors_0, {0}colors_1, alpha_a) & 255;\n"