#include "fbobject.h"
#include "hash.h"
#include "mtypes.h"
+#include "state.h"
#include "util/bitscan.h"
#include "util/u_math.h"
#include "api_exec_decl.h"
#include "state_tracker/st_cb_fbo.h"
+#include "state_tracker/st_manager.h"
+#include "state_tracker/st_atom.h"
+#include "state_tracker/st_context.h"
#define BAD_MASK ~0u
/* Call the device driver function only if fb is the bound read buffer */
if (fb == ctx->ReadBuffer) {
- st_ReadBuffer(ctx, buffer);
+ /* Check if we need to allocate a front color buffer.
+ * Front buffers are often allocated on demand (other color buffers are
+ * always allocated in advance).
+ */
+ if ((fb->_ColorReadBufferIndex == BUFFER_FRONT_LEFT ||
+ fb->_ColorReadBufferIndex == BUFFER_FRONT_RIGHT) &&
+ fb->Attachment[fb->_ColorReadBufferIndex].Type == GL_NONE) {
+ assert(_mesa_is_winsys_fbo(fb));
+ /* add the buffer */
+ st_manager_add_color_renderbuffer(st_context(ctx), fb, fb->_ColorReadBufferIndex);
+ _mesa_update_state(ctx);
+ st_validate_state(st_context(ctx), ST_PIPELINE_UPDATE_FRAMEBUFFER);
+ }
}
}
}
}
-
-/**
- * Called via glReadBuffer. As with st_DrawBufferAllocate, we use this
- * function to check if we need to allocate a renderbuffer on demand.
- */
-void
-st_ReadBuffer(struct gl_context *ctx, GLenum buffer)
-{
- struct st_context *st = st_context(ctx);
- struct gl_framebuffer *fb = ctx->ReadBuffer;
-
- (void) buffer;
-
- /* Check if we need to allocate a front color buffer.
- * Front buffers are often allocated on demand (other color buffers are
- * always allocated in advance).
- */
- if ((fb->_ColorReadBufferIndex == BUFFER_FRONT_LEFT ||
- fb->_ColorReadBufferIndex == BUFFER_FRONT_RIGHT) &&
- fb->Attachment[fb->_ColorReadBufferIndex].Type == GL_NONE) {
- assert(_mesa_is_winsys_fbo(fb));
- /* add the buffer */
- st_manager_add_color_renderbuffer(st, fb, fb->_ColorReadBufferIndex);
- _mesa_update_state(ctx);
- st_validate_state(st, ST_PIPELINE_UPDATE_FRAMEBUFFER);
- }
-}
-
-
-
/**
* Called via ctx->Driver.MapRenderbuffer.
*/
GLenum internalFormat,
GLuint width, GLuint height);
void st_DrawBufferAllocate(struct gl_context *ctx);
-void st_ReadBuffer(struct gl_context *ctx, GLenum buffer);
void st_MapRenderbuffer(struct gl_context *ctx,
struct gl_renderbuffer *rb,