diff options
author | Dave Airlie <[email protected]> | 2009-03-20 10:52:17 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2009-03-20 10:52:17 +1000 |
commit | 407e8ae5b167b0193e1e5b1266a5d61ed836dfb5 (patch) | |
tree | 2d9d05a5c3122f41a13aa8bd9ae921c1176e6b0d /src/mesa/drivers/x11 | |
parent | bdaa0341caffc353fd26bbd91865c2d86eed11c1 (diff) | |
parent | 114bb54324f22cb53bcd14607234d0acd74d37bd (diff) |
Merge remote branch 'main/master' into radeon-rewrite
Conflicts:
src/mesa/drivers/dri/r300/r300_cmdbuf.c
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/r300_swtcl.c
src/mesa/drivers/dri/r300/radeon_ioctl.c
src/mesa/drivers/dri/radeon/radeon_screen.c
Diffstat (limited to 'src/mesa/drivers/x11')
-rw-r--r-- | src/mesa/drivers/x11/Makefile | 3 | ||||
-rw-r--r-- | src/mesa/drivers/x11/glxapi.c | 6 | ||||
-rw-r--r-- | src/mesa/drivers/x11/xm_api.c | 17 | ||||
-rw-r--r-- | src/mesa/drivers/x11/xm_buffer.c | 1 | ||||
-rw-r--r-- | src/mesa/drivers/x11/xm_span.c | 18 |
5 files changed, 38 insertions, 7 deletions
diff --git a/src/mesa/drivers/x11/Makefile b/src/mesa/drivers/x11/Makefile index d2780e62c97..5e427d2d5c6 100644 --- a/src/mesa/drivers/x11/Makefile +++ b/src/mesa/drivers/x11/Makefile @@ -41,7 +41,8 @@ OBJECTS = $(SOURCES:.c=.o) INCLUDE_DIRS = \ -I$(TOP)/include \ -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main + -I$(TOP)/src/mesa/main \ + $(X11_INCLUDES) CORE_MESA = $(TOP)/src/mesa/libmesa.a $(TOP)/src/mesa/libglapi.a diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c index c2ccce6f520..02eea25a712 100644 --- a/src/mesa/drivers/x11/glxapi.c +++ b/src/mesa/drivers/x11/glxapi.c @@ -35,6 +35,7 @@ #include <stdio.h> #include <string.h> #include "main/glheader.h" +#include "main/compiler.h" #include "glapi/glapi.h" #include "glxapi.h" @@ -1374,7 +1375,12 @@ _glxapi_get_proc_address(const char *funcName) { GLuint i; for (i = 0; GLX_functions[i].Name; i++) { +#ifdef MANGLE + /* skip the "m" prefix on the name */ + if (strcmp(GLX_functions[i].Name, funcName+1) == 0) +#else if (strcmp(GLX_functions[i].Name, funcName) == 0) +#endif return GLX_functions[i].Address; } return NULL; diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 2a8c3a4fd36..6ae5b6fd580 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1584,6 +1584,14 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) return NULL; } + /* Enable this to exercise fixed function -> shader translation + * with software rendering. + */ + if (0) { + mesaCtx->VertexProgram._MaintainTnlProgram = GL_TRUE; + mesaCtx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE; + } + _mesa_enable_sw_extensions(mesaCtx); _mesa_enable_1_3_extensions(mesaCtx); _mesa_enable_1_4_extensions(mesaCtx); @@ -2410,11 +2418,8 @@ xbuffer_to_renderbuffer(int buffer) case GLX_AUX0_EXT: return BUFFER_AUX0; case GLX_AUX1_EXT: - return BUFFER_AUX1; case GLX_AUX2_EXT: - return BUFFER_AUX2; case GLX_AUX3_EXT: - return BUFFER_AUX3; case GLX_AUX4_EXT: case GLX_AUX5_EXT: case GLX_AUX6_EXT: @@ -2461,13 +2466,13 @@ XMesaBindTexImage(XMesaDisplay *dpy, XMesaBuffer drawable, int buffer, #if 0 switch (drawable->TextureTarget) { case GLX_TEXTURE_1D_EXT: - texObj = texUnit->Current1D; + texObj = texUnit->CurrentTex[TEXTURE_1D_INDEX]; break; case GLX_TEXTURE_2D_EXT: - texObj = texUnit->Current2D; + texObj = texUnit->CurrentTex[TEXTURE_2D_INDEX]; break; case GLX_TEXTURE_RECTANGLE_EXT: - texObj = texUnit->CurrentRect; + texObj = texUnit->CurrentTex[TEXTURE_RECT_INDEX]; break; default: return; /* BadMatch error */ diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c index 7ad67bc34da..821e2a8e082 100644 --- a/src/mesa/drivers/x11/xm_buffer.c +++ b/src/mesa/drivers/x11/xm_buffer.c @@ -229,6 +229,7 @@ alloc_back_buffer(XMesaBuffer b, GLuint width, GLuint height) } b->backxrb->ximage = NULL; + b->backxrb->drawable = b->backxrb->pixmap; } } diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c index 57b57494483..309cefcb8e8 100644 --- a/src/mesa/drivers/x11/xm_span.c +++ b/src/mesa/drivers/x11/xm_span.c @@ -471,8 +471,26 @@ static void put_row_8R8G8B_pixmap( PUT_ROW_ARGS ) if (mask) { for (i=0;i<n;i++,x++) { if (mask[i]) { +#if 1 + /* + * XXX Something funny is going on here. + * If we're drawing into a window that uses a depth 32 TrueColor + * visual, we see the right pixels on screen, but when we read + * them back with XGetImage() we get random colors. + * The alternative code below which uses XPutImage() instead + * seems to mostly fix the problem, but not always. + * We don't normally create windows with this visual, but glean + * does and we're seeing some failures there. + */ XMesaSetForeground( dpy, gc, PACK_8R8G8B( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] )); XMesaDrawPoint( dpy, buffer, gc, (int) x, (int) y ); +#else + /* This code works more often, but not always */ + XMesaImage *rowimg = XMESA_BUFFER(ctx->DrawBuffer)->rowimage; + GLuint *ptr4 = (GLuint *) rowimg->data; + *ptr4 = PACK_8R8G8B( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ); + XMesaPutImage( dpy, buffer, gc, rowimg, 0, 0, x, y, 1, 1 ); +#endif } } } |