st/mesa: assert that binding flags are properly set for drawing surfaces
authorBrian Paul <brianp@vmware.com>
Thu, 22 Apr 2010 20:35:21 +0000 (14:35 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 22 Apr 2010 20:37:50 +0000 (14:37 -0600)
src/mesa/state_tracker/st_atom_framebuffer.c

index 1cd55463379b16d44610b43afb7c0b9cfce41bab..52c507da3b3d2948051b5b67446c84ed133190e4 100644 (file)
@@ -153,6 +153,16 @@ update_framebuffer_state( struct st_context *st )
          pipe_surface_reference(&framebuffer->zsbuf, NULL);
    }
 
+#ifdef DEBUG
+   /* Make sure the resource binding flags were set properly */
+   for (i = 0; i < framebuffer->nr_cbufs; i++) {
+      assert(framebuffer->cbufs[i]->texture->bind & PIPE_BIND_RENDER_TARGET);
+   }
+   if (framebuffer->zsbuf) {
+      assert(framebuffer->zsbuf->texture->bind & PIPE_BIND_DEPTH_STENCIL);
+   }
+#endif
+
    cso_set_framebuffer(st->cso_context, framebuffer);
 }