graphics: fix recursion when creating a default texture.

This commit is contained in:
Sasha Szpakowski
2024-01-06 15:22:02 -04:00
parent aaab9791d5
commit 131b6c51e0
2 changed files with 8 additions and 3 deletions
+6 -3
View File
@@ -1927,7 +1927,7 @@ void Graphics::flushBatchedDraws()
{
auto &sbstate = batchedDrawState;
if (sbstate.vertexCount == 0 && sbstate.indexCount == 0)
if (sbstate.vertexCount == 0 && sbstate.indexCount == 0 || sbstate.flushing)
return;
VertexAttributes attributes;
@@ -1952,6 +1952,8 @@ void Graphics::flushBatchedDraws()
if (attributes.enableBits == 0)
return;
sbstate.flushing = true;
Colorf nc = getColor();
if (attributes.isEnabled(ATTRIB_COLOR))
setColor(Colorf(1.0f, 1.0f, 1.0f, 1.0f));
@@ -1996,8 +1998,9 @@ void Graphics::flushBatchedDraws()
if (attributes.isEnabled(ATTRIB_COLOR))
setColor(nc);
batchedDrawState.vertexCount = 0;
batchedDrawState.indexCount = 0;
sbstate.vertexCount = 0;
sbstate.indexCount = 0;
sbstate.flushing = false;
}
void Graphics::flushBatchedDrawsGlobal()