mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 02:20:11 +01:00
apple: Change ifdefs for DRI to be DRI && !APPLE
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
parent
77dc40b289
commit
80b280db88
17 changed files with 108 additions and 120 deletions
|
|
@ -36,7 +36,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
/* THIS IS NOT AN X CONSORTIUM STANDARD */
|
/* THIS IS NOT AN X CONSORTIUM STANDARD */
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
|
|
||||||
#define NEED_REPLIES
|
#define NEED_REPLIES
|
||||||
#include <X11/Xlibint.h>
|
#include <X11/Xlibint.h>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ INSTALL_DIR = /usr/X11
|
||||||
X11_DIR = $(INSTALL_DIR)
|
X11_DIR = $(INSTALL_DIR)
|
||||||
|
|
||||||
CC=gcc
|
CC=gcc
|
||||||
GL_CFLAGS=-Wall -ggdb3 -Os -DPTHREADS -D_REENTRANT -DGLX_USE_APPLEGL -DGLX_ALIAS_UNSUPPORTED $(RC_CFLAGS) $(CFLAGS)
|
GL_CFLAGS=-Wall -ggdb3 -Os -DPTHREADS -D_REENTRANT -DGLX_DIRECT_RENDERING -DGLX_USE_APPLEGL -DGLX_ALIAS_UNSUPPORTED $(RC_CFLAGS) $(CFLAGS)
|
||||||
GL_LDFLAGS=-L$(INSTALL_DIR)/lib -L$(X11_DIR)/lib $(LDFLAGS) -Wl,-single_module
|
GL_LDFLAGS=-L$(INSTALL_DIR)/lib -L$(X11_DIR)/lib $(LDFLAGS) -Wl,-single_module
|
||||||
|
|
||||||
TCLSH=tclsh8.5
|
TCLSH=tclsh8.5
|
||||||
|
|
@ -12,7 +12,7 @@ INSTALL=install
|
||||||
LN=ln
|
LN=ln
|
||||||
RM=rm
|
RM=rm
|
||||||
|
|
||||||
INCLUDE=-I. -Iinclude -Iinclude/internal -I.. -I../../../include -I$(INSTALL_DIR)/include -I$(X11_DIR)/include
|
INCLUDE=-I. -Iinclude -Iinclude/internal -I.. -I../../../include -I../../../src/mesa -I../../../src/mesa/glapi -I$(INSTALL_DIR)/include -I$(X11_DIR)/include
|
||||||
COMPILE=$(CC) $(INCLUDE) $(GL_CFLAGS) -c
|
COMPILE=$(CC) $(INCLUDE) $(GL_CFLAGS) -c
|
||||||
|
|
||||||
#The directory with the final binaries.
|
#The directory with the final binaries.
|
||||||
|
|
|
||||||
|
|
@ -68,10 +68,10 @@ SetRead(struct apple_xgl_saved_state *saved)
|
||||||
|
|
||||||
saved->swapped = true;
|
saved->swapped = true;
|
||||||
|
|
||||||
if (apple_glx_make_current_context(dpy, gc->apple, gc->apple,
|
if (apple_glx_make_current_context(dpy, gc->driContext, gc->driContext,
|
||||||
gc->currentReadable)) {
|
gc->currentReadable)) {
|
||||||
/* An error occurred, so try to restore the old context state. */
|
/* An error occurred, so try to restore the old context state. */
|
||||||
(void) apple_glx_make_current_context(dpy, gc->apple, gc->apple,
|
(void) apple_glx_make_current_context(dpy, gc->driContext, gc->driContext,
|
||||||
gc->currentDrawable);
|
gc->currentDrawable);
|
||||||
saved->swapped = false;
|
saved->swapped = false;
|
||||||
}
|
}
|
||||||
|
|
@ -85,7 +85,7 @@ UnsetRead(struct apple_xgl_saved_state *saved)
|
||||||
GLXContext gc = __glXGetCurrentContext();
|
GLXContext gc = __glXGetCurrentContext();
|
||||||
Display *dpy = glXGetCurrentDisplay();
|
Display *dpy = glXGetCurrentDisplay();
|
||||||
|
|
||||||
if (apple_glx_make_current_context(dpy, gc->apple, gc->apple,
|
if (apple_glx_make_current_context(dpy, gc->driContext, gc->driContext,
|
||||||
gc->currentDrawable)) {
|
gc->currentDrawable)) {
|
||||||
/*
|
/*
|
||||||
* An error occurred restoring the drawable.
|
* An error occurred restoring the drawable.
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ glDrawBuffer(GLenum mode)
|
||||||
{
|
{
|
||||||
GLXContext gc = glXGetCurrentContext();
|
GLXContext gc = glXGetCurrentContext();
|
||||||
|
|
||||||
if (gc && apple_glx_context_uses_stereo(gc->apple)) {
|
if (gc && apple_glx_context_uses_stereo(gc->driContext)) {
|
||||||
GLenum buf[2];
|
GLenum buf[2];
|
||||||
GLsizei n = 0;
|
GLsizei n = 0;
|
||||||
|
|
||||||
|
|
@ -77,7 +77,7 @@ glDrawBuffers(GLsizei n, const GLenum * bufs)
|
||||||
{
|
{
|
||||||
GLXContext gc = glXGetCurrentContext();
|
GLXContext gc = glXGetCurrentContext();
|
||||||
|
|
||||||
if (gc && apple_glx_context_uses_stereo(gc->apple)) {
|
if (gc && apple_glx_context_uses_stereo(gc->driContext)) {
|
||||||
GLenum newbuf[n + 2];
|
GLenum newbuf[n + 2];
|
||||||
GLsizei i, outi = 0;
|
GLsizei i, outi = 0;
|
||||||
bool have_back = false;
|
bool have_back = false;
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,8 @@ glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
|
||||||
GLXContext gc = __glXGetCurrentContext();
|
GLXContext gc = __glXGetCurrentContext();
|
||||||
Display *dpy = glXGetCurrentDisplay();
|
Display *dpy = glXGetCurrentDisplay();
|
||||||
|
|
||||||
if (gc && gc->apple)
|
if (gc && gc->driContext)
|
||||||
apple_glx_context_update(dpy, gc->apple);
|
apple_glx_context_update(dpy, gc->driContext);
|
||||||
|
|
||||||
__gl_api.Viewport(x, y, width, height);
|
__gl_api.Viewport(x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
* Kristian Høgsberg (krh@redhat.com)
|
* Kristian Høgsberg (krh@redhat.com)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/extensions/Xfixes.h>
|
#include <X11/extensions/Xfixes.h>
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
* Kristian Høgsberg (krh@redhat.com)
|
* Kristian Høgsberg (krh@redhat.com)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/extensions/Xfixes.h>
|
#include <X11/extensions/Xfixes.h>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include "glxclient.h"
|
#include "glxclient.h"
|
||||||
|
|
|
||||||
|
|
@ -325,7 +325,7 @@ GetDrawableAttribute(Display * dpy, GLXDrawable drawable,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
{
|
{
|
||||||
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL);
|
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL);
|
||||||
|
|
||||||
|
|
@ -391,7 +391,7 @@ CreateDrawable(Display * dpy, const __GLcontextModes * fbconfig,
|
||||||
UnlockDisplay(dpy);
|
UnlockDisplay(dpy);
|
||||||
SyncHandle();
|
SyncHandle();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
do {
|
do {
|
||||||
/* FIXME: Maybe delay __DRIdrawable creation until the drawable
|
/* FIXME: Maybe delay __DRIdrawable creation until the drawable
|
||||||
* is actually bound to a context... */
|
* is actually bound to a context... */
|
||||||
|
|
@ -455,7 +455,7 @@ DestroyDrawable(Display * dpy, GLXDrawable drawable, CARD32 glxCode)
|
||||||
UnlockDisplay(dpy);
|
UnlockDisplay(dpy);
|
||||||
SyncHandle();
|
SyncHandle();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
{
|
{
|
||||||
int screen;
|
int screen;
|
||||||
__GLXdisplayPrivate *const priv = __glXInitialize(dpy);
|
__GLXdisplayPrivate *const priv = __glXInitialize(dpy);
|
||||||
|
|
|
||||||
|
|
@ -54,9 +54,7 @@
|
||||||
#include "GL/glxint.h"
|
#include "GL/glxint.h"
|
||||||
#include "GL/glxproto.h"
|
#include "GL/glxproto.h"
|
||||||
#include "GL/internal/glcore.h"
|
#include "GL/internal/glcore.h"
|
||||||
#ifndef GLX_USE_APPLEGL
|
|
||||||
#include "glapi/glapitable.h"
|
#include "glapi/glapitable.h"
|
||||||
#endif
|
|
||||||
#include "glxhash.h"
|
#include "glxhash.h"
|
||||||
#if defined( PTHREADS )
|
#if defined( PTHREADS )
|
||||||
# include <pthread.h>
|
# include <pthread.h>
|
||||||
|
|
@ -99,8 +97,13 @@ typedef struct _glapi_table __GLapi;
|
||||||
#define containerOf(ptr, type, member) \
|
#define containerOf(ptr, type, member) \
|
||||||
(type *)( (char *)ptr - offsetof(type,member) )
|
(type *)( (char *)ptr - offsetof(type,member) )
|
||||||
|
|
||||||
#include <GL/internal/dri_interface.h>
|
extern void DRI_glXUseXFont(Font font, int first, int count, int listbase);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
|
|
||||||
|
#include <GL/internal/dri_interface.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display dependent methods. This structure is initialized during the
|
* Display dependent methods. This structure is initialized during the
|
||||||
|
|
@ -187,8 +190,6 @@ extern __GLXDRIdisplay *dri2CreateDisplay(Display * dpy);
|
||||||
extern void dri2InvalidateBuffers(Display *dpy, XID drawable);
|
extern void dri2InvalidateBuffers(Display *dpy, XID drawable);
|
||||||
|
|
||||||
|
|
||||||
extern void DRI_glXUseXFont(Font font, int first, int count, int listbase);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Functions to obtain driver configuration information from a direct
|
** Functions to obtain driver configuration information from a direct
|
||||||
** rendering client application
|
** rendering client application
|
||||||
|
|
@ -199,10 +200,6 @@ extern const char *glXGetDriverConfig(const char *driverName);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GLX_USE_APPLEGL
|
|
||||||
extern void DRI_glXUseXFont( Font font, int first, int count, int listbase );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
#define __GL_CLIENT_ATTRIB_STACK_DEPTH 16
|
#define __GL_CLIENT_ATTRIB_STACK_DEPTH 16
|
||||||
|
|
@ -411,8 +408,13 @@ struct __GLXcontextRec
|
||||||
const __GLcontextModes *mode;
|
const __GLcontextModes *mode;
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
|
#ifdef GLX_USE_APPLEGL
|
||||||
|
void *driContext;
|
||||||
|
Bool do_destroy;
|
||||||
|
#else
|
||||||
__GLXDRIcontext *driContext;
|
__GLXDRIcontext *driContext;
|
||||||
__DRIcontext *__driContext;
|
__DRIcontext *__driContext;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -455,11 +457,6 @@ struct __GLXcontextRec
|
||||||
unsigned long thread_id;
|
unsigned long thread_id;
|
||||||
|
|
||||||
char gl_extension_bits[__GL_EXT_BYTES];
|
char gl_extension_bits[__GL_EXT_BYTES];
|
||||||
|
|
||||||
#ifdef GLX_USE_APPLEGL
|
|
||||||
void *apple;
|
|
||||||
Bool do_destroy;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define __glXSetError(gc,code) \
|
#define __glXSetError(gc,code) \
|
||||||
|
|
@ -514,7 +511,7 @@ struct __GLXscreenConfigsRec
|
||||||
*/
|
*/
|
||||||
char *effectiveGLXexts;
|
char *effectiveGLXexts;
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
/**
|
/**
|
||||||
* Per screen direct rendering interface functions and data.
|
* Per screen direct rendering interface functions and data.
|
||||||
*/
|
*/
|
||||||
|
|
@ -625,7 +622,7 @@ struct __GLXdisplayPrivateRec
|
||||||
*/
|
*/
|
||||||
__GLXscreenConfigs *screenConfigs;
|
__GLXscreenConfigs *screenConfigs;
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
/**
|
/**
|
||||||
* Per display direct rendering interface functions and data.
|
* Per display direct rendering interface functions and data.
|
||||||
*/
|
*/
|
||||||
|
|
@ -638,14 +635,12 @@ struct __GLXdisplayPrivateRec
|
||||||
|
|
||||||
extern GLubyte *__glXFlushRenderBuffer(__GLXcontext *, GLubyte *);
|
extern GLubyte *__glXFlushRenderBuffer(__GLXcontext *, GLubyte *);
|
||||||
|
|
||||||
#ifndef GLX_USE_APPLEGL
|
|
||||||
extern void __glXSendLargeChunk(__GLXcontext * gc, GLint requestNumber,
|
extern void __glXSendLargeChunk(__GLXcontext * gc, GLint requestNumber,
|
||||||
GLint totalRequests,
|
GLint totalRequests,
|
||||||
const GLvoid * data, GLint dataLen);
|
const GLvoid * data, GLint dataLen);
|
||||||
|
|
||||||
extern void __glXSendLargeCommand(__GLXcontext *, const GLvoid *, GLint,
|
extern void __glXSendLargeCommand(__GLXcontext *, const GLvoid *, GLint,
|
||||||
const GLvoid *, GLint);
|
const GLvoid *, GLint);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Initialize the GLX extension for dpy */
|
/* Initialize the GLX extension for dpy */
|
||||||
extern __GLXdisplayPrivate *__glXInitialize(Display *);
|
extern __GLXdisplayPrivate *__glXInitialize(Display *);
|
||||||
|
|
@ -805,7 +800,7 @@ extern GLboolean __glXGetMscRateOML(Display * dpy, GLXDrawable drawable,
|
||||||
int32_t * numerator,
|
int32_t * numerator,
|
||||||
int32_t * denominator);
|
int32_t * denominator);
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
GLboolean
|
GLboolean
|
||||||
__driGetMscRateOML(__DRIdrawable * draw,
|
__driGetMscRateOML(__DRIdrawable * draw,
|
||||||
int32_t * numerator, int32_t * denominator, void *private);
|
int32_t * numerator, int32_t * denominator, void *private);
|
||||||
|
|
|
||||||
|
|
@ -34,21 +34,22 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "glxclient.h"
|
#include "glxclient.h"
|
||||||
|
#include "glapi.h"
|
||||||
|
#include "glxextensions.h"
|
||||||
|
#include "glcontextmodes.h"
|
||||||
|
|
||||||
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
#ifdef GLX_USE_APPLEGL
|
#ifdef GLX_USE_APPLEGL
|
||||||
#include "apple_glx_context.h"
|
#include "apple_glx_context.h"
|
||||||
#include "apple_glx.h"
|
#include "apple_glx.h"
|
||||||
#include "glx_error.h"
|
#include "glx_error.h"
|
||||||
|
#define GC_IS_DIRECT(gc) ((gc)->isDirect)
|
||||||
#else
|
#else
|
||||||
#include "glapi.h"
|
|
||||||
#endif
|
|
||||||
#include "glxextensions.h"
|
|
||||||
#include "glcontextmodes.h"
|
|
||||||
|
|
||||||
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <X11/extensions/xf86vmode.h>
|
#include <X11/extensions/xf86vmode.h>
|
||||||
#include "xf86dri.h"
|
#include "xf86dri.h"
|
||||||
#define GC_IS_DIRECT(gc) ((gc)->driContext != NULL)
|
#define GC_IS_DIRECT(gc) ((gc)->driContext != NULL)
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#define GC_IS_DIRECT(gc) (0)
|
#define GC_IS_DIRECT(gc) (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -65,7 +66,7 @@ static const char __glXGLXClientVersion[] = "1.4";
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
|
|
||||||
static Bool windowExistsFlag;
|
static Bool windowExistsFlag;
|
||||||
static int
|
static int
|
||||||
|
|
@ -352,7 +353,7 @@ AllocateGLXContext(Display * dpy)
|
||||||
gc->maxSmallRenderCommandSize = bufSize;
|
gc->maxSmallRenderCommandSize = bufSize;
|
||||||
|
|
||||||
#ifdef GLX_USE_APPLEGL
|
#ifdef GLX_USE_APPLEGL
|
||||||
gc->apple = NULL;
|
gc->driContext = NULL;
|
||||||
gc->do_destroy = False;
|
gc->do_destroy = False;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -378,11 +379,12 @@ CreateContext(Display * dpy, int generic_id,
|
||||||
{
|
{
|
||||||
GLXContext gc;
|
GLXContext gc;
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
|
#ifdef GLX_USE_APPLEGL
|
||||||
|
int errorcode;
|
||||||
|
bool x11error;
|
||||||
|
#else
|
||||||
__GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen);
|
__GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen);
|
||||||
#endif
|
#endif
|
||||||
#ifdef GLX_USE_APPLEGL
|
|
||||||
int errorcode;
|
|
||||||
bool x11error;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (dpy == NULL)
|
if (dpy == NULL)
|
||||||
|
|
@ -395,7 +397,7 @@ CreateContext(Display * dpy, int generic_id,
|
||||||
if (!gc)
|
if (!gc)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
#ifndef GLX_USE_APPLEGL
|
#ifndef GLX_USE_APPLEGL /* TODO: darwin indirect */
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
if (allowDirect && psc->driScreen) {
|
if (allowDirect && psc->driScreen) {
|
||||||
gc->driContext = psc->driScreen->createContext(psc, fbconfig, gc,
|
gc->driContext = psc->driScreen->createContext(psc, fbconfig, gc,
|
||||||
|
|
@ -475,9 +477,12 @@ CreateContext(Display * dpy, int generic_id,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gc->imported = GL_FALSE;
|
gc->imported = GL_FALSE;
|
||||||
|
gc->renderType = renderType;
|
||||||
|
|
||||||
|
/* TODO: darwin: Integrate with above to do indirect */
|
||||||
#ifdef GLX_USE_APPLEGL
|
#ifdef GLX_USE_APPLEGL
|
||||||
if(apple_glx_create_context(&gc->apple, dpy, screen, fbconfig,
|
if(apple_glx_create_context(&gc->driContext, dpy, screen, fbconfig,
|
||||||
shareList ? shareList->apple : NULL,
|
shareList ? shareList->driContext : NULL,
|
||||||
&errorcode, &x11error)) {
|
&errorcode, &x11error)) {
|
||||||
__glXSendError(dpy, errorcode, 0, X_GLXCreateContext, x11error);
|
__glXSendError(dpy, errorcode, 0, X_GLXCreateContext, x11error);
|
||||||
__glXFreeContext(gc);
|
__glXFreeContext(gc);
|
||||||
|
|
@ -487,8 +492,6 @@ CreateContext(Display * dpy, int generic_id,
|
||||||
gc->currentContextTag = -1;
|
gc->currentContextTag = -1;
|
||||||
gc->mode = fbconfig;
|
gc->mode = fbconfig;
|
||||||
gc->isDirect = allowDirect;
|
gc->isDirect = allowDirect;
|
||||||
#else
|
|
||||||
gc->renderType = renderType;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return gc;
|
return gc;
|
||||||
|
|
@ -536,7 +539,7 @@ __glXFreeContext(__GLXcontext * gc)
|
||||||
XFree((char *) gc->version);
|
XFree((char *) gc->version);
|
||||||
if (gc->extensions)
|
if (gc->extensions)
|
||||||
XFree((char *) gc->extensions);
|
XFree((char *) gc->extensions);
|
||||||
#ifndef GLX_USE_APPLEGL
|
#ifndef GLX_USE_APPLEGL /* TODO: clientattrib */
|
||||||
__glFreeAttributeState(gc);
|
__glFreeAttributeState(gc);
|
||||||
#endif
|
#endif
|
||||||
XFree((char *) gc->buf);
|
XFree((char *) gc->buf);
|
||||||
|
|
@ -551,7 +554,7 @@ __glXFreeContext(__GLXcontext * gc)
|
||||||
static void
|
static void
|
||||||
DestroyContext(Display * dpy, GLXContext gc)
|
DestroyContext(Display * dpy, GLXContext gc)
|
||||||
{
|
{
|
||||||
#ifndef GLX_USE_APPLEGL
|
#ifndef GLX_USE_APPLEGL /* TODO: darwin: indirect */
|
||||||
xGLXDestroyContextReq *req;
|
xGLXDestroyContextReq *req;
|
||||||
GLXContextID xid;
|
GLXContextID xid;
|
||||||
CARD8 opcode;
|
CARD8 opcode;
|
||||||
|
|
@ -577,7 +580,7 @@ DestroyContext(Display * dpy, GLXContext gc)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
/* Destroy the direct rendering context */
|
/* Destroy the direct rendering context */
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
(*gc->driContext->destroyContext) (gc->driContext, gc->psc, dpy);
|
(*gc->driContext->destroyContext) (gc->driContext, gc->psc, dpy);
|
||||||
|
|
@ -606,8 +609,8 @@ DestroyContext(Display * dpy, GLXContext gc)
|
||||||
/* Destroy the handle if not current to anybody */
|
/* Destroy the handle if not current to anybody */
|
||||||
__glXUnlock();
|
__glXUnlock();
|
||||||
#ifdef GLX_USE_APPLEGL
|
#ifdef GLX_USE_APPLEGL
|
||||||
if(gc->apple)
|
if(gc->driContext)
|
||||||
apple_glx_destroy_context(&gc->apple, dpy);
|
apple_glx_destroy_context(&gc->driContext, dpy);
|
||||||
#endif
|
#endif
|
||||||
__glXFreeContext(gc);
|
__glXFreeContext(gc);
|
||||||
}
|
}
|
||||||
|
|
@ -694,7 +697,7 @@ glXWaitGL(void)
|
||||||
#ifdef GLX_USE_APPLEGL
|
#ifdef GLX_USE_APPLEGL
|
||||||
glFinish();
|
glFinish();
|
||||||
#else
|
#else
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
int screen;
|
int screen;
|
||||||
__GLXDRIdrawable *pdraw =
|
__GLXDRIdrawable *pdraw =
|
||||||
|
|
@ -741,9 +744,9 @@ glXWaitX(void)
|
||||||
__glXFlushRenderBuffer(gc, gc->pc);
|
__glXFlushRenderBuffer(gc, gc->pc);
|
||||||
|
|
||||||
#ifdef GLX_USE_APPLEGL
|
#ifdef GLX_USE_APPLEGL
|
||||||
apple_glx_waitx(dpy, gc->apple);
|
apple_glx_waitx(dpy, gc->driContext);
|
||||||
#else
|
#else
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
int screen;
|
int screen;
|
||||||
__GLXDRIdrawable *pdraw =
|
__GLXDRIdrawable *pdraw =
|
||||||
|
|
@ -790,7 +793,7 @@ glXUseXFont(Font font, int first, int count, int listBase)
|
||||||
#ifdef GLX_USE_APPLEGL
|
#ifdef GLX_USE_APPLEGL
|
||||||
DRI_glXUseXFont(font, first, count, listBase);
|
DRI_glXUseXFont(font, first, count, listBase);
|
||||||
#else
|
#else
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
DRI_glXUseXFont(font, first, count, listBase);
|
DRI_glXUseXFont(font, first, count, listBase);
|
||||||
return;
|
return;
|
||||||
|
|
@ -827,7 +830,7 @@ glXCopyContext(Display * dpy, GLXContext source,
|
||||||
int errorcode;
|
int errorcode;
|
||||||
bool x11error;
|
bool x11error;
|
||||||
|
|
||||||
if(apple_glx_copy_context(gc->apple, source->apple, dest->apple,
|
if(apple_glx_copy_context(gc->driContext, source->driContext, dest->driContext,
|
||||||
mask, &errorcode, &x11error)) {
|
mask, &errorcode, &x11error)) {
|
||||||
__glXSendError(dpy, errorcode, 0, X_GLXCopyContext, x11error);
|
__glXSendError(dpy, errorcode, 0, X_GLXCopyContext, x11error);
|
||||||
}
|
}
|
||||||
|
|
@ -843,7 +846,7 @@ glXCopyContext(Display * dpy, GLXContext source,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
/* NOT_DONE: This does not work yet */
|
/* NOT_DONE: This does not work yet */
|
||||||
}
|
}
|
||||||
|
|
@ -875,7 +878,6 @@ glXCopyContext(Display * dpy, GLXContext source,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef GLX_USE_APPLEGL
|
|
||||||
/**
|
/**
|
||||||
* Determine if a context uses direct rendering.
|
* Determine if a context uses direct rendering.
|
||||||
*
|
*
|
||||||
|
|
@ -887,6 +889,9 @@ glXCopyContext(Display * dpy, GLXContext source,
|
||||||
static Bool
|
static Bool
|
||||||
__glXIsDirect(Display * dpy, GLXContextID contextID)
|
__glXIsDirect(Display * dpy, GLXContextID contextID)
|
||||||
{
|
{
|
||||||
|
#ifndef GLX_USE_APPLEGL /* TODO: apple indirect */
|
||||||
|
return GC_IS_DIRECT(gc);
|
||||||
|
#else
|
||||||
#if !defined(USE_XCB)
|
#if !defined(USE_XCB)
|
||||||
xGLXIsDirectReq *req;
|
xGLXIsDirectReq *req;
|
||||||
xGLXIsDirectReply reply;
|
xGLXIsDirectReply reply;
|
||||||
|
|
@ -922,8 +927,8 @@ __glXIsDirect(Display * dpy, GLXContextID contextID)
|
||||||
|
|
||||||
return reply.isDirect;
|
return reply.isDirect;
|
||||||
#endif /* USE_XCB */
|
#endif /* USE_XCB */
|
||||||
}
|
|
||||||
#endif /* GLX_USE_APPLEGL */
|
#endif /* GLX_USE_APPLEGL */
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \todo
|
* \todo
|
||||||
|
|
@ -934,17 +939,6 @@ __glXIsDirect(Display * dpy, GLXContextID contextID)
|
||||||
PUBLIC Bool
|
PUBLIC Bool
|
||||||
glXIsDirect(Display * dpy, GLXContext gc)
|
glXIsDirect(Display * dpy, GLXContext gc)
|
||||||
{
|
{
|
||||||
#ifdef GLX_USE_APPLEGL
|
|
||||||
/*
|
|
||||||
* This isn't an ideal test.
|
|
||||||
* glXIsDirect should probably search a list of contexts.
|
|
||||||
*/
|
|
||||||
if(NULL == gc) {
|
|
||||||
__glXSendError(dpy, GLXBadContext, 0, X_GLXIsDirect, false);
|
|
||||||
return False;
|
|
||||||
}
|
|
||||||
return gc->isDirect;
|
|
||||||
#else
|
|
||||||
if (!gc) {
|
if (!gc) {
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
@ -952,7 +946,6 @@ glXIsDirect(Display * dpy, GLXContext gc)
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
return __glXIsDirect(dpy, gc->xid);
|
return __glXIsDirect(dpy, gc->xid);
|
||||||
#endif /* GLX_USE_APPLEGL */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PUBLIC GLXPixmap
|
PUBLIC GLXPixmap
|
||||||
|
|
@ -991,7 +984,7 @@ glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap)
|
||||||
UnlockDisplay(dpy);
|
UnlockDisplay(dpy);
|
||||||
SyncHandle();
|
SyncHandle();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
do {
|
do {
|
||||||
/* FIXME: Maybe delay __DRIdrawable creation until the drawable
|
/* FIXME: Maybe delay __DRIdrawable creation until the drawable
|
||||||
* is actually bound to a context... */
|
* is actually bound to a context... */
|
||||||
|
|
@ -1049,7 +1042,7 @@ glXDestroyGLXPixmap(Display * dpy, GLXPixmap glxpixmap)
|
||||||
UnlockDisplay(dpy);
|
UnlockDisplay(dpy);
|
||||||
SyncHandle();
|
SyncHandle();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
{
|
{
|
||||||
int screen;
|
int screen;
|
||||||
__GLXdisplayPrivate *const priv = __glXInitialize(dpy);
|
__GLXdisplayPrivate *const priv = __glXInitialize(dpy);
|
||||||
|
|
@ -1070,8 +1063,8 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable)
|
||||||
{
|
{
|
||||||
#ifdef GLX_USE_APPLEGL
|
#ifdef GLX_USE_APPLEGL
|
||||||
GLXContext gc = glXGetCurrentContext();
|
GLXContext gc = glXGetCurrentContext();
|
||||||
if(gc && apple_glx_is_current_drawable(dpy, gc->apple, drawable)) {
|
if(gc && apple_glx_is_current_drawable(dpy, gc->driContext, drawable)) {
|
||||||
apple_glx_swap_buffers(gc->apple);
|
apple_glx_swap_buffers(gc->driContext);
|
||||||
} else {
|
} else {
|
||||||
__glXSendError(dpy, GLXBadCurrentWindow, 0, X_GLXSwapBuffers, false);
|
__glXSendError(dpy, GLXBadCurrentWindow, 0, X_GLXSwapBuffers, false);
|
||||||
}
|
}
|
||||||
|
|
@ -1085,7 +1078,7 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable)
|
||||||
xGLXSwapBuffersReq *req;
|
xGLXSwapBuffersReq *req;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL);
|
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL);
|
||||||
|
|
||||||
if (pdraw != NULL) {
|
if (pdraw != NULL) {
|
||||||
|
|
@ -1587,7 +1580,7 @@ glXQueryExtensionsString(Display * dpy, int screen)
|
||||||
}
|
}
|
||||||
|
|
||||||
__glXCalculateUsableExtensions(psc,
|
__glXCalculateUsableExtensions(psc,
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
(psc->driScreen != NULL),
|
(psc->driScreen != NULL),
|
||||||
#else
|
#else
|
||||||
GL_FALSE,
|
GL_FALSE,
|
||||||
|
|
@ -1819,7 +1812,7 @@ glXQueryContext(Display * dpy, GLXContext ctx, int attribute, int *value)
|
||||||
int retVal;
|
int retVal;
|
||||||
|
|
||||||
/* get the information from the server if we don't have it already */
|
/* get the information from the server if we don't have it already */
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (!ctx->driContext && (ctx->mode == NULL)) {
|
if (!ctx->driContext && (ctx->mode == NULL)) {
|
||||||
#else
|
#else
|
||||||
if (ctx->mode == NULL) {
|
if (ctx->mode == NULL) {
|
||||||
|
|
@ -2566,7 +2559,7 @@ __glXGetSyncValuesOML(Display * dpy, GLXDrawable drawable,
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
_X_HIDDEN GLboolean
|
_X_HIDDEN GLboolean
|
||||||
__driGetMscRateOML(__DRIdrawable * draw,
|
__driGetMscRateOML(__DRIdrawable * draw,
|
||||||
int32_t * numerator, int32_t * denominator, void *private)
|
int32_t * numerator, int32_t * denominator, void *private)
|
||||||
|
|
@ -3019,7 +3012,7 @@ __glXBindTexImageEXT(Display * dpy,
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL);
|
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL);
|
||||||
|
|
||||||
|
|
@ -3275,7 +3268,7 @@ static const struct name_address_pair GLX_functions[] = {
|
||||||
GLX_FUNCTION2(glXReleaseTexImageEXT, __glXReleaseTexImageEXT),
|
GLX_FUNCTION2(glXReleaseTexImageEXT, __glXReleaseTexImageEXT),
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
/*** DRI configuration ***/
|
/*** DRI configuration ***/
|
||||||
GLX_FUNCTION(glXGetScreenDriver),
|
GLX_FUNCTION(glXGetScreenDriver),
|
||||||
GLX_FUNCTION(glXGetDriverConfig),
|
GLX_FUNCTION(glXGetDriverConfig),
|
||||||
|
|
@ -3352,7 +3345,7 @@ PUBLIC void (*glXGetProcAddress(const GLubyte * procName)) (void)
|
||||||
#endif /* __GNUC__ */
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
/**
|
/**
|
||||||
* Get the unadjusted system time (UST). Currently, the UST is measured in
|
* Get the unadjusted system time (UST). Currently, the UST is measured in
|
||||||
* microseconds since Epoc. The actual resolution of the UST may vary from
|
* microseconds since Epoc. The actual resolution of the UST may vary from
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ __glXSetCurrentContextNull(void)
|
||||||
{
|
{
|
||||||
__glXSetCurrentContext(&dummyContext);
|
__glXSetCurrentContext(&dummyContext);
|
||||||
#ifndef GLX_USE_APPLEGL
|
#ifndef GLX_USE_APPLEGL
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
_glapi_set_dispatch(NULL); /* no-op functions */
|
_glapi_set_dispatch(NULL); /* no-op functions */
|
||||||
_glapi_set_context(NULL);
|
_glapi_set_context(NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -284,7 +284,7 @@ SendMakeCurrentRequest(Display * dpy, CARD8 opcode,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
static __GLXDRIdrawable *
|
static __GLXDRIdrawable *
|
||||||
FetchDRIDrawable(Display * dpy, GLXDrawable glxDrawable, GLXContext gc)
|
FetchDRIDrawable(Display * dpy, GLXDrawable glxDrawable, GLXContext gc)
|
||||||
{
|
{
|
||||||
|
|
@ -342,8 +342,8 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
|
||||||
const GLXContext oldGC = __glXGetCurrentContext();
|
const GLXContext oldGC = __glXGetCurrentContext();
|
||||||
#ifdef GLX_USE_APPLEGL
|
#ifdef GLX_USE_APPLEGL
|
||||||
bool error = apple_glx_make_current_context(dpy,
|
bool error = apple_glx_make_current_context(dpy,
|
||||||
(oldGC && oldGC != &dummyContext) ? oldGC->apple : NULL,
|
(oldGC && oldGC != &dummyContext) ? oldGC->driContext : NULL,
|
||||||
gc ? gc->apple : NULL, draw);
|
gc ? gc->driContext : NULL, draw);
|
||||||
|
|
||||||
apple_glx_diagnostic("%s: error %s\n", __func__, error ? "YES" : "NO");
|
apple_glx_diagnostic("%s: error %s\n", __func__, error ? "YES" : "NO");
|
||||||
if(error)
|
if(error)
|
||||||
|
|
@ -386,7 +386,7 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
/* Bind the direct rendering context to the drawable */
|
/* Bind the direct rendering context to the drawable */
|
||||||
if (gc && gc->driContext) {
|
if (gc && gc->driContext) {
|
||||||
__GLXDRIdrawable *pdraw = FetchDRIDrawable(dpy, draw, gc);
|
__GLXDRIdrawable *pdraw = FetchDRIDrawable(dpy, draw, gc);
|
||||||
|
|
@ -421,7 +421,7 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if ((dpy != oldGC->currentDpy || (gc && gc->driContext)) &&
|
if ((dpy != oldGC->currentDpy || (gc && gc->driContext)) &&
|
||||||
!oldGC->isDirect && oldGC != &dummyContext) {
|
!oldGC->isDirect && oldGC != &dummyContext) {
|
||||||
#else
|
#else
|
||||||
|
|
@ -439,7 +439,7 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
|
||||||
oldGC->currentContextTag, None, None,
|
oldGC->currentContextTag, None, None,
|
||||||
&dummy_reply);
|
&dummy_reply);
|
||||||
}
|
}
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
else if (oldGC->driContext && oldGC != gc) {
|
else if (oldGC->driContext && oldGC != gc) {
|
||||||
oldGC->driContext->unbindContext(oldGC->driContext);
|
oldGC->driContext->unbindContext(oldGC->driContext);
|
||||||
}
|
}
|
||||||
|
|
@ -485,7 +485,7 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
|
||||||
* previously destroyed, so we need to free the memory
|
* previously destroyed, so we need to free the memory
|
||||||
* for the old handle.
|
* for the old handle.
|
||||||
*/
|
*/
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
/* Destroy the old direct rendering context */
|
/* Destroy the old direct rendering context */
|
||||||
if (oldGC->driContext) {
|
if (oldGC->driContext) {
|
||||||
oldGC->driContext->destroyContext(oldGC->driContext,
|
oldGC->driContext->destroyContext(oldGC->driContext,
|
||||||
|
|
@ -507,7 +507,7 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
|
||||||
#ifndef GLX_USE_APPLEGL
|
#ifndef GLX_USE_APPLEGL
|
||||||
gc->thread_id = _glthread_GetID();
|
gc->thread_id = _glthread_GetID();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (!gc->driContext) {
|
if (!gc->driContext) {
|
||||||
#endif
|
#endif
|
||||||
if (!IndirectAPI)
|
if (!IndirectAPI)
|
||||||
|
|
@ -522,7 +522,7 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
|
||||||
(void) glGetString(GL_VERSION);
|
(void) glGetString(GL_VERSION);
|
||||||
__glXInitVertexArrayState(gc);
|
__glXInitVertexArrayState(gc);
|
||||||
}
|
}
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
gc->currentContextTag = -1;
|
gc->currentContextTag = -1;
|
||||||
|
|
|
||||||
|
|
@ -259,7 +259,7 @@ FreeScreenConfigs(__GLXdisplayPrivate * priv)
|
||||||
}
|
}
|
||||||
Xfree((char *) psc->serverGLXexts);
|
Xfree((char *) psc->serverGLXexts);
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (psc->driver_configs) {
|
if (psc->driver_configs) {
|
||||||
unsigned int j;
|
unsigned int j;
|
||||||
for (j = 0; psc->driver_configs[j]; j++)
|
for (j = 0; psc->driver_configs[j]; j++)
|
||||||
|
|
@ -299,7 +299,7 @@ __glXFreeDisplayPrivate(XExtData * extension)
|
||||||
priv->serverGLXversion = 0x0; /* to protect against double free's */
|
priv->serverGLXversion = 0x0; /* to protect against double free's */
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
/* Free the direct rendering per display data */
|
/* Free the direct rendering per display data */
|
||||||
if (priv->driswDisplay)
|
if (priv->driswDisplay)
|
||||||
(*priv->driswDisplay->destroyDisplay) (priv->driswDisplay);
|
(*priv->driswDisplay->destroyDisplay) (priv->driswDisplay);
|
||||||
|
|
@ -777,7 +777,7 @@ AllocAndFetchScreenConfigs(Display * dpy, __GLXdisplayPrivate * priv)
|
||||||
getVisualConfigs(dpy, priv, i);
|
getVisualConfigs(dpy, priv, i);
|
||||||
getFBConfigs(dpy, priv, i);
|
getFBConfigs(dpy, priv, i);
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
psc->scr = i;
|
psc->scr = i;
|
||||||
psc->dpy = dpy;
|
psc->dpy = dpy;
|
||||||
psc->drawHash = __glxHashCreate();
|
psc->drawHash = __glxHashCreate();
|
||||||
|
|
@ -817,7 +817,7 @@ __glXInitialize(Display * dpy)
|
||||||
__GLXdisplayPrivate *dpyPriv;
|
__GLXdisplayPrivate *dpyPriv;
|
||||||
XEDataObject dataObj;
|
XEDataObject dataObj;
|
||||||
int major, minor;
|
int major, minor;
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
Bool glx_direct, glx_accel;
|
Bool glx_direct, glx_accel;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -874,7 +874,7 @@ __glXInitialize(Display * dpy)
|
||||||
dpyPriv->serverGLXvendor = 0x0;
|
dpyPriv->serverGLXvendor = 0x0;
|
||||||
dpyPriv->serverGLXversion = 0x0;
|
dpyPriv->serverGLXversion = 0x0;
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
glx_direct = (getenv("LIBGL_ALWAYS_INDIRECT") == NULL);
|
glx_direct = (getenv("LIBGL_ALWAYS_INDIRECT") == NULL);
|
||||||
glx_accel = (getenv("LIBGL_ALWAYS_SOFTWARE") == NULL);
|
glx_accel = (getenv("LIBGL_ALWAYS_SOFTWARE") == NULL);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5198,7 +5198,7 @@ glDeleteTexturesEXT(GLsizei n, const GLuint * textures)
|
||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_DeleteTextures(GET_DISPATCH(), (n, textures));
|
CALL_DeleteTextures(GET_DISPATCH(), (n, textures));
|
||||||
} else
|
} else
|
||||||
|
|
@ -5269,7 +5269,7 @@ glGenTexturesEXT(GLsizei n, GLuint * textures)
|
||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GenTextures(GET_DISPATCH(), (n, textures));
|
CALL_GenTextures(GET_DISPATCH(), (n, textures));
|
||||||
} else
|
} else
|
||||||
|
|
@ -5334,7 +5334,7 @@ glIsTextureEXT(GLuint texture)
|
||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
return CALL_IsTexture(GET_DISPATCH(), (texture));
|
return CALL_IsTexture(GET_DISPATCH(), (texture));
|
||||||
} else
|
} else
|
||||||
|
|
@ -5650,7 +5650,7 @@ glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid * table)
|
||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetColorTable(GET_DISPATCH(), (target, format, type, table));
|
CALL_GetColorTable(GET_DISPATCH(), (target, format, type, table));
|
||||||
} else
|
} else
|
||||||
|
|
@ -5726,7 +5726,7 @@ glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat * params)
|
||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetColorTableParameterfv(GET_DISPATCH(),
|
CALL_GetColorTableParameterfv(GET_DISPATCH(),
|
||||||
(target, pname, params));
|
(target, pname, params));
|
||||||
|
|
@ -5799,7 +5799,7 @@ glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint * params)
|
||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetColorTableParameteriv(GET_DISPATCH(),
|
CALL_GetColorTableParameteriv(GET_DISPATCH(),
|
||||||
(target, pname, params));
|
(target, pname, params));
|
||||||
|
|
@ -6125,7 +6125,7 @@ gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type,
|
||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetConvolutionFilter(GET_DISPATCH(),
|
CALL_GetConvolutionFilter(GET_DISPATCH(),
|
||||||
(target, format, type, image));
|
(target, format, type, image));
|
||||||
|
|
@ -6203,7 +6203,7 @@ gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params)
|
||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetConvolutionParameterfv(GET_DISPATCH(),
|
CALL_GetConvolutionParameterfv(GET_DISPATCH(),
|
||||||
(target, pname, params));
|
(target, pname, params));
|
||||||
|
|
@ -6276,7 +6276,7 @@ gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params)
|
||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetConvolutionParameteriv(GET_DISPATCH(),
|
CALL_GetConvolutionParameteriv(GET_DISPATCH(),
|
||||||
(target, pname, params));
|
(target, pname, params));
|
||||||
|
|
@ -6356,7 +6356,7 @@ gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format,
|
||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetHistogram(GET_DISPATCH(),
|
CALL_GetHistogram(GET_DISPATCH(),
|
||||||
(target, reset, format, type, values));
|
(target, reset, format, type, values));
|
||||||
|
|
@ -6433,7 +6433,7 @@ gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params)
|
||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetHistogramParameterfv(GET_DISPATCH(), (target, pname, params));
|
CALL_GetHistogramParameterfv(GET_DISPATCH(), (target, pname, params));
|
||||||
} else
|
} else
|
||||||
|
|
@ -6504,7 +6504,7 @@ gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params)
|
||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetHistogramParameteriv(GET_DISPATCH(), (target, pname, params));
|
CALL_GetHistogramParameteriv(GET_DISPATCH(), (target, pname, params));
|
||||||
} else
|
} else
|
||||||
|
|
@ -6579,7 +6579,7 @@ gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format,
|
||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetMinmax(GET_DISPATCH(), (target, reset, format, type, values));
|
CALL_GetMinmax(GET_DISPATCH(), (target, reset, format, type, values));
|
||||||
} else
|
} else
|
||||||
|
|
@ -6653,7 +6653,7 @@ gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params)
|
||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetMinmaxParameterfv(GET_DISPATCH(), (target, pname, params));
|
CALL_GetMinmaxParameterfv(GET_DISPATCH(), (target, pname, params));
|
||||||
} else
|
} else
|
||||||
|
|
@ -6721,7 +6721,7 @@ gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params)
|
||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetMinmaxParameteriv(GET_DISPATCH(), (target, pname, params));
|
CALL_GetMinmaxParameteriv(GET_DISPATCH(), (target, pname, params));
|
||||||
} else
|
} else
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@ void NAME(_gloffset_GetSeparableFilter) (GLenum target, GLenum format,
|
||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetSeparableFilter(GET_DISPATCH(),
|
CALL_GetSeparableFilter(GET_DISPATCH(),
|
||||||
(target, format, type, row, column, span));
|
(target, format, type, row, column, span));
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
called by that routine when direct rendering is enabled.
|
called by that routine when direct rendering is enabled.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(GLX_DIRECT_RENDERING) || defined(GLX_USE_APPLEGL)
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
|
|
||||||
#include "glxclient.h"
|
#include "glxclient.h"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue