From: Timothy Arceri Date: Fri, 12 May 2017 06:51:24 +0000 (+1000) Subject: mesa: add KHR_no_error support for glBufferStorage() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=624dc2833e0d0263b434e234437dfbd9f4840b75;p=mesa.git mesa: add KHR_no_error support for glBufferStorage() Reviewed-by: Nicolai Hähnle --- diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index 1a3b306c03c..8afd5ec5138 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -8262,7 +8262,7 @@ - + diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 09ef233a835..674ff630cd6 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -1609,9 +1609,14 @@ inlined_buffer_storage(GLenum target, GLuint buffer, GLsizeiptr size, return; } } else { - bufObj = get_buffer(ctx, func, target, GL_INVALID_OPERATION); - if (!bufObj) - return; + if (no_error) { + struct gl_buffer_object **bufObjPtr = get_buffer_target(ctx, target); + bufObj = *bufObjPtr; + } else { + bufObj = get_buffer(ctx, func, target, GL_INVALID_OPERATION); + if (!bufObj) + return; + } } if (no_error || validate_buffer_storage(ctx, bufObj, size, flags, func)) @@ -1619,6 +1624,15 @@ inlined_buffer_storage(GLenum target, GLuint buffer, GLsizeiptr size, } +void GLAPIENTRY +_mesa_BufferStorage_no_error(GLenum target, GLsizeiptr size, + const GLvoid *data, GLbitfield flags) +{ + inlined_buffer_storage(target, 0, size, data, flags, false, true, + "glBufferStorage"); +} + + void GLAPIENTRY _mesa_BufferStorage(GLenum target, GLsizeiptr size, const GLvoid *data, GLbitfield flags) diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index a06a0e470bd..024d07daaf8 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -171,6 +171,9 @@ _mesa_CreateBuffers(GLsizei n, GLuint *buffers); GLboolean GLAPIENTRY _mesa_IsBuffer(GLuint buffer); +void GLAPIENTRY +_mesa_BufferStorage_no_error(GLenum target, GLsizeiptr size, + const GLvoid *data, GLbitfield flags); void GLAPIENTRY _mesa_BufferStorage(GLenum target, GLsizeiptr size, const GLvoid *data, GLbitfield flags);