Optimize DrawCall to pack indirect draw arg and graphics draw data with union

This commit is contained in:
Wojtek Figat
2021-02-15 11:52:06 +01:00
parent e42a6b0ccc
commit c9ea812a24
10 changed files with 57 additions and 66 deletions

View File

@@ -336,14 +336,12 @@ void TextRender::Draw(RenderContext& renderContext)
drawCall.Geometry.VertexBuffersOffsets[1] = 0;
drawCall.Geometry.VertexBuffersOffsets[2] = 0;
drawCall.InstanceCount = 1;
drawCall.IndirectArgsBuffer = nullptr;
drawCall.IndirectArgsOffset = 0;
// Submit draw calls
for (const auto& e : _drawChunks)
{
drawCall.Geometry.IndicesCount = e.IndicesCount;
drawCall.Geometry.StartIndex = e.StartIndex;
drawCall.Draw.IndicesCount = e.IndicesCount;
drawCall.Draw.StartIndex = e.StartIndex;
drawCall.Material = e.Material;
renderContext.List->AddDrawCall(drawModes, GetStaticFlags(), drawCall, true);
}