summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/glide/fxg.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/mesa/drivers/glide/fxg.c b/src/mesa/drivers/glide/fxg.c
index 7d39ddbe5f0..9f241851000 100644
--- a/src/mesa/drivers/glide/fxg.c
+++ b/src/mesa/drivers/glide/fxg.c
@@ -2228,11 +2228,13 @@ void FX_CALL fake_grTexNCCTableExt (GrChipID_t tmu,
void tdfx_hook_glide (struct tdfx_glide *Glide)
{
#if DEBUG_TRAP
-#define GET_EXT_ADDR(name) *(GrProc *)&real_##name = grGetProcAddress(#name), Glide->name = trap_##name
-#define GET_TXS_ADDR(name) Glide->name = trap_##name
+#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
+#define GET_TXS_ADDR(name) Glide->name = trap_##name
#else /* DEBUG_TRAP */
-#define GET_EXT_ADDR(name) *(GrProc *)&Glide->name = grGetProcAddress(#name)
-#define GET_TXS_ADDR(name) Glide->name = name
+#define GET_EXT_ADDR(name) *(GrProc *)&Glide->name = grGetProcAddress(#name)
+#define GET_EXT_FAKE(name) GET_EXT_ADDR(name); if (Glide->name == NULL) Glide->name = fake_##name
+#define GET_TXS_ADDR(name) Glide->name = name
#endif /* DEBUG_TRAP */
/*
@@ -2245,9 +2247,9 @@ void tdfx_hook_glide (struct tdfx_glide *Glide)
GET_EXT_ADDR(grTexChromaModeExt);
GET_EXT_ADDR(grTexChromaRangeExt);
/* pointcast */
- GET_EXT_ADDR(grTexDownloadTableExt);
- GET_EXT_ADDR(grTexDownloadTablePartialExt);
- GET_EXT_ADDR(grTexNCCTableExt);
+ GET_EXT_FAKE(grTexDownloadTableExt);
+ GET_EXT_FAKE(grTexDownloadTablePartialExt);
+ GET_EXT_FAKE(grTexNCCTableExt);
/* tbext */
GET_EXT_ADDR(grTextureBufferExt);
GET_EXT_ADDR(grTextureAuxBufferExt);
@@ -2275,19 +2277,6 @@ void tdfx_hook_glide (struct tdfx_glide *Glide)
GET_TXS_ADDR(txMipQuantize);
GET_TXS_ADDR(txPalToNcc);
- /* housekeeping: make sure the pointcast always point to something valid */
- if (grGetProcAddress("grTexDownloadTableExt") == NULL) {
-#if DEBUG_TRAP
- real_grTexDownloadTableExt = fake_grTexDownloadTableExt;
- real_grTexDownloadTablePartialExt = fake_grTexDownloadTablePartialExt;
- real_grTexNCCTableExt = fake_grTexNCCTableExt;
-#else
- Glide->grTexDownloadTableExt = fake_grTexDownloadTableExt;
- Glide->grTexDownloadTablePartialExt = fake_grTexDownloadTablePartialExt;
- Glide->grTexNCCTableExt = fake_grTexNCCTableExt;
-#endif
- }
-
#undef GET_EXT_ADDR
}