summaryrefslogtreecommitdiff
path: root/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h')
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h85
1 files changed, 39 insertions, 46 deletions
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h
index d630184bd..a73347435 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h
@@ -280,9 +280,7 @@ typedef struct {
volatile int fifoOwner;
volatile int ctxOwner;
volatile int texOwner;
-}
-TDFXSAREAPriv;
-
+} TDFXSAREAPriv;
typedef struct {
GLuint swapBuffer;
@@ -292,73 +290,72 @@ typedef struct {
GLuint texSwaps;
} tdfxStats;
-
-
/*
* Memory range from startAddr to endAddr-1
*/
typedef struct mem_range {
struct mem_range *next;
FxU32 startAddr, endAddr;
-}
-tdfxMemRange;
+} tdfxMemRange;
+typedef struct {
+ GLvoid *data;
+ GLsizei width, height;
+ FxU32 size;
+} tdfxTexRawData;
typedef struct {
- GLsizei width, height; /* image size */
- GLint texelSize; /* How many bytes to a texel */
- GrTextureFormat_t glideFormat; /* Glide image format */
- void *data; /* Glide-formated texture image */
- FxU32 dataSize; /* image size in bytes */
-}
-tdfxMipMapLevel;
+ tdfxTexRawData original; /* Mesa-formatted texture image */
+ tdfxTexRawData rescaled; /* Only needed if aspect ratio > 8:1 */
+
+ GLvoid *data; /* Final version of texture image */
+ FxU32 size; /* image size in bytes */
+
+ GrTextureFormat_t glideFormat; /* Glide image format */
+ GLint wScale, hScale; /* Broken hardware... */
+} tdfxTexImage, *tdfxTexImagePtr;
#define TDFX_NUM_TMU 2
-typedef struct tdfxTexInfo_t
-{
+typedef struct {
GLboolean isInTM;
GLboolean reloadImages; /* if true, resend images to Glide */
GLuint lastTimeUsed;
FxU32 whichTMU;
GrTexInfo info;
- GrAspectRatio_t aspectRatio;
- tdfxMipMapLevel mipmapLevel[MAX_TEXTURE_LEVELS];
- tdfxMemRange *tm[TDFX_NUM_TMU];
+ tdfxTexImage image[MAX_TEXTURE_LEVELS];
+ tdfxMemRange *range[TDFX_NUM_TMU];
GLint minLevel, maxLevel;
+ GrMipMapMode_t mmMode;
+ GrAspectRatio_t aspectRatio;
+ FxBool LODblend;
GrTextureFilterMode_t minFilt;
GrTextureFilterMode_t magFilt;
GrTextureClampMode_t sClamp;
GrTextureClampMode_t tClamp;
- FxBool LODblend;
- GrMipMapMode_t mmMode;
- GLfloat sScale, tScale; /* texcoord scale factor */
+ GLfloat sScale, tScale; /* texcoord scale factor */
GuTexPalette palette;
-}
-tdfxTexInfo;
+} tdfxTexObj, *tdfxTexObjPtr;
+#define TDFX_TEXTURE_DATA(tObj) ((tdfxTexObjPtr)((tObj)->DriverData))
-#define TDFX_TEXTURE_DATA(mesaObj) ((tdfxTexInfo *)((mesaObj)->DriverData))
-
-
-/*
- * This is state which may be shared by several tdfx contexts.
+/* This is state which may be shared by several tdfx contexts.
* It hangs off of Mesa's gl_shared_state object (ctx->Shared->DriverData).
*/
-struct tdfxSharedState {
+typedef struct tdfx_shared_state {
GLboolean umaTexMemory;
- GLuint totalTexMem[TDFX_NUM_TMU]; /* constant */
- GLuint freeTexMem[TDFX_NUM_TMU]; /* changes as we go */
- tdfxMemRange *tmPool;
- tdfxMemRange *tmFree[TDFX_NUM_TMU];
-};
+ GLuint totalTexMem[TDFX_NUM_TMU]; /* constant */
+ GLuint freeTexMem[TDFX_NUM_TMU]; /* changes as we go */
+ tdfxMemRange *rangePool;
+ tdfxMemRange *freeRanges[TDFX_NUM_TMU];
+} tdfxSharedState, *tdfxSharedStatePtr;
@@ -516,6 +513,11 @@ struct tdfx_depth {
FxBool Mask; /* Write enable flag */
};
+#ifndef GR_STIPPLE_PATTERN
+#error "You MUST upgrade your Glide3 libraries and headers."
+#error "Get the latest from http://dri.sourceforge.net/resources.html"
+#endif
+
struct tdfx_stipple {
GrStippleMode_t Mode; /* Stipple enable/disable */
FxU32 Pattern; /* 8x4 Stipple Pattern */
@@ -630,6 +632,7 @@ struct tdfx_context {
GLuint tmu_source[TDFX_NUM_TMU];
GLuint tex_dest[MAX_TEXTURE_UNITS];
+ GLuint numTMUs;
GLuint SetupIndex;
GLuint SetupDone;
@@ -641,10 +644,6 @@ struct tdfx_context {
GLfloat sScale0, tScale0;
GLfloat sScale1, tScale1;
-#if 0
- GLuint last_tri_caps;
- GLuint stw_hint_state; /* for grHints */
-#endif
GLuint using_fast_path, passes, multipass;
GLuint texBindNumber;
GLint tmuSrc;
@@ -652,13 +651,6 @@ struct tdfx_context {
int screen_width;
int screen_height;
-#if 0
- void *state; /* Glide state buffer */
-
- GLint textureAlign;
- GLboolean verbose;
-#endif
- GLboolean haveTwoTMUs; /* True if we have 2 tmu's */
GLboolean haveHwStencil;
GLint maxPendingSwapBuffers;
@@ -768,6 +760,7 @@ extern int TDFX_DEBUG;
#define DEBUG_VERBOSE_DRI 0x10
#define DEBUG_VERBOSE_IOCTL 0x20
#define DEBUG_VERBOSE_2D 0x40
+#define DEBUG_VERBOSE_TEXTURE 0x80
#endif /* GLX_DIRECT_RENDERING */