* \param mask bit-mask indicating the buffers to be cleared.
*
* Flushes the vertices and verifies the parameter.
- * If __struct gl_contextRec::NewState is set then calls _mesa_update_state()
+ * If __struct gl_contextRec::NewState is set then calls _mesa_update_clear_state()
* to update gl_frame_buffer::_Xmin, etc. If the rasterization mode is set to
* GL_RENDER then requests the driver to clear the buffers, via the
* dd_function_table::Clear callback.
}
if (ctx->NewState) {
- _mesa_update_state( ctx ); /* update _Xmin, etc */
+ _mesa_update_clear_state( ctx ); /* update _Xmin, etc */
}
if (!no_error && ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
FLUSH_VERTICES(ctx, 0, 0);
if (ctx->NewState) {
- _mesa_update_state( ctx );
+ _mesa_update_clear_state( ctx );
}
if (!no_error && ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
FLUSH_VERTICES(ctx, 0, 0);
if (ctx->NewState) {
- _mesa_update_state( ctx );
+ _mesa_update_clear_state( ctx );
}
if (!no_error && ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE) {
FLUSH_VERTICES(ctx, 0, 0);
if (ctx->NewState) {
- _mesa_update_state( ctx );
+ _mesa_update_clear_state( ctx );
}
if (!no_error && ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE) {
return;
if (ctx->NewState) {
- _mesa_update_state( ctx );
+ _mesa_update_clear_state( ctx );
}
if (!no_error && ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
_mesa_unlock_context_textures(ctx);
}
+/* This is the usual entrypoint for state updates in glClear calls:
+ */
+void
+_mesa_update_clear_state( struct gl_context *ctx )
+{
+ GLbitfield new_state = ctx->NewState;
+
+ if (MESA_VERBOSE & VERBOSE_STATE)
+ _mesa_print_state("_mesa_update_clear_state", new_state);
+
+ if (new_state & _NEW_BUFFERS) {
+ _mesa_update_framebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer);
+
+ st_invalidate_buffers(st_context(ctx));
+ ctx->NewState &= ~_NEW_BUFFERS;
+ }
+}
/**
* Used by drivers to tell core Mesa that the driver is going to