From: Brian Paul Date: Thu, 22 Apr 2010 20:35:21 +0000 (-0600) Subject: st/mesa: assert that binding flags are properly set for drawing surfaces X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=17249ae8e0e459dea250733a0b3e45036cdb67bd;p=mesa.git st/mesa: assert that binding flags are properly set for drawing surfaces --- diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c index 1cd55463379..52c507da3b3 100644 --- a/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/src/mesa/state_tracker/st_atom_framebuffer.c @@ -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); }