[Mesa-dev] [PATCH 09/10] mesa: create bind_buffer_range() helper
Timothy Arceri
tarceri at itsqueeze.com
Mon May 22 05:47:01 UTC 2017
This will help us add KHR_no_error support.
---
src/mesa/main/bufferobj.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 2d3e0f2..5aae579 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -3984,23 +3984,23 @@ bind_atomic_buffers(struct gl_context *ctx,
else
bufObj = _mesa_multi_bind_lookup_bufferobj(ctx, buffers, i, caller);
if (bufObj)
set_atomic_buffer_binding(ctx, binding, bufObj, offset, size);
}
_mesa_HashUnlockMutex(ctx->Shared->BufferObjects);
}
-void GLAPIENTRY
-_mesa_BindBufferRange(GLenum target, GLuint index,
- GLuint buffer, GLintptr offset, GLsizeiptr size)
+static ALWAYS_INLINE void
+bind_buffer_range(GLenum target, GLuint index, GLuint buffer, GLintptr offset,
+ GLsizeiptr size)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_buffer_object *bufObj;
if (MESA_VERBOSE & VERBOSE_API) {
_mesa_debug(ctx, "glBindBufferRange(%s, %u, %u, %lu, %lu)\n",
_mesa_enum_to_string(target), index, buffer,
(unsigned long) offset, (unsigned long) size);
}
@@ -4049,20 +4049,27 @@ _mesa_BindBufferRange(GLenum target, GLuint index,
bind_atomic_buffer_err(ctx, index, bufObj, offset, size,
"glBindBufferRange");
return;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferRange(target)");
return;
}
}
void GLAPIENTRY
+_mesa_BindBufferRange(GLenum target, GLuint index,
+ GLuint buffer, GLintptr offset, GLsizeiptr size)
+{
+ bind_buffer_range(target, index, buffer, offset, size);
+}
+
+void GLAPIENTRY
_mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_buffer_object *bufObj;
if (MESA_VERBOSE & VERBOSE_API) {
_mesa_debug(ctx, "glBindBufferBase(%s, %u, %u)\n",
_mesa_enum_to_string(target), index, buffer);
}
--
2.9.4
More information about the mesa-dev
mailing list