[Mesa-dev] [PATCH v2 09/64] mesa: refuse to change tex buffers when a handle is allocated

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue May 30 20:35:40 UTC 2017


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 at gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
 src/mesa/main/bufferobj.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 9e656a4c98..4fe9698c0b 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -1552,7 +1552,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;
    }
@@ -1716,7 +1716,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;
    }
-- 
2.13.0



More information about the mesa-dev mailing list