OK. It seems that the Glide source kits on
http://linux.3dfx.com don't actually include all the source code
necessary to build Glide for Windows, and 3dfx can't release the missing
pieces due to copyright issues. However, 3dfx did kindly provide with a
debug binary of Glide2x for Windows / Voodoo 1.
I installed this on a Pentium II with Windows 98 and Voodoo 1
and Permedia 2 graphics cards installed. I then compiled Mesa 3.2 from
the .tar.gz file up on the Mesa ftp site on 2/2/00, and linked it
against the library for the debug version of Glide. I built Mesa 3.2
using makefile.fx and Visual C 6 configured for command line builds,
with both the NASM and V2_OPTS options commented out in the makefile.
The GL_RENDERER string for Mesa on this machine is
"Mesa Glide v0.30 Voodoo Graphics 0 CARD/2 FB/2 TM/1 TMU/NOSLI". For
comparison, the GL_RENDERER string for 3dfx's own standalone
(3dfxvgl.dll) driver on the same hardware reads
"3dfx/Voodoo Graphics/1 TMU/2 MB".
I then ran my application under the Visual C 6 debugger, setting
the environment variables MESA_WGL_FX=window (to run in a window on a
Voodoo 1) and GDBG_LEVL=4 (to set the debug level for Glide). At the
point when I started rendering textured graphics, Glide reported
"grTexCombine: invalid TMU specified" to the debugger and shut down.
I ran some tests with versions of Mesa compiled with MESA_DEBUG
on and MESA_VERBOSE in pipeline.c set to log all possible data (rather
than the default of just VERBOSE_DRIVER) but couldn't find anything
which obviously looked like a problem (I can send mesa.log files to
anyone who wants them off the list - they're quite large).
However, if I go into fxsetup.c in the src/fx directory and
modify the fxSelectSingleTMUSrc_NoLock function to read as excerpted at
the bottom of this message, everything seems to work fine, at least for
my application on a Voodoo 1. I haven't tested a Voodoo Rush as yet,
but the Rush crashes had exactly the same symptoms and occurred with
similar Glide versions on cards that (I think) only had one TMU, so I'm
reasonably hopeful. For clarity, the actual change I've made is to wrap
the
FX_grTexCombine_NoLock(GR_TMU1, GR_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE, GR_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE, FXFALSE,FXFALSE);
call for the (LODBlend is false and tmu!=FX_TMU1) case with
if (fxMesa->haveTwoTMUs)
I assume this works because Glide (at least in the Windows
version) doesn't like having calls made that refer to TMU1 on boards
with only one TMU.
However, I don't know whether this is a "good fix", i.e. I don't
know whether it will work for all the paths through the code not used by
my game, or whether it might have some unpleasant side effects on boards
that do have two TMUs, etc. I'd be very grateful for some input from
someone more familar than I am with Glide, the Mesa 3.2 FX driver, or
both (:-)).
On a vaguely related note, I'm still getting occasional problems
with red to blue colour swapping with Mesa 3.2 on Banshee and Voodoo 2
cards (only, as far as I can tell, and quite trivial problems compared
to what used to happen), so I'd be grateful if someone could point me in
the direction of the lookup table that I think has been added to fix
this problem since Mesa 3.1.
Incidentally, if anyone's interested, this version runs at about
90-95% of the speed of the official 3dfx driver on the test system
described above with my application, and has better visual quality than
the 3dfx driver (as described in a previous post). Congratulations to
everyone involved... and many thanks to Daryll Strauss and Eero Pajarre
for their help with tracking this down.
Neal Tringham (VX)
([EMAIL PROTECTED])
And here (finally) is the code:
------------------------------------------------------------------------
from src \ fx \ fxsetup.c
------------------------------------------------------------------------
static void fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu,
FxBool LODblend)
{
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxSelectSingleTMUSrc(%d,%d)\n",tmu,
LODblend);
}
if(LODblend) {
FX_grTexCombine_NoLock(GR_TMU0,
GR_COMBINE_FUNCTION_BLEND,
GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION,
GR_COMBINE_FUNCTION_BLEND,
GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION,
FXFALSE,FXFALSE);
FX_grTexCombine_NoLock(GR_TMU1,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
FXFALSE,FXFALSE);
fxMesa->tmuSrc=FX_TMU_SPLIT;
} else {
if (tmu!=FX_TMU1) {
FX_grTexCombine_NoLock(GR_TMU0,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
FXFALSE,FXFALSE);
/* Glide crashes if we call this without TMU1? */
if (fxMesa->haveTwoTMUs) {
FX_grTexCombine_NoLock(GR_TMU1,
GR_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE,
FXFALSE,FXFALSE);
}
fxMesa->tmuSrc=FX_TMU0;
}
else {
FX_grTexCombine_NoLock(GR_TMU1,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
FXFALSE,FXFALSE);
/* GR_COMBINE_FUNCTION_SCALE_OTHER doesn't work ?!? */
FX_grTexCombine_NoLock(GR_TMU0,
GR_COMBINE_FUNCTION_BLEND,
GR_COMBINE_FACTOR_ONE,
GR_COMBINE_FUNCTION_BLEND,
GR_COMBINE_FACTOR_ONE,
FXFALSE,FXFALSE);
fxMesa->tmuSrc=FX_TMU1;
}
}
}
------------------------------------------------------------------------
_______________________________________________
Mesa-dev maillist - [EMAIL PROTECTED]
http://lists.mesa3d.org/mailman/listinfo/mesa-dev