| @@ -866,6 +866,7 @@ fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win, | |||
| GLcontext *ctx = 0; | |||
| /*FX_GrContext_t glideContext = 0;*/ | |||
| char *errorstr; | |||
| GLboolean useBGR; | |||
| if (MESA_VERBOSE&VERBOSE_DRIVER) { | |||
| fprintf(stderr,"fxmesa: fxMesaCreateContext() Start\n"); | |||
| @@ -973,9 +974,12 @@ fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win, | |||
| goto errorhandler; | |||
| } | |||
| /* Pixel tables are use during pixel read-back */ | |||
| /* | |||
| * Pixel tables are use during pixel read-back | |||
| * Either initialize them for RGB or BGR order. | |||
| */ | |||
| #if FXMESA_USE_ARGB | |||
| fxInitPixelTables(fxMesa, GL_FALSE); /* Force RGB pixel order */ | |||
| useBGR = GL_FALSE; /* Force RGB pixel order */ | |||
| #else | |||
| if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO) { | |||
| /* jk991130 - GROSS HACK!!! - Voodoo 3s don't use BGR!! | |||
| @@ -984,17 +988,32 @@ fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win, | |||
| * as Voodoo3s have 2 TMUs on board, Banshee has only 1 | |||
| * Thanks to Joseph Kain for that one | |||
| */ | |||
| if (glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.nTexelfx == 2) { | |||
| fxInitPixelTables(fxMesa, GL_FALSE); /* use RGB pixel order (Voodoo3) */ | |||
| GrVoodooConfig_t *voodoo; | |||
| voodoo = &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig; | |||
| /* | |||
| printf("Voodoo num_sst %d\n", glbHWConfig.num_sst); | |||
| printf("Voodoo nTexelfx %d\n", voodoo->nTexelfx); | |||
| printf("Voodoo fbRam %d\n", voodoo->fbRam); | |||
| printf("Voodoo fbiRev %d\n", voodoo->fbiRev); | |||
| */ | |||
| if (voodoo->nTexelfx == 2 && voodoo->fbiRev != 260) { | |||
| /* RGB pixel order (Voodoo3, but some Quantum3D models) */ | |||
| useBGR = GL_FALSE; | |||
| } | |||
| else { | |||
| fxInitPixelTables(fxMesa, GL_TRUE); /* use BGR pixel order on Voodoo1/2 */ | |||
| /* BGR pixel order on Voodoo1/2, or certain Quantum3D models */ | |||
| useBGR = GL_TRUE; | |||
| } | |||
| } | |||
| else { | |||
| fxInitPixelTables(fxMesa, GL_FALSE); /* use RGB pixel order otherwise */ | |||
| useBGR = GL_FALSE; /* use RGB pixel order otherwise */ | |||
| } | |||
| #endif | |||
| if (getenv("MESA_FX_INFO")) | |||
| printf("Voodoo pixel order: %s\n", useBGR ? "BGR" : "RGB"); | |||
| fxInitPixelTables(fxMesa, useBGR); | |||
| fxMesa->width=FX_grSstScreenWidth(); | |||
| fxMesa->height=FX_grSstScreenHeight(); | |||