* New in GL 3.0
* Clear unsigned integer color buffer (not depth, not stencil).
*/
-void GLAPIENTRY
-_mesa_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value)
+static ALWAYS_INLINE void
+clear_bufferuiv(struct gl_context *ctx, GLenum buffer, GLint drawbuffer,
+ const GLuint *value, bool no_error)
{
- GET_CURRENT_CONTEXT(ctx);
-
FLUSH_VERTICES(ctx, 0);
FLUSH_CURRENT(ctx, 0);
case GL_COLOR:
{
const GLbitfield mask = make_color_buffer_mask(ctx, drawbuffer);
- if (mask == INVALID_MASK) {
+ if (!no_error && mask == INVALID_MASK) {
_mesa_error(ctx, GL_INVALID_VALUE, "glClearBufferuiv(drawbuffer=%d)",
drawbuffer);
return;
}
break;
default:
- /* Page 498 of the PDF, section '17.4.3.1 Clearing Individual Buffers'
- * of the OpenGL 4.5 spec states:
- *
- * "An INVALID_ENUM error is generated by ClearBufferuiv and
- * ClearNamedFramebufferuiv if buffer is not COLOR."
- */
- _mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferuiv(buffer=%s)",
- _mesa_enum_to_string(buffer));
+ if (!no_error) {
+ /* Page 498 of the PDF, section '17.4.3.1 Clearing Individual Buffers'
+ * of the OpenGL 4.5 spec states:
+ *
+ * "An INVALID_ENUM error is generated by ClearBufferuiv and
+ * ClearNamedFramebufferuiv if buffer is not COLOR."
+ */
+ _mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferuiv(buffer=%s)",
+ _mesa_enum_to_string(buffer));
+ }
return;
}
}
+void GLAPIENTRY
+_mesa_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ clear_bufferuiv(ctx, buffer, drawbuffer, value, false);
+}
+
+
/**
* The ClearBuffer framework is so complicated and so riddled with the
* assumption that the framebuffer is bound that, for now, we will just fake