Merge branch 'mesa_7_5_branch'
[mesa.git] / src / mesa / drivers / dri / r200 / r200_context.h
index 44c67b68cbc5b52bdf4ab2c58e72692ddf7f8dd3..14a1dda46ac0b3e869888e118e58aea4c6095007 100644 (file)
@@ -1,4 +1,3 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_context.h,v 1.2 2002/12/16 16:18:54 dawes Exp $ */
 /*
 Copyright (C) The Weather Channel, Inc.  2002.  All Rights Reserved.
 
@@ -42,9 +41,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "dri_util.h"
 #include "texmem.h"
 
-#include "macros.h"
-#include "mtypes.h"
-#include "colormac.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "main/colormac.h"
 #include "r200_reg.h"
 #include "r200_vertprog.h"
 
@@ -64,7 +63,7 @@ typedef union { GLfloat f; uint32_t ui32; } float_ui32_type;
 
 #include "r200_lock.h"
 #include "radeon_screen.h"
-#include "mm.h"
+#include "main/mm.h"
 
 /* Flags for software fallback cases */
 /* See correponding strings in r200_swtcl.c */
@@ -107,8 +106,7 @@ struct r200_vertex_program {
         VERTEX_SHADER_INSTRUCTION instr[R200_VSF_MAX_INST + 6];
         int pos_end;
         int inputs[VERT_ATTRIB_MAX];
-        int rev_inputs[16];
-        int gen_inputs_mapped;
+        GLubyte inputmap_rev[16];
         int native;
         int fogpidx;
         int fogmode;
@@ -181,6 +179,7 @@ struct r200_tex_obj {
 
    drm_radeon_tex_image_t image[6][RADEON_MAX_TEXTURE_LEVELS];
                                        /* Six, for the cube faces */
+   GLboolean image_override;           /* Image overridden by GLX_EXT_tfp */
 
    GLuint pp_txfilter;                 /* hardware register values */
    GLuint pp_txformat;
@@ -724,8 +723,6 @@ struct r200_store {
 /* r200_tcl.c
  */
 struct r200_tcl_info {
-   GLuint vertex_format;
-   GLint last_offset;
    GLuint hw_primitive;
 
 /* hw can handle 12 components max */
@@ -735,14 +732,7 @@ struct r200_tcl_info {
    GLuint *Elts;
 
    struct r200_dma_region indexed_verts;
-   struct r200_dma_region weight;
-   struct r200_dma_region obj;
-   struct r200_dma_region rgba;
-   struct r200_dma_region spec;
-   struct r200_dma_region fog;
-   struct r200_dma_region tex[R200_MAX_TEXTURE_UNITS];
-   struct r200_dma_region norm;
-   struct r200_dma_region generic[16];
+   struct r200_dma_region vertex_data[15];
 };
 
 
@@ -812,87 +802,6 @@ struct r200_ioctl {
 #define R200_MAX_PRIMS 64
 
 
-/* Want to keep a cache of these around.  Each is parameterized by
- * only a single value which has only a small range.  Only expect a
- * few, so just rescan the list each time?
- */
-struct dynfn {
-   struct dynfn *next, *prev;
-   int key[2];
-   char *code;
-};
-
-struct dfn_lists {
-   struct dynfn Vertex2f;
-   struct dynfn Vertex2fv;
-   struct dynfn Vertex3f;
-   struct dynfn Vertex3fv;
-   struct dynfn Color4ub;
-   struct dynfn Color4ubv;
-   struct dynfn Color3ub;
-   struct dynfn Color3ubv;
-   struct dynfn Color4f;
-   struct dynfn Color4fv;
-   struct dynfn Color3f;
-   struct dynfn Color3fv;
-   struct dynfn SecondaryColor3ubEXT;
-   struct dynfn SecondaryColor3ubvEXT;
-   struct dynfn SecondaryColor3fEXT;
-   struct dynfn SecondaryColor3fvEXT;
-   struct dynfn Normal3f;
-   struct dynfn Normal3fv;
-   struct dynfn TexCoord3f;
-   struct dynfn TexCoord3fv;
-   struct dynfn TexCoord2f;
-   struct dynfn TexCoord2fv;
-   struct dynfn TexCoord1f;
-   struct dynfn TexCoord1fv;
-   struct dynfn MultiTexCoord3fARB;
-   struct dynfn MultiTexCoord3fvARB;
-   struct dynfn MultiTexCoord2fARB;
-   struct dynfn MultiTexCoord2fvARB;
-   struct dynfn MultiTexCoord1fARB;
-   struct dynfn MultiTexCoord1fvARB;
-   struct dynfn FogCoordfEXT;
-   struct dynfn FogCoordfvEXT;
-};
-
-struct dfn_generators {
-   struct dynfn *(*Vertex2f)( GLcontext *, const int * );
-   struct dynfn *(*Vertex2fv)( GLcontext *, const int * );
-   struct dynfn *(*Vertex3f)( GLcontext *, const int * );
-   struct dynfn *(*Vertex3fv)( GLcontext *, const int * );
-   struct dynfn *(*Color4ub)( GLcontext *, const int * );
-   struct dynfn *(*Color4ubv)( GLcontext *, const int * );
-   struct dynfn *(*Color3ub)( GLcontext *, const int * );
-   struct dynfn *(*Color3ubv)( GLcontext *, const int * );
-   struct dynfn *(*Color4f)( GLcontext *, const int * );
-   struct dynfn *(*Color4fv)( GLcontext *, const int * );
-   struct dynfn *(*Color3f)( GLcontext *, const int * );
-   struct dynfn *(*Color3fv)( GLcontext *, const int * );
-   struct dynfn *(*SecondaryColor3ubEXT)( GLcontext *, const int * );
-   struct dynfn *(*SecondaryColor3ubvEXT)( GLcontext *, const int * );
-   struct dynfn *(*SecondaryColor3fEXT)( GLcontext *, const int * );
-   struct dynfn *(*SecondaryColor3fvEXT)( GLcontext *, const int * );
-   struct dynfn *(*Normal3f)( GLcontext *, const int * );
-   struct dynfn *(*Normal3fv)( GLcontext *, const int * );
-   struct dynfn *(*TexCoord3f)( GLcontext *, const int * );
-   struct dynfn *(*TexCoord3fv)( GLcontext *, const int * );
-   struct dynfn *(*TexCoord2f)( GLcontext *, const int * );
-   struct dynfn *(*TexCoord2fv)( GLcontext *, const int * );
-   struct dynfn *(*TexCoord1f)( GLcontext *, const int * );
-   struct dynfn *(*TexCoord1fv)( GLcontext *, const int * );
-   struct dynfn *(*MultiTexCoord3fARB)( GLcontext *, const int * );
-   struct dynfn *(*MultiTexCoord3fvARB)( GLcontext *, const int * );
-   struct dynfn *(*MultiTexCoord2fARB)( GLcontext *, const int * );
-   struct dynfn *(*MultiTexCoord2fvARB)( GLcontext *, const int * );
-   struct dynfn *(*MultiTexCoord1fARB)( GLcontext *, const int * );
-   struct dynfn *(*MultiTexCoord1fvARB)( GLcontext *, const int * );
-   struct dynfn *(*FogCoordfEXT)( GLcontext *, const int * );
-   struct dynfn *(*FogCoordfvEXT)( GLcontext *, const int * );
-};
-
-
 
 struct r200_prim {
    GLuint start;
@@ -913,43 +822,6 @@ struct r200_prim {
 
 #define R200_MAX_VERTEX_SIZE ((3*6)+11)
 
-struct r200_vbinfo {
-   GLint counter, initial_counter;
-   GLint *dmaptr;
-   void (*notify)( void );
-   GLint vertex_size;
-
-   union { float f; int i; r200_color_t color; } vertex[R200_MAX_VERTEX_SIZE];
-
-   GLfloat *normalptr;
-   GLfloat *floatcolorptr;
-   GLfloat *fogptr;
-   r200_color_t *colorptr;
-   GLfloat *floatspecptr;
-   r200_color_t *specptr;
-   GLfloat *texcoordptr[8];    /* 6 (TMU) + 2 for r200_vtxfmt_c.c when GL_TEXTURE6/7 */
-
-
-   GLenum *prim;               /* &ctx->Driver.CurrentExecPrimitive */
-   GLuint primflags;
-   GLboolean enabled;          /* *_NO_VTXFMT / *_NO_TCL env vars */
-   GLboolean installed;
-   GLboolean fell_back;
-   GLboolean recheck;
-   GLint nrverts;
-   GLuint vtxfmt_0, vtxfmt_1;
-
-   GLuint installed_vertex_format;
-   GLuint installed_color_3f_sz;
-
-   struct r200_prim primlist[R200_MAX_PRIMS];
-   int nrprims;
-
-   struct dfn_lists dfn_cache;
-   struct dfn_generators codegen;
-   GLvertexformat vtxfmt;
-};
-
 
 struct r200_context {
    GLcontext *glCtx;                   /* Mesa context */
@@ -1021,11 +893,8 @@ struct r200_context {
    GLuint TexGenCompSel;
    GLmatrix tmpmat;
 
-   /* VBI / buffer swap
+   /* buffer swap
     */
-   GLuint vbl_seq;
-   GLuint vblank_flags;
-
    int64_t swap_ust;
    int64_t swap_missed_ust;
 
@@ -1041,10 +910,6 @@ struct r200_context {
     */
    struct r200_swtcl_info swtcl;
 
-   /* r200_vtxfmt.c
-    */
-   struct r200_vbinfo vb;
-
    /* Mirrors of some DRI state
     */
    struct r200_dri_mirror dri;
@@ -1062,7 +927,7 @@ struct r200_context {
 #define R200_CONTEXT(ctx)              ((r200ContextPtr)(ctx->DriverCtx))
 
 
-static __inline GLuint r200PackColor( GLuint cpp,
+static INLINE GLuint r200PackColor( GLuint cpp,
                                        GLubyte r, GLubyte g,
                                        GLubyte b, GLubyte a )
 {