Fix crash in Text Render drawing

This commit is contained in:
Wojtek Figat
2022-11-21 15:52:36 +01:00
parent 93c0dd704e
commit eeff5ea3ae

View File

@@ -386,12 +386,13 @@ void TextRender::Draw(RenderContext& renderContext)
// Submit draw calls // Submit draw calls
for (const auto& e : _drawChunks) for (const auto& e : _drawChunks)
{ {
if ((drawModes & e.Material->GetDrawModes()) == 0) auto chunkDrawModes = drawModes & e.Material->GetDrawModes();
if (chunkDrawModes == 0)
continue; continue;
drawCall.Draw.IndicesCount = e.IndicesCount; drawCall.Draw.IndicesCount = e.IndicesCount;
drawCall.Draw.StartIndex = e.StartIndex; drawCall.Draw.StartIndex = e.StartIndex;
drawCall.Material = e.Material; drawCall.Material = e.Material;
renderContext.List->AddDrawCall(renderContext, drawModes, GetStaticFlags(), drawCall, true); renderContext.List->AddDrawCall(renderContext, (DrawPass)chunkDrawModes, GetStaticFlags(), drawCall, true);
} }
} }