diff options
author | Marek Olšák <[email protected]> | 2013-02-19 17:43:08 +0100 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2013-02-20 12:30:32 +0100 |
commit | a84c4edeede12a1275a37a61408f578481bd4355 (patch) | |
tree | 4aa651510fe1fd37fb71a03ff0ec5cda9a7f1cf2 /src/gallium/drivers/radeonsi/r600_texture.c | |
parent | c4faab63c45aad579ef324fcc076c88a7cebbef6 (diff) |
radeonsi: add assertions to prevent creation of invalid surfaces
[ Cherry-picked from r600g commit ef11ed61a0414d0405c3faf7f48fa3f1d083f82e ]
NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/r600_texture.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/r600_texture.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/r600_texture.c b/src/gallium/drivers/radeonsi/r600_texture.c index d54655441a0..5790974b013 100644 --- a/src/gallium/drivers/radeonsi/r600_texture.c +++ b/src/gallium/drivers/radeonsi/r600_texture.c @@ -545,6 +545,8 @@ static struct pipe_surface *r600_create_surface(struct pipe_context *pipe, struct r600_surface *surface = CALLOC_STRUCT(r600_surface); unsigned level = surf_tmpl->u.tex.level; + assert(surf_tmpl->u.tex.first_layer <= u_max_layer(texture, surf_tmpl->u.tex.level)); + assert(surf_tmpl->u.tex.last_layer <= u_max_layer(texture, surf_tmpl->u.tex.level)); assert(surf_tmpl->u.tex.first_layer == surf_tmpl->u.tex.last_layer); if (surface == NULL) return NULL; |