From 03c8fd995669f1c9d881acbd9446e6a81164ab05 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 24 Aug 2021 10:24:23 +0200 Subject: [PATCH] - block user overrides for the logic module of core fragment shaders. --- src/common/rendering/gl/gl_shader.cpp | 3 ++- src/common/rendering/vulkan/shaders/vk_shader.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/rendering/gl/gl_shader.cpp b/src/common/rendering/gl/gl_shader.cpp index 79612885c..5694b7ef0 100644 --- a/src/common/rendering/gl/gl_shader.cpp +++ b/src/common/rendering/gl/gl_shader.cpp @@ -404,7 +404,8 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char * if (*proc_prog_lump != '#') { - int pp_lump = fileSystem.CheckNumForFullName(proc_prog_lump); + int pp_lump = fileSystem.CheckNumForFullName(proc_prog_lump, 0); // if it's a core shader, ignore overrides by user mods. + if (pp_lump == -1) pp_lump = fileSystem.CheckNumForFullName(proc_prog_lump); if (pp_lump == -1) I_Error("Unable to load '%s'", proc_prog_lump); FileData pp_data = fileSystem.ReadFile(pp_lump); diff --git a/src/common/rendering/vulkan/shaders/vk_shader.cpp b/src/common/rendering/vulkan/shaders/vk_shader.cpp index 84f7d3d5e..df065e1ce 100644 --- a/src/common/rendering/vulkan/shaders/vk_shader.cpp +++ b/src/common/rendering/vulkan/shaders/vk_shader.cpp @@ -386,7 +386,8 @@ FString VkShaderManager::GetTargetGlslVersion() FString VkShaderManager::LoadPublicShaderLump(const char *lumpname) { - int lump = fileSystem.CheckNumForFullName(lumpname); + int lump = fileSystem.CheckNumForFullName(lumpname, 0); + if (lump == -1) lump = fileSystem.CheckNumForFullName(lumpname); if (lump == -1) I_Error("Unable to load '%s'", lumpname); FileData data = fileSystem.ReadFile(lump); return data.GetString();