diff options
| author | iwubcode <iwubcode@users.noreply.github.com> | 2025-06-05 01:37:29 -0500 |
|---|---|---|
| committer | iwubcode <iwubcode@users.noreply.github.com> | 2025-06-05 01:37:45 -0500 |
| commit | ae26b38fc0e4788ddb12e99a959f61854a512d54 (patch) | |
| tree | f8981a9b8dec999b515d3f0d76e47b8bdb9917ec /Source/Core/VideoCommon/PixelShaderGen.cpp | |
| parent | b7fb2fa737c9ba8137e31857b6c46d96a9167b27 (diff) | |
VideoCommon: fix pixel shader gen error about structure not being fully initialized
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderGen.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index ce90ecd42b..bd1acef7b8 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -1007,6 +1007,12 @@ ShaderCode GeneratePixelShaderCode(APIType api_type, const ShaderHostConfig& hos out.Write("\tfrag_input.tex{0} = tex{0};\n", i); } + // Initialize other texture coordinates that are unused + for (u32 i = uid_data->genMode_numtexgens; i < 8; i++) + { + out.Write("\tfrag_input.tex{0} = vec3(0, 0, 0);\n", i); + } + if (!custom_contents.shader.empty()) GenerateCustomLighting(&out, uid_data->lighting); @@ -2061,11 +2067,7 @@ static void WriteFragmentDefinitions(APIType api_type, const ShaderHostConfig& h out.Write("\tint layer;\n"); out.Write("\tvec3 normal;\n"); out.Write("\tvec3 position;\n"); - for (u32 i = 0; i < uid_data->genMode_numtexgens; i++) - { - out.Write("\tvec3 tex{};\n", i); - } - for (u32 i = uid_data->genMode_numtexgens; i < 8; i++) + for (u32 i = 0; i < 8; i++) { out.Write("\tvec3 tex{};\n", i); } |
