From a020b8c2f5a97d90e44fb5ac23cd95a6e841ccfc Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 5 Jan 2024 16:54:28 +0100 Subject: [PATCH] do not compile the first shader in the shader manager's constructor This was crashing with the move of the V_Init2 call. Instead do it when we first render something so that we can open the window without immediately making the full backend operational. This was only working on GLES because it performs lazy shader compilation. --- src/common/rendering/gl/gl_shader.cpp | 1 - src/common/rendering/vulkan/shaders/vk_shader.cpp | 2 +- src/d_main.cpp | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/rendering/gl/gl_shader.cpp b/src/common/rendering/gl/gl_shader.cpp index 7340236abd..bafbf89b8e 100644 --- a/src/common/rendering/gl/gl_shader.cpp +++ b/src/common/rendering/gl/gl_shader.cpp @@ -788,7 +788,6 @@ FShaderCollection::FShaderCollection(EPassType passType) { mEffectShaders[i] = NULL; } - CompileNextShader(); } //========================================================================== diff --git a/src/common/rendering/vulkan/shaders/vk_shader.cpp b/src/common/rendering/vulkan/shaders/vk_shader.cpp index 618fa2ca9b..00734ac7f3 100644 --- a/src/common/rendering/vulkan/shaders/vk_shader.cpp +++ b/src/common/rendering/vulkan/shaders/vk_shader.cpp @@ -115,7 +115,7 @@ bool VkShaderManager::CompileNextShader() VkShaderManager::VkShaderManager(VulkanRenderDevice* fb) : fb(fb) { - CompileNextShader(); + //CompileNextShader(); } VkShaderManager::~VkShaderManager() diff --git a/src/d_main.cpp b/src/d_main.cpp index 279ad56dbb..cdc4f35cba 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -3262,6 +3262,7 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector& allw if (!batchrun) Printf ("V_Init: allocate screen.\n"); if (!restart) { + screen->CompileNextShader(); if (StartScreen != nullptr) StartScreen->Render(); } else