}
-static void
+static ALWAYS_INLINE void
vertex_array_vertex_buffers(struct gl_context *ctx,
struct gl_vertex_array_object *vao,
GLuint first, GLsizei count, const GLuint *buffers,
const GLintptr *offsets, const GLsizei *strides,
- const char *func)
+ bool no_error, const char *func)
{
- GLuint i;
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- /* The ARB_multi_bind spec says:
- *
- * "An INVALID_OPERATION error is generated if <first> + <count>
- * is greater than the value of MAX_VERTEX_ATTRIB_BINDINGS."
- */
- if (first + count > ctx->Const.MaxVertexAttribBindings) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(first=%u + count=%d > the value of "
- "GL_MAX_VERTEX_ATTRIB_BINDINGS=%u)",
- func, first, count, ctx->Const.MaxVertexAttribBindings);
- return;
- }
+ GLint i;
if (!buffers) {
/**
for (i = 0; i < count; i++) {
struct gl_buffer_object *vbo;
- /* The ARB_multi_bind spec says:
- *
- * "An INVALID_VALUE error is generated if any value in
- * <offsets> or <strides> is negative (per binding)."
- */
- if (offsets[i] < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "%s(offsets[%u]=%" PRId64 " < 0)",
- func, i, (int64_t) offsets[i]);
- continue;
- }
+ if (!no_error) {
+ /* The ARB_multi_bind spec says:
+ *
+ * "An INVALID_VALUE error is generated if any value in
+ * <offsets> or <strides> is negative (per binding)."
+ */
+ if (offsets[i] < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "%s(offsets[%u]=%" PRId64 " < 0)",
+ func, i, (int64_t) offsets[i]);
+ continue;
+ }
- if (strides[i] < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "%s(strides[%u]=%d < 0)",
- func, i, strides[i]);
- continue;
- }
+ if (strides[i] < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "%s(strides[%u]=%d < 0)",
+ func, i, strides[i]);
+ continue;
+ }
- if (ctx->API == API_OPENGL_CORE && ctx->Version >= 44 &&
- strides[i] > ctx->Const.MaxVertexAttribStride) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "%s(strides[%u]=%d > "
- "GL_MAX_VERTEX_ATTRIB_STRIDE)", func, i, strides[i]);
- continue;
+ if (ctx->API == API_OPENGL_CORE && ctx->Version >= 44 &&
+ strides[i] > ctx->Const.MaxVertexAttribStride) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "%s(strides[%u]=%d > "
+ "GL_MAX_VERTEX_ATTRIB_STRIDE)", func, i, strides[i]);
+ continue;
+ }
}
if (buffers[i]) {
}
+static void
+vertex_array_vertex_buffers_err(struct gl_context *ctx,
+ struct gl_vertex_array_object *vao,
+ GLuint first, GLsizei count,
+ const GLuint *buffers, const GLintptr *offsets,
+ const GLsizei *strides, const char *func)
+{
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ /* The ARB_multi_bind spec says:
+ *
+ * "An INVALID_OPERATION error is generated if <first> + <count>
+ * is greater than the value of MAX_VERTEX_ATTRIB_BINDINGS."
+ */
+ if (first + count > ctx->Const.MaxVertexAttribBindings) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(first=%u + count=%d > the value of "
+ "GL_MAX_VERTEX_ATTRIB_BINDINGS=%u)",
+ func, first, count, ctx->Const.MaxVertexAttribBindings);
+ return;
+ }
+
+ vertex_array_vertex_buffers(ctx, vao, first, count, buffers, offsets,
+ strides, false, func);
+}
+
+
void GLAPIENTRY
_mesa_BindVertexBuffers(GLuint first, GLsizei count, const GLuint *buffers,
const GLintptr *offsets, const GLsizei *strides)
return;
}
- vertex_array_vertex_buffers(ctx, ctx->Array.VAO, first, count,
- buffers, offsets, strides,
- "glBindVertexBuffers");
+ vertex_array_vertex_buffers_err(ctx, ctx->Array.VAO, first, count,
+ buffers, offsets, strides,
+ "glBindVertexBuffers");
}
if (!vao)
return;
- vertex_array_vertex_buffers(ctx, vao, first, count,
- buffers, offsets, strides,
- "glVertexArrayVertexBuffers");
+ vertex_array_vertex_buffers_err(ctx, vao, first, count,
+ buffers, offsets, strides,
+ "glVertexArrayVertexBuffers");
}