diff options
-rw-r--r-- | src/sna/gen2_render.c | 1 | ||||
-rw-r--r-- | src/sna/sna_render_inline.h | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c index 60853485..baf8c3e2 100644 --- a/src/sna/gen2_render.c +++ b/src/sna/gen2_render.c @@ -980,6 +980,7 @@ static void gen2_magic_ca_pass(struct sna *sna, dst = sna->kgem.batch + sna->kgem.nbatch; n = 1 + sna->render.vertex_index; sna->kgem.nbatch += n; + assert(sna->kgem.nbatch <= KGEM_BATCH_SIZE(kgem)); while (n--) *dst++ = *src++; } diff --git a/src/sna/sna_render_inline.h b/src/sna/sna_render_inline.h index 216937a2..4c543179 100644 --- a/src/sna/sna_render_inline.h +++ b/src/sna/sna_render_inline.h @@ -47,6 +47,8 @@ static inline float pack_2s(int16_t x, int16_t y) static inline int batch_space(struct sna *sna) { + assert(sna->kgem.nbatch <= KGEM_BATCH_SIZE(kgem)); + assert(sna->kgem.nbatch + KGEM_BATCH_RESERVED < sna->kgem.surface); return sna->kgem.surface - sna->kgem.nbatch - KGEM_BATCH_RESERVED; } |