[Mesa-dev] [PATCH v2] main/shaderimage: image unit is invalid if texture is incomplete

Alejandro PiƱeiro apinheiro at igalia.com
Fri Jul 15 08:55:28 UTC 2016


>From the OpenGL 4.3 Core Specification, section 8.25 ("Texture
Image Loads and Stores"):

  "An access is considered invalid if:
    the texture bound to the selected image unit is incomplete;"

This fixes:
GL44-CTS.shader_image_load_store.incomplete_textures

v2: use _mesa_is_texture_complete, maintain image-texture level
    checks (Curro)
---
 src/mesa/main/shaderimage.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c
index 90643c4..94bb1e4 100644
--- a/src/mesa/main/shaderimage.c
+++ b/src/mesa/main/shaderimage.c
@@ -469,6 +469,15 @@ _mesa_is_image_unit_valid(struct gl_context *ctx, struct gl_image_unit *u)
    if (!t->_BaseComplete && !t->_MipmapComplete)
        _mesa_test_texobj_completeness(ctx, t);
 
+   /* From the OpenGL 4.3 Core Specification, Chapter 8.25, Texture Image
+    * Loads and Stores:
+    *
+    *  "An access is considered invalid if:
+    *    the texture bound to the selected image unit is incomplete;"
+    */
+   if (!_mesa_is_texture_complete(t, &t->Sampler))
+      return GL_FALSE;
+
    if (u->Level < t->BaseLevel ||
        u->Level > t->_MaxLevel ||
        (u->Level == t->BaseLevel && !t->_BaseComplete) ||
-- 
2.7.4



More information about the mesa-dev mailing list