summaryrefslogtreecommitdiff
path: root/src/render/gl_batch.h
diff options
context:
space:
mode:
authoraura <nw@moneybot.cc>2026-03-10 02:08:32 +0100
committeraura <nw@moneybot.cc>2026-03-10 02:08:32 +0100
commit31b77ed2e0c037e5718b9ecd06d3941600cc8815 (patch)
treeb15e8a098b772de1be54a1bb90a31992f2a78975 /src/render/gl_batch.h
parent8329d42d3e592f4cd42cdfa586e2325ddc76c898 (diff)
wip on 2d batching
Diffstat (limited to 'src/render/gl_batch.h')
-rw-r--r--src/render/gl_batch.h7
1 files changed, 6 insertions, 1 deletions
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<VERTEX>* gl_batch_get_call( GL_BATCH<VERTEX>* 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] );
}
}