summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_texture.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-12-20 00:28:24 +0100
committerMarek Olšák <[email protected]>2012-12-20 17:13:18 +0100
commitef11ed61a0414d0405c3faf7f48fa3f1d083f82e (patch)
tree787d25d8b7c0b7d6898ed0b528d9c759b2e87900 /src/gallium/drivers/r600/r600_texture.c
parentfefa2112bf02db6908fd3f2603f11d1a2bc10688 (diff)
r600g: add assertions to prevent creation of invalid surfaces
Diffstat (limited to 'src/gallium/drivers/r600/r600_texture.c')
-rw-r--r--src/gallium/drivers/r600/r600_texture.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index 56e9b64fc47..0925333236a 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -558,6 +558,8 @@ struct pipe_surface *r600_create_surface_custom(struct pipe_context *pipe,
{
struct r600_surface *surface = CALLOC_STRUCT(r600_surface);
+ assert(templ->u.tex.first_layer <= u_max_layer(texture, templ->u.tex.level));
+ assert(templ->u.tex.last_layer <= u_max_layer(texture, templ->u.tex.level));
assert(templ->u.tex.first_layer == templ->u.tex.last_layer);
if (surface == NULL)
return NULL;