From c793e1f35d32bad0da454008f3c8b9b19fb1d95a Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Wed, 24 Aug 2022 20:31:55 +0100 Subject: [PATCH] Don't submit empty lists --- GL/flush.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/GL/flush.c b/GL/flush.c index 31f311e..d443c06 100644 --- a/GL/flush.c +++ b/GL/flush.c @@ -92,17 +92,23 @@ void APIENTRY glKosSwapBuffers() { TRACE(); SceneBegin(); - SceneListBegin(GPU_LIST_OP_POLY); - SceneListSubmit(OP_LIST.vector.data, OP_LIST.vector.size); - SceneListFinish(); + if(OP_LIST.vector.size > 2) { + SceneListBegin(GPU_LIST_OP_POLY); + SceneListSubmit(OP_LIST.vector.data, OP_LIST.vector.size); + SceneListFinish(); + } - SceneListBegin(GPU_LIST_PT_POLY); - SceneListSubmit(PT_LIST.vector.data, PT_LIST.vector.size); - SceneListFinish(); + if(PT_LIST.vector.size > 2) { + SceneListBegin(GPU_LIST_PT_POLY); + SceneListSubmit(PT_LIST.vector.data, PT_LIST.vector.size); + SceneListFinish(); + } - SceneListBegin(GPU_LIST_TR_POLY); - SceneListSubmit(TR_LIST.vector.data, TR_LIST.vector.size); - SceneListFinish(); + if(TR_LIST.vector.size > 2) { + SceneListBegin(GPU_LIST_TR_POLY); + SceneListSubmit(TR_LIST.vector.data, TR_LIST.vector.size); + SceneListFinish(); + } SceneFinish(); aligned_vector_clear(&OP_LIST.vector);