stencil wrap works, either HW or SW (Ian Romanick)
[mesa.git] / src / mesa / drivers / glide / fxglidew.h
index b3a6b0ba677c81692bc0b318753b19be52bfd495..a19d0b58c73ea99a8527e0a59e51178538556147 100644 (file)
@@ -38,7 +38,9 @@
 
 #include "fxg.h"
 
-
+#ifndef FX_PACKEDCOLOR
+#define FX_PACKEDCOLOR 1
+#endif
 
 #define MAX_NUM_SST             4
 
@@ -112,6 +114,7 @@ typedef struct {
         float oow;             /* 1/w (used mipmapping - really 0xfff/w) */
 } GrTmuVertex;
 
+#if FX_PACKEDCOLOR
 typedef struct {
         float x, y;            /* X and Y in screen space */
         float ooz;             /* 65535/Z (used for Z-buffering) */
@@ -119,8 +122,9 @@ typedef struct {
         unsigned char pargb[4];        /* B, G, R, A [0..255] */
         GrTmuVertex tmuvtx[GLIDE_NUM_TMU];
         float fog;             /* fog coordinate */
+        unsigned char pspec[4];        /* B, G, R, A [0..255] */
         float psize;           /* point size */
-        long pad[16 - 13];     /* ensure 64b structure */
+        long pad[16 - 14];     /* ensure 64b structure */
 } GrVertex;
 
 #define GR_VERTEX_X_OFFSET              0
@@ -135,6 +139,35 @@ typedef struct {
 #define GR_VERTEX_TOW_TMU1_OFFSET       9
 #define GR_VERTEX_OOW_TMU1_OFFSET       10
 #define GR_VERTEX_FOG_OFFSET            11
+#define GR_VERTEX_PSPEC_OFFSET          12
+#else  /* !FX_PACKEDCOLOR */
+typedef struct {
+        float x, y;            /* X and Y in screen space */
+        float ooz;             /* 65535/Z (used for Z-buffering) */
+        float oow;             /* 1/W (used for W-buffering, texturing) */
+        float r, g, b, a;      /* R, G, B, A [0..255] */
+        GrTmuVertex tmuvtx[GLIDE_NUM_TMU];
+        float fog;             /* fog coordinate */
+        float r1, g1, b1;      /* R, G, B [0..255] */
+        float psize;           /* point size */
+        long pad[20 - 19];     /* ensure multiple of 16 */
+} GrVertex;
+
+#define GR_VERTEX_X_OFFSET              0
+#define GR_VERTEX_Y_OFFSET              1
+#define GR_VERTEX_OOZ_OFFSET            2
+#define GR_VERTEX_OOW_OFFSET            3
+#define GR_VERTEX_RGB_OFFSET            4
+#define GR_VERTEX_A_OFFSET              7
+#define GR_VERTEX_SOW_TMU0_OFFSET       8
+#define GR_VERTEX_TOW_TMU0_OFFSET       9
+#define GR_VERTEX_OOW_TMU0_OFFSET       10
+#define GR_VERTEX_SOW_TMU1_OFFSET       11
+#define GR_VERTEX_TOW_TMU1_OFFSET       12
+#define GR_VERTEX_OOW_TMU1_OFFSET       13
+#define GR_VERTEX_FOG_OFFSET            14
+#define GR_VERTEX_SPEC_OFFSET           15
+#endif /* !FX_PACKEDCOLOR */
 
 
 
@@ -152,36 +185,10 @@ typedef struct {
 
 
 /*
- * Write region: ToDo possible exploit the PixelPipe parameter.
- */
-#define FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data)        \
-        do { \
-            BEGIN_BOARD_LOCK(); \
-            grLfbWriteRegion(dst_buffer,\
-                             dst_x,     \
-                             dst_y,     \
-                             src_format,\
-                             src_width, \
-                             src_height,\
-                             FXFALSE,   \
-                             src_stride,\
-                             src_data);        \
-            END_BOARD_LOCK(); \
-        } while(0)
-
-
-
-/*
- * ScreenWidth/Height stuff.
+ * Query
  */
 extern int FX_grSstScreenWidth(void);
 extern int FX_grSstScreenHeight(void);
-
-
-
-/*
- * Query
- */
 extern void FX_grSstPerfStats(GrSstPerfStats_t *st);
 extern int FX_grSstQueryHardware(GrHwConfiguration *config);
 #define FX_grGetInteger FX_grGetInteger_NoLock