From 31b77ed2e0c037e5718b9ecd06d3941600cc8815 Mon Sep 17 00:00:00 2001 From: aura Date: Tue, 10 Mar 2026 02:08:32 +0100 Subject: wip on 2d batching --- src/render/gl_batch.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/render/gl_batch.h') diff --git a/src/render/gl_batch.h b/src/render/gl_batch.h index 944521f..12b512f 100644 --- a/src/render/gl_batch.h +++ b/src/render/gl_batch.h @@ -133,6 +133,11 @@ inline GL_BATCH_CALL* gl_batch_get_call( GL_BATCH* batch, GL_TEX && vp_start == last->clip_start && vp_dim == last->viewport_dim && clip_start == last->clip_start && clip_dim == last->clip_dim ) { + if( !tex ) { + *texid = SAMPLER_ID_NONE; + return last; + } + I32 idx = last->textures.idx_of( tex ); if( idx != -1 ) { *texid = idx; @@ -187,7 +192,7 @@ inline void gl_batch_insert( call = gl_batch_get_call( batch, tex, primitive, &texid ); for( U32 i = 0; i < count; ++i ) { - vertices[i].sampler = (!!tex)? texid : SAMPLER_ID_NONE; + vertices[i].sampler = texid; call->vertices.push( vertices[i] ); } } -- cgit v1.2.3