New elt buffer code should be fairly stable.
[mesa.git] / src / mesa / drivers / dri / r300 / r300_context.h
index 0c72aa067043a5abf7c32a215b08246907f4db54..c7e1b8edca7886bdfd37c413cffa6d9983598788 100644 (file)
@@ -60,6 +60,7 @@ typedef struct r300_context *r300ContextPtr;
    I suppose we could inline this and use macro to fetch out __LINE__ and stuff in case we run into trouble 
    with other compilers ... GLUE!
 */
+#if 1
 #define WARN_ONCE(a, ...)      { \
        static int warn##__LINE__=1; \
        if(warn##__LINE__){ \
@@ -71,6 +72,9 @@ typedef struct r300_context *r300ContextPtr;
                warn##__LINE__=0;\
                } \
        }
+#else
+#define WARN_ONCE(a, ...) {}
+#endif
 
 typedef GLuint uint32_t;
 typedef GLubyte uint8_t;
@@ -128,7 +132,11 @@ struct r300_dma {
        void (*flush) (r300ContextPtr);
 
        char *buf0_address;     /* start of buf[0], for index calcs */
-       GLuint nr_released_bufs;        /* flush after so many buffers released */
+
+       /* Number of "in-flight" DMA buffers, i.e. the number of buffers
+        * for which a DISCARD command is currently queued in the command buffer.
+        */
+       GLuint nr_released_bufs;
 };
 
        /* Texture related */
@@ -410,7 +418,6 @@ struct r300_hw_state {
 #ifdef EXP_C
        struct r300_state_atom lsf;     /* line stipple factor */
 #endif
-       struct r300_state_atom dummy[4];
        struct r300_state_atom unk4260; /* (4260) */
        struct r300_state_atom unk4274; /* (4274) */
        struct r300_state_atom unk4288; /* (4288) */
@@ -452,7 +459,6 @@ struct r300_hw_state {
        struct r300_state_atom vpi;     /* vp instructions */
        struct r300_state_atom vpp;     /* vp parameters */
        struct r300_state_atom vps;     /* vertex point size (?) */
-
                /* 8 texture units */
                /* the state is grouped by function and not by
                   texture unit. This makes single unit updates
@@ -661,10 +667,13 @@ struct r300_state {
        int aos_count;
 
        GLuint *Elts;
-       struct r300_dma_region elt_ao;
+       struct r300_dma_region elt_dma;
        
        GLuint render_inputs; /* actual render inputs that R300 was configured for. 
-                                They are the same as tnl->render_inputs for fixed pipeline */
+                                They are the same as tnl->render_inputs for fixed pipeline */  
+       struct {
+               int transform_offset;  /* Transform matrix offset, -1 if none */
+               } vap_param;  /* vertex processor parameter allocation - tells where to write parameters */
 
        int hw_stencil;
 };
@@ -714,6 +723,19 @@ struct r300_context {
 
 #define R300_CONTEXT(ctx)              ((r300ContextPtr)(ctx->DriverCtx))
 
+static __inline GLuint r300PackColor( GLuint cpp,
+                                       GLubyte r, GLubyte g,
+                                       GLubyte b, GLubyte a )
+{
+   switch ( cpp ) {
+   case 2:
+      return PACK_COLOR_565( r, g, b );
+   case 4:
+      return PACK_COLOR_8888( r, g, b, a );
+   default:
+      return 0;
+   }
+}
 extern void r300DestroyContext(__DRIcontextPrivate * driContextPriv);
 extern GLboolean r300CreateContext(const __GLcontextModes * glVisual,
                                   __DRIcontextPrivate * driContextPriv,