fix: check for pipeline creation when reloading shaders (#1543)
This is done in the editor, but was omitted in the samples, causing them to crash.
This commit is contained in:
@@ -33,7 +33,7 @@ int sdl_loop()
|
||||
break;
|
||||
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
||||
exampleImGui.is_window_active = true;
|
||||
if (wi::shadercompiler::GetRegisteredShaderCount() > 0)
|
||||
if (wi::shadercompiler::GetRegisteredShaderCount() > 0 && !wi::renderer::IsPipelineCreationActive())
|
||||
{
|
||||
std::thread([] {
|
||||
wi::backlog::post("[Shader check] Started checking " + std::to_string(wi::shadercompiler::GetRegisteredShaderCount()) + " registered shaders for changes...");
|
||||
|
||||
@@ -30,7 +30,7 @@ int sdl_loop()
|
||||
break;
|
||||
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
||||
exampleImGui.is_window_active = true;
|
||||
if (wi::shadercompiler::GetRegisteredShaderCount() > 0)
|
||||
if (wi::shadercompiler::GetRegisteredShaderCount() > 0 && !wi::renderer::IsPipelineCreationActive())
|
||||
{
|
||||
std::thread([] {
|
||||
wi::backlog::post("[Shader check] Started checking " + std::to_string(wi::shadercompiler::GetRegisteredShaderCount()) + " registered shaders for changes...");
|
||||
|
||||
@@ -32,7 +32,7 @@ int sdl_loop()
|
||||
break;
|
||||
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
||||
tests.is_window_active = true;
|
||||
if (wi::shadercompiler::GetRegisteredShaderCount() > 0)
|
||||
if (wi::shadercompiler::GetRegisteredShaderCount() > 0 && !wi::renderer::IsPipelineCreationActive())
|
||||
{
|
||||
std::thread([] {
|
||||
wi::backlog::post("[Shader check] Started checking " + std::to_string(wi::shadercompiler::GetRegisteredShaderCount()) + " registered shaders for changes...");
|
||||
|
||||
Reference in New Issue
Block a user