mesa: refuse to change tex buffers when a handle is allocated
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 29 Mar 2017 14:29:24 +0000 (16:29 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 14 Jun 2017 08:04:36 +0000 (10:04 +0200)
The ARB_bindless_texture spec says:

   "The error INVALID_OPERATION is generated by BufferData if it is
    called to modify a buffer object bound to a buffer texture while
    that texture object is referenced by one or more texture handles."

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mesa/main/bufferobj.c

index e66a3a566889f3ee6cf9da5be2abe15298b65e94..bb2f0d9d9d4dc0f761b7fbfae1aab07c7c4da7b8 100644 (file)
@@ -1562,7 +1562,7 @@ validate_buffer_storage(struct gl_context *ctx,
       return false;
    }
 
-   if (bufObj->Immutable) {
+   if (bufObj->Immutable || bufObj->HandleAllocated) {
       _mesa_error(ctx, GL_INVALID_OPERATION, "%s(immutable)", func);
       return false;
    }
@@ -1726,7 +1726,7 @@ _mesa_buffer_data(struct gl_context *ctx, struct gl_buffer_object *bufObj,
       return;
    }
 
-   if (bufObj->Immutable) {
+   if (bufObj->Immutable || bufObj->HandleAllocated) {
       _mesa_error(ctx, GL_INVALID_OPERATION, "%s(immutable)", func);
       return;
    }