medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit ce10bf1cec94252dd274fa27e22d72fcaf64d22d
parent 3a4a28404795661b357516f3fee979ad1016f961
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Thu Dec 29 21:52:08 +0200

Don't make any draw calls in immediate_render when there are no triangles

Diffstat:
immediate.cc | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/immediate.cc b/immediate.cc @@ -224,6 +224,10 @@ void immediate_render( const ImmediateContext * ctx, Shader shader, Texture text } void immediate_render( const ImmediateContext * ctx, const RenderState & render_state ) { + if( ctx->num_triangles == 0 ) { + return; + } + VB vb = renderer_new_vb( ctx->triangles, ctx->num_triangles * sizeof( ImmediateTriangle ), BUFFERUSAGE_STREAM ); MeshConfig mesh_config;