bind_buffer_range_uniform_buffer(ctx, index, bufObj, offset, size);
}
+static void
+bind_buffer_range_shader_storage_buffer(struct gl_context *ctx,
+ GLuint index,
+ struct gl_buffer_object *bufObj,
+ GLintptr offset,
+ GLsizeiptr size)
+{
+ if (bufObj == ctx->Shared->NullBufferObj) {
+ offset = -1;
+ size = -1;
+ }
+
+ _mesa_reference_buffer_object(ctx, &ctx->ShaderStorageBuffer, bufObj);
+ bind_shader_storage_buffer(ctx, index, bufObj, offset, size, GL_FALSE);
+}
+
/**
* Bind a region of a buffer object to a shader storage block binding point.
* \param index the shader storage buffer binding point index
* \param size size of the buffer object region
*/
static void
-bind_buffer_range_shader_storage_buffer(struct gl_context *ctx,
- GLuint index,
- struct gl_buffer_object *bufObj,
- GLintptr offset,
- GLsizeiptr size)
+bind_buffer_range_shader_storage_buffer_err(struct gl_context *ctx,
+ GLuint index,
+ struct gl_buffer_object *bufObj,
+ GLintptr offset, GLsizeiptr size)
{
if (index >= ctx->Const.MaxShaderStorageBufferBindings) {
_mesa_error(ctx, GL_INVALID_VALUE, "glBindBufferRange(index=%d)", index);
return;
}
- if (bufObj == ctx->Shared->NullBufferObj) {
- offset = -1;
- size = -1;
- }
-
- _mesa_reference_buffer_object(ctx, &ctx->ShaderStorageBuffer, bufObj);
- bind_shader_storage_buffer(ctx, index, bufObj, offset, size, GL_FALSE);
+ bind_buffer_range_shader_storage_buffer(ctx, index, bufObj, offset, size);
}
/**
bind_buffer_range_uniform_buffer_err(ctx, index, bufObj, offset, size);
return;
case GL_SHADER_STORAGE_BUFFER:
- bind_buffer_range_shader_storage_buffer(ctx, index, bufObj, offset, size);
+ bind_buffer_range_shader_storage_buffer_err(ctx, index, bufObj, offset,
+ size);
return;
case GL_ATOMIC_COUNTER_BUFFER:
bind_atomic_buffer(ctx, index, bufObj, offset, size,