st/mesa: add a simple sanity check assertion in st_validate_attachment()

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Brian Paul 2014-01-23 18:18:17 -07:00
parent 43e77215b1
commit e2dd240e32

View file

@ -544,6 +544,12 @@ st_validate_attachment(struct gl_context *ctx,
gl_format texFormat;
GLboolean valid;
/* Sanity check: we must be binding the surface as a (color) render target
* or depth/stencil target.
*/
assert(bindings == PIPE_BIND_RENDER_TARGET ||
bindings == PIPE_BIND_DEPTH_STENCIL);
/* Only validate texture attachments for now, since
* st_renderbuffer_alloc_storage makes sure that
* the format is supported.