i830ContextPtr imesa = (i830ContextPtr) driContextPriv->driverPrivate;
if ( imesa->driDrawable != driDrawPriv ) {
- /* Shouldn't the readbuffer be stored also? */
imesa->driDrawable = driDrawPriv;
i830XMesaWindowMoved( imesa );
}
+ imesa->driReadable = driReadPriv;
+
_mesa_make_current2(imesa->glCtx,
(GLframebuffer *) driDrawPriv->driverPrivate,
(GLframebuffer *) driReadPriv->driverPrivate);
drm_clip_rect_t scissor_rect;
drmContext hHWContext;
- drm_hw_lock_t *driHwLock;
+ drmLock *driHwLock;
int driFd;
- __DRIdrawablePrivate *driDrawable;
+ __DRIdrawablePrivate *driDrawable; /**< DRI drawable bound to this
+ * context for drawing.
+ */
+ __DRIdrawablePrivate *driReadable; /**< DRI drawable bound to this
+ * context for reading.
+ */
+
+ /**
+ * Drawable used by Mesa for software fallbacks for reading and
+ * writing. It is set by Mesa's \c SetBuffer callback, and will always be
+ * either \c i830_context_t::driDrawable or \c i830_context_t::driReadable.
+ */
+
+ __DRIdrawablePrivate * mesa_drawable;
+
__DRIscreenPrivate *driScreen;
- i830ScreenPrivate *i830Screen;
+ i830ScreenPrivate *i830Screen;
I830SAREAPtr sarea;
/**
void * const psc = sPriv->psc->screenConfigs;
if ( glx_enable_extension != NULL ) {
+ (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
+
if ( driCompareGLXAPIVersion( 20030915 ) >= 0 ) {
(*glx_enable_extension)( psc, "GLX_SGIX_fbconfig" );
(*glx_enable_extension)( psc, "GLX_OML_swap_method" );
/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_span.c,v 1.4 2002/12/10 01:26:53 dawes Exp $ */
-/*
- * Author:
- * Jeff Hartmann <jhartmann@2d3d.com>
+/**
+ * \file i830_span.c
+ *
+ * Heavily based on the I810 driver, which was written by Keith Whitwell.
*
- * Heavily based on the I810 driver, which was written by:
- * Keith Whitwell <keith@tungstengraphics.com>
+ * \author Jeff Hartmann <jhartmann@2d3d.com>
+ * \author Keith Whitwell <keith@tungstengraphics.com>
*/
#include "glheader.h"
#define LOCAL_VARS \
i830ContextPtr imesa = I830_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = imesa->driDrawable; \
+ __DRIdrawablePrivate *dPriv = imesa->mesa_drawable; \
i830ScreenPrivate *i830Screen = imesa->i830Screen; \
GLuint pitch = i830Screen->backPitch * i830Screen->cpp; \
GLuint height = dPriv->h; \
#define LOCAL_DEPTH_VARS \
i830ContextPtr imesa = I830_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = imesa->driDrawable; \
+ __DRIdrawablePrivate *dPriv = imesa->mesa_drawable; \
i830ScreenPrivate *i830Screen = imesa->i830Screen; \
GLuint pitch = i830Screen->backPitch * i830Screen->cpp; \
GLuint height = dPriv->h; \
GLuint bufferBit)
{
i830ContextPtr imesa = I830_CONTEXT(ctx);
+
+ assert( (colorBuffer == imesa->driDrawable->driverPrivate)
+ || (colorBuffer == imesa->driReadable->driverPrivate) );
+
+ imesa->mesa_drawable = (colorBuffer == imesa->driDrawable->driverPrivate)
+ ? imesa->driDrawable : imesa->driReadable;
+
if (bufferBit == DD_FRONT_LEFT_BIT) {
imesa->drawMap = (char *)imesa->driScreen->pFB;
imesa->readMap = (char *)imesa->driScreen->pFB;