[Mesa-stable] [PATCH 2/4] mesa: Skip redundant texture completeness checking during image validation.
Francisco Jerez
currojerez at riseup.net
Thu Sep 3 06:53:13 PDT 2015
The call to _mesa_test_texobj_completeness() is unnecessary if the
texture is already known to be complete. If the texture object is
dirtied in the meantime _BaseComplete and _MipmapComplete will be
reset to false. _mesa_is_image_unit_valid() will start to be called
more frequently in a future commit, so it seems desirable to avoid the
unnecessary work.
Tested-by: Ye Tian <yex.tian at intel.com>
CC: "11.0" <mesa-stable at lists.freedesktop.org>
---
src/mesa/main/shaderimage.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c
index a0a3b7b..e686cad 100644
--- a/src/mesa/main/shaderimage.c
+++ b/src/mesa/main/shaderimage.c
@@ -424,7 +424,8 @@ _mesa_is_image_unit_valid(struct gl_context *ctx, struct gl_image_unit *u)
if (!t)
return GL_FALSE;
- _mesa_test_texobj_completeness(ctx, t);
+ if (!t->_BaseComplete && !t->_MipmapComplete)
+ _mesa_test_texobj_completeness(ctx, t);
if (u->Level < t->BaseLevel ||
u->Level > t->_MaxLevel ||
--
2.4.6
More information about the mesa-stable
mailing list