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);
}
/**
- * Add a renderbuffer to the framebuffer.
+ * Add a renderbuffer to the framebuffer. The framebuffer is one that
+ * corresponds to a window and is not a user-created FBO.
*/
static boolean
st_framebuffer_add_renderbuffer(struct st_framebuffer *stfb,
if (!stfb->iface)
return FALSE;
+ assert(_mesa_is_winsys_fbo(&stfb->Base));
+
/* do not distinguish depth/stencil buffers */
if (idx == BUFFER_STENCIL)
idx = BUFFER_DEPTH;
}
/**
- * Add a color renderbuffer on demand.
+ * Add a color renderbuffer on demand. The FBO must correspond to a window,
+ * not a user-created FBO.
*/
boolean
st_manager_add_color_renderbuffer(struct st_context *st,
if (!stfb)
return FALSE;
+ assert(_mesa_is_winsys_fbo(fb));
+
if (stfb->Base.Attachment[idx].Renderbuffer)
return TRUE;