From edf4f53c15254ac53ab80ed127f3ff88f35dff8d Mon Sep 17 00:00:00 2001 From: Daniel Borca Date: Wed, 14 Apr 2004 08:00:52 +0000 Subject: documentation updates Glide3 driver: POINTCAST palette fixes --- src/mesa/drivers/glide/fxg.c | 18 ++++++++++++++---- src/mesa/drivers/glide/fxg.h | 2 +- src/mesa/drivers/glide/fxglidew.c | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/glide/fxg.c b/src/mesa/drivers/glide/fxg.c index b7408a70f98..c06b8dec2fb 100644 --- a/src/mesa/drivers/glide/fxg.c +++ b/src/mesa/drivers/glide/fxg.c @@ -2240,8 +2240,12 @@ void FX_CALL fake_grTexNCCTableExt (GrChipID_t tmu, /****************************************************************************\ * interface * \****************************************************************************/ -void tdfx_hook_glide (struct tdfx_glide *Glide) +void tdfx_hook_glide (struct tdfx_glide *Glide, int pointcast) { +/* GET_EXT_ADDR: get function pointer + * GET_EXT_FAKE: get function pointer if possible, else use a fake function + * GET_EXT_NULL: get function pointer if possible, else leave NULL pointer + */ #if FX_TRAP_GLIDE #define GET_EXT_ADDR(name) *(GrProc *)&real_##name = grGetProcAddress(#name), Glide->name = trap_##name #define GET_EXT_FAKE(name) GET_EXT_ADDR(name); if (real_##name == NULL) real_##name = fake_##name @@ -2263,9 +2267,15 @@ void tdfx_hook_glide (struct tdfx_glide *Glide) GET_EXT_ADDR(grTexChromaModeExt); GET_EXT_ADDR(grTexChromaRangeExt); /* pointcast */ - GET_EXT_FAKE(grTexDownloadTableExt); - GET_EXT_FAKE(grTexDownloadTablePartialExt); - GET_EXT_FAKE(grTexNCCTableExt); + if (pointcast) { + GET_EXT_FAKE(grTexDownloadTableExt); + GET_EXT_FAKE(grTexDownloadTablePartialExt); + GET_EXT_FAKE(grTexNCCTableExt); + } else { + Glide->grTexDownloadTableExt = fake_grTexDownloadTableExt; + Glide->grTexDownloadTablePartialExt = fake_grTexDownloadTablePartialExt; + Glide->grTexNCCTableExt = fake_grTexNCCTableExt; + } /* tbext */ GET_EXT_ADDR(grTextureBufferExt); GET_EXT_ADDR(grTextureAuxBufferExt); diff --git a/src/mesa/drivers/glide/fxg.h b/src/mesa/drivers/glide/fxg.h index f2822967158..e7120111683 100644 --- a/src/mesa/drivers/glide/fxg.h +++ b/src/mesa/drivers/glide/fxg.h @@ -377,6 +377,6 @@ struct tdfx_glide { void (FX_CALL *txPalToNcc) (GuNccTable *ncc_table, const FxU32 *pal); }; -void tdfx_hook_glide (struct tdfx_glide *Glide); +void tdfx_hook_glide (struct tdfx_glide *Glide, int pointcast); #endif diff --git a/src/mesa/drivers/glide/fxglidew.c b/src/mesa/drivers/glide/fxglidew.c index 6af9895f1ba..67d816b627a 100644 --- a/src/mesa/drivers/glide/fxglidew.c +++ b/src/mesa/drivers/glide/fxglidew.c @@ -240,7 +240,7 @@ FX_grSstQueryHardware(GrHwConfiguration * config) } - tdfx_hook_glide(&config->Glide); + tdfx_hook_glide(&config->Glide, getenv("MESA_FX_POINTCAST") != NULL); END_BOARD_LOCK(); return 1; -- cgit v1.2.3