From 7c66e3906dfce1892272579df8551f863699c0ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Tue, 11 Jul 2023 21:28:44 +0200 Subject: [PATCH] Fix invalid texture being invalid and causing crash with Vulkan When starting with `dbg_stress 1` the invalid texture was never actually getting loaded, which was causing the client to crash when using the Vulkan backend and starting with `dbg_stress 1`. Closes #6504. --- src/engine/client/graphics_threaded.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/engine/client/graphics_threaded.cpp b/src/engine/client/graphics_threaded.cpp index f094ab9cb36..763e0864d5e 100644 --- a/src/engine/client/graphics_threaded.cpp +++ b/src/engine/client/graphics_threaded.cpp @@ -423,7 +423,7 @@ IGraphics::CTextureHandle CGraphics_Threaded::LoadTextureRaw(int Width, int Heig { // don't waste memory on texture if we are stress testing #ifdef CONF_DEBUG - if(g_Config.m_DbgStress) + if(g_Config.m_DbgStress && m_InvalidTexture.IsValid()) return m_InvalidTexture; #endif @@ -2903,6 +2903,7 @@ int CGraphics_Threaded::Init() 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff}; + m_InvalidTexture.Invalidate(); m_InvalidTexture = LoadTextureRaw(4, 4, CImageInfo::FORMAT_RGBA, s_aNullTextureData, CImageInfo::FORMAT_RGBA, 0); ColorRGBA GPUInfoPrintColor{0.6f, 0.5f, 1.0f, 1.0f};