}
}
-static bool
-handle_bind_buffer_gen(struct gl_context *ctx,
- GLenum target,
- GLuint buffer,
- struct gl_buffer_object **buf_handle)
+bool
+_mesa_handle_bind_buffer_gen(struct gl_context *ctx,
+ GLenum target,
+ GLuint buffer,
+ struct gl_buffer_object **buf_handle,
+ const char *caller)
{
struct gl_buffer_object *buf = *buf_handle;
if (!buf && ctx->API == API_OPENGL_CORE) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glBindBuffer(non-gen name)");
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(non-gen name)", caller);
return false;
}
ASSERT(ctx->Driver.NewBufferObject);
buf = ctx->Driver.NewBufferObject(ctx, buffer, target);
if (!buf) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindBufferARB");
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", caller);
return false;
}
_mesa_HashInsert(ctx->Shared->BufferObjects, buffer, buf);
else {
/* non-default buffer object */
newBufObj = _mesa_lookup_bufferobj(ctx, buffer);
- if (!handle_bind_buffer_gen(ctx, target, buffer, &newBufObj))
+ if (!_mesa_handle_bind_buffer_gen(ctx, target, buffer,
+ &newBufObj, "glBindBuffer"))
return;
}
} else {
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
}
- if (!handle_bind_buffer_gen(ctx, target, buffer, &bufObj))
+ if (!_mesa_handle_bind_buffer_gen(ctx, target, buffer,
+ &bufObj, "glBindBufferRange"))
return;
if (!bufObj) {
} else {
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
}
- if (!handle_bind_buffer_gen(ctx, target, buffer, &bufObj))
+ if (!_mesa_handle_bind_buffer_gen(ctx, target, buffer,
+ &bufObj, "glBindBufferBase"))
return;
if (!bufObj) {