ensure empty geometry buffers are not submitted for render

Signed-off-by: hultonha <hultonha@amazon.co.uk>
This commit is contained in:
hultonha
2021-07-13 14:49:27 +01:00
parent 1220ea6539
commit 0c0d307cae
3 changed files with 61 additions and 15 deletions
@@ -31,22 +31,20 @@ namespace LmbrCentral
return vertices + 1;
}
void DrawShape(
AzFramework::DebugDisplayRequests& debugDisplay,
const ShapeDrawParams& shapeDrawParams, const ShapeMesh& shapeMesh)
void DrawShape(AzFramework::DebugDisplayRequests& debugDisplay, const ShapeDrawParams& shapeDrawParams, const ShapeMesh& shapeMesh)
{
if (shapeDrawParams.m_filled)
{
debugDisplay.DrawTrianglesIndexed(
shapeMesh.m_vertexBuffer,
shapeMesh.m_indexBuffer,
shapeDrawParams.m_shapeColor
);
if (!shapeMesh.m_vertexBuffer.empty() && !shapeMesh.m_indexBuffer.empty())
{
debugDisplay.DrawTrianglesIndexed(shapeMesh.m_vertexBuffer, shapeMesh.m_indexBuffer, shapeDrawParams.m_shapeColor);
}
}
debugDisplay.DrawLines(
shapeMesh.m_lineBuffer,
shapeDrawParams.m_wireColor);
if (!shapeMesh.m_lineBuffer.empty())
{
debugDisplay.DrawLines(shapeMesh.m_lineBuffer, shapeDrawParams.m_wireColor);
}
}
/// Determine if a list of vertices constitute a simple polygon