mesa: allow mutable buffer textures to back GL ES images
authorIlia Mirkin <imirkin@alum.mit.edu>
Tue, 29 Mar 2016 19:31:05 +0000 (15:31 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Wed, 30 Mar 2016 01:41:03 +0000 (21:41 -0400)
Since there is no way to create immutable texture buffers in GL ES,
mutable buffer textures are allowed to back images. See issue 7 of the
GL_OES_texture_buffer specification.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/mesa/main/shaderimage.c

index fd5934f939f52e58a3b462f1836ae6e2ea56c1c5..90643c4ed6d8a6d96dd585d57a7174508e8ad7c8 100644 (file)
@@ -583,8 +583,13 @@ _mesa_BindImageTexture(GLuint unit, GLuint texture, GLint level,
        *
        * "An INVALID_OPERATION error is generated if texture is not the name
        *  of an immutable texture object."
+       *
+       * However note that issue 7 of the GL_OES_texture_buffer spec
+       * recognizes that there is no way to create immutable buffer textures,
+       * so those are excluded from this requirement.
        */
-      if (_mesa_is_gles(ctx) && !t->Immutable) {
+      if (_mesa_is_gles(ctx) && !t->Immutable &&
+          t->Target != GL_TEXTURE_BUFFER) {
          _mesa_error(ctx, GL_INVALID_OPERATION,
                      "glBindImageTexture(!immutable)");
          return;