cso: add a couple sanity check assertions in cso_draw_vbo()
authorBrian Paul <brianp@vmware.com>
Tue, 6 Feb 2018 22:33:37 +0000 (15:33 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 8 Feb 2018 16:49:03 +0000 (09:49 -0700)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/cso_cache/cso_context.c

index dd9821e8285669bd2f9f7c561cc21fb6df5cbdaf..1b5d4b559874dfd93a25b76860b0073a2048102b 100644 (file)
@@ -1686,6 +1686,12 @@ cso_draw_vbo(struct cso_context *cso,
 {
    struct u_vbuf *vbuf = cso->vbuf;
 
+   /* We can't have both indirect drawing and SO-vertex-count drawing */
+   assert(info->indirect == NULL || info->count_from_stream_output == NULL);
+
+   /* We can't have SO-vertex-count drawing with an index buffer */
+   assert(info->count_from_stream_output == NULL || info->index_size == 0);
+
    if (vbuf) {
       u_vbuf_draw_vbo(vbuf, info);
    } else {