if (fb == ctx->DrawBuffer) {
if (ctx->Driver.DrawBuffer)
ctx->Driver.DrawBuffer(ctx, buffer);
+ if (ctx->Driver.DrawBufferAllocate)
+ ctx->Driver.DrawBufferAllocate(ctx);
}
}
if (fb == ctx->DrawBuffer) {
if (ctx->Driver.DrawBuffer)
ctx->Driver.DrawBuffer(ctx, n > 0 ? buffers[0] : GL_NONE);
+ if (ctx->Driver.DrawBufferAllocate)
+ ctx->Driver.DrawBufferAllocate(ctx);
}
}
/** Specify mapping of depth values from NDC to window coordinates */
void (*DepthRange)(struct gl_context *ctx);
/** Specify the current buffer for writing */
- void (*DrawBuffer)( struct gl_context *ctx, GLenum buffer );
+ void (*DrawBuffer)(struct gl_context *ctx, GLenum buffer);
+ /** Used to allocated any buffers with on-demand creation */
+ void (*DrawBufferAllocate)(struct gl_context *ctx);
/** Enable or disable server-side gl capabilities */
void (*Enable)(struct gl_context *ctx, GLenum cap, GLboolean state);
/** Specify fog parameters */
* created FBOs.
*/
static void
-st_DrawBuffer(struct gl_context *ctx, GLenum buffer)
+st_DrawBufferAllocate(struct gl_context *ctx)
{
struct st_context *st = st_context(ctx);
struct gl_framebuffer *fb = ctx->DrawBuffer;
- (void) buffer;
-
if (_mesa_is_winsys_fbo(fb)) {
GLuint i;
/* add the renderbuffers on demand */
/**
- * Called via glReadBuffer. As with st_DrawBuffer, we use this function
- * to check if we need to allocate a renderbuffer on demand.
+ * Called via glReadBuffer. As with st_DrawBufferAllocate, we use this
+ * function to check if we need to allocate a renderbuffer on demand.
*/
static void
st_ReadBuffer(struct gl_context *ctx, GLenum buffer)
functions->FinishRenderTexture = st_finish_render_texture;
functions->ValidateFramebuffer = st_validate_framebuffer;
- functions->DrawBuffer = st_DrawBuffer;
+ functions->DrawBufferAllocate = st_DrawBufferAllocate;
functions->ReadBuffer = st_ReadBuffer;
functions->MapRenderbuffer = st_MapRenderbuffer;