Cell: additional assertions
authorBrian <brian.paul@tungstengraphics.com>
Mon, 28 Jan 2008 18:21:25 +0000 (11:21 -0700)
committerBen Skeggs <skeggsb@gmail.com>
Fri, 15 Feb 2008 02:50:23 +0000 (13:50 +1100)
src/mesa/pipe/cell/spu/spu_main.c

index 5b50ec6953bce500ac1eacf1e07716d10cffba00..62f6a357ba3be92c3c0fa53eae037f9a68a80e5d 100644 (file)
@@ -441,9 +441,12 @@ cmd_state_sampler(const struct pipe_sampler_state *state)
 static void
 cmd_state_vertex_info(const struct vertex_info *vinfo)
 {
-   if (Debug)
+   if (Debug) {
       printf("SPU %u: VERTEX_INFO num_attribs=%u\n", spu.init.id,
              vinfo->num_attribs);
+   }
+   ASSERT(vinfo->num_attribs >= 1);
+   ASSERT(vinfo->num_attribs <= 8);
    memcpy(&spu.vertex_info, vinfo, sizeof(*vinfo));
 }