Skip to content

Commit

Permalink
Fix invalid texture being invalid and causing crash with Vulkan
Browse files Browse the repository at this point in the history
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 ddnet#6504.
  • Loading branch information
Robyt3 committed Jul 11, 2023
1 parent 13806f1 commit 7c66e39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/engine/client/graphics_threaded.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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};
Expand Down

0 comments on commit 7c66e39

Please sign in to comment.