diff options
author | Francisco Jerez <[email protected]> | 2015-01-20 14:42:48 +0200 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2015-05-04 17:44:16 +0300 |
commit | 4e4855f1dec566c8af825101445f13b1f824a309 (patch) | |
tree | 95a3feb6c15288e0c1def3acf1b8359abe3cd0a9 /src/mesa/main/shaderimage.c | |
parent | f74ba58f84ad41f485957fe7edfb175a21c2ac24 (diff) |
mesa: Call _mesa_test_texobj_completeness() before using _MaxLevel in image validation.
gl_texture_object::_MaxLevel doesn't have any meaningful value until
_mesa_test_texobj_completeness() has been run. Fixes the "level"
ARB_shader_image_load_store piglit test.
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderimage.c')
-rw-r--r-- | src/mesa/main/shaderimage.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c index 005698c526f..cb88d9c5709 100644 --- a/src/mesa/main/shaderimage.c +++ b/src/mesa/main/shaderimage.c @@ -337,13 +337,14 @@ validate_image_unit(struct gl_context *ctx, struct gl_image_unit *u) struct gl_texture_object *t = u->TexObj; mesa_format tex_format; - if (!t || u->Level < t->BaseLevel || - u->Level > t->_MaxLevel) + if (!t) return GL_FALSE; _mesa_test_texobj_completeness(ctx, t); - if ((u->Level == t->BaseLevel && !t->_BaseComplete) || + if (u->Level < t->BaseLevel || + u->Level > t->_MaxLevel || + (u->Level == t->BaseLevel && !t->_BaseComplete) || (u->Level != t->BaseLevel && !t->_MipmapComplete)) return GL_FALSE; |