From 17249ae8e0e459dea250733a0b3e45036cdb67bd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Apr 2010 14:35:21 -0600 Subject: [PATCH] st/mesa: assert that binding flags are properly set for drawing surfaces --- src/mesa/state_tracker/st_atom_framebuffer.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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); } -- 2.30.2