summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2000-04-06 00:08:18 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2000-04-06 00:08:18 +0000
commit4f4a6b4a4f8d9a3cbb8f24a68ca4104fa0117513 (patch)
treed762abdbbe67927bd3c5abbbc3741b938e179b72 /src
parent884aa6efd87659f1f03a4df26059bc174733cd51 (diff)
pulled in the RGB vs BGR setup code from Mesa 3.3
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/glide/fxapi.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c
index 9b750bf4898..8bacc48ebf7 100644
--- a/src/mesa/drivers/glide/fxapi.c
+++ b/src/mesa/drivers/glide/fxapi.c
@@ -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();