mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
Add support for GLX_SGI_make_current_read.
This commit is contained in:
parent
3d769b81fa
commit
c94a96bae4
4 changed files with 36 additions and 11 deletions
|
|
@ -506,11 +506,12 @@ GLboolean i830MakeCurrent(__DRIcontextPrivate *driContextPriv,
|
|||
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);
|
||||
|
|
|
|||
|
|
@ -212,12 +212,26 @@ struct i830_context_t
|
|||
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;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -300,6 +300,8 @@ static GLboolean i830InitDriver(__DRIscreenPrivate *sPriv)
|
|||
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" );
|
||||
|
|
|
|||
|
|
@ -27,12 +27,13 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
/* $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 <keith@tungstengraphics.com>
|
||||
* Heavily based on the I810 driver, which was written by Keith Whitwell.
|
||||
*
|
||||
* \author Jeff Hartmann <jhartmann@2d3d.com>
|
||||
* \author Keith Whitwell <keith@tungstengraphics.com>
|
||||
*/
|
||||
|
||||
#include "glheader.h"
|
||||
|
|
@ -52,7 +53,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#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; \
|
||||
|
|
@ -67,7 +68,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#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; \
|
||||
|
|
@ -267,6 +268,13 @@ static void i830SetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
|
|||
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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue