From 648dc871013cf390e970c81d9985cc4468e1f58e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 15 May 2022 09:12:30 +0200 Subject: [PATCH] - fixed two index out of range issues in Vulkan's shader compiler code. --- src/common/rendering/vulkan/shaders/vk_shader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/rendering/vulkan/shaders/vk_shader.cpp b/src/common/rendering/vulkan/shaders/vk_shader.cpp index 4059c7875..7ff8edd76 100644 --- a/src/common/rendering/vulkan/shaders/vk_shader.cpp +++ b/src/common/rendering/vulkan/shaders/vk_shader.cpp @@ -99,13 +99,13 @@ bool VkShaderManager::CompileNextShader() if (compileIndex >= MAX_EFFECTS) { compileIndex = 0; + compilePass++; if (compilePass == MAX_PASS_TYPES) { compileIndex = -1; // we're done. return true; } compileState = 0; - compilePass++; } } return false; @@ -135,7 +135,7 @@ VkShaderProgram *VkShaderManager::Get(unsigned int eff, bool alphateston, EPassT { if (compileIndex != -1) return &mMaterialShaders[0][0]; // indices 0-2 match the warping modes, 3 no texture, the following are custom - if (!alphateston && eff <= SHADER_NoTexture) + if (!alphateston && eff < SHADER_NoTexture) { return &mMaterialShadersNAT[passType][eff]; // Non-alphatest shaders are only created for default, warp1+2. The rest won't get used anyway }