Update DRI drivers for new glsl compiler.
authorBrian <brian@yutani.localnet.net>
Fri, 23 Feb 2007 20:40:13 +0000 (13:40 -0700)
committerBrian <brian@yutani.localnet.net>
Fri, 23 Feb 2007 20:40:13 +0000 (13:40 -0700)
Mostly:
- update #includes
- update STATE_* token code

41 files changed:
src/mesa/drivers/dri/i915/i915_context.c
src/mesa/drivers/dri/i915/i915_fragprog.c
src/mesa/drivers/dri/i915/i915_program.c
src/mesa/drivers/dri/i915/i915_state.c
src/mesa/drivers/dri/i915/i915_vtbl.c
src/mesa/drivers/dri/i915tex/i915_context.c
src/mesa/drivers/dri/i915tex/i915_fragprog.c
src/mesa/drivers/dri/i915tex/i915_program.c
src/mesa/drivers/dri/i915tex/i915_state.c
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_curbe.c
src/mesa/drivers/dri/i965/brw_eu.h
src/mesa/drivers/dri/i965/brw_metaops.c
src/mesa/drivers/dri/i965/brw_util.c
src/mesa/drivers/dri/i965/brw_vs.c
src/mesa/drivers/dri/i965/brw_vs_constval.c
src/mesa/drivers/dri/i965/brw_vs_emit.c
src/mesa/drivers/dri/i965/brw_vs_tnl.c
src/mesa/drivers/dri/i965/brw_wm.c
src/mesa/drivers/dri/i965/brw_wm.h
src/mesa/drivers/dri/i965/brw_wm_debug.c
src/mesa/drivers/dri/i965/brw_wm_emit.c
src/mesa/drivers/dri/i965/brw_wm_fp.c
src/mesa/drivers/dri/i965/brw_wm_pass0.c
src/mesa/drivers/dri/i965/brw_wm_pass1.c
src/mesa/drivers/dri/i965/brw_wm_pass2.c
src/mesa/drivers/dri/mach64/mach64_native_vb.c
src/mesa/drivers/dri/nouveau/nouveau_context.c
src/mesa/drivers/dri/nouveau/nouveau_shader.c
src/mesa/drivers/dri/nouveau/nouveau_shader_0.c
src/mesa/drivers/dri/nouveau/nouveau_shader_2.c
src/mesa/drivers/dri/r200/r200_vertprog.c
src/mesa/drivers/dri/r300/r300_context.c
src/mesa/drivers/dri/r300/r300_fragprog.c
src/mesa/drivers/dri/r300/r300_fragprog.h
src/mesa/drivers/dri/r300/r300_shader.c
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/r300_vertexprog.c
src/mesa/drivers/dri/s3v/s3v_tritmp.h
src/mesa/drivers/dri/tdfx/tdfx_tris.c
src/mesa/drivers/dri/trident/trident_context.h

index e58c9498ce049a8fbdb537a009d4f4287d73261b..4ab9d2686cbf2fd426a45289c4fec490db00c8a3 100644 (file)
@@ -167,7 +167,7 @@ GLboolean i915CreateContext( const __GLcontextModes *mesaVis,
                                                I915_MAX_TEX_INSN);
    ctx->Const.FragmentProgram.MaxNativeTexIndirections = I915_MAX_TEX_INDIRECT;
    ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
-   ctx->_MaintainTexEnvProgram = GL_TRUE;
+   ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
 
 
    driInitExtensions( ctx, i915_extensions, GL_FALSE );
index ef14f3eef7cb4449e23cafc8e6c284540d6ffe6c..a28c8bb6fc229f6a5a61ade89abf7a6e625ff461 100644 (file)
@@ -37,7 +37,8 @@
 #include "i915_context.h"
 #include "i915_program.h"
 
-#include "program_instruction.h"
+#include "prog_instruction.h"
+#include "prog_parameter.h"
 #include "program.h"
 #include "programopt.h"
 
@@ -782,9 +783,6 @@ static void fixup_depth_write( struct i915_fragment_program *p )
 }
 
 
-#define FRAG_BIT_TEX(n)  (FRAG_BIT_TEX0 << (n))
-
-
 static void check_wpos( struct i915_fragment_program *p )
 {
    GLuint inputs = p->FragProg.Base.InputsRead;
index 9c13290d118e75fc97bc3501e4776541442aabd1..68491124449ff0f0beb4facebd8e10f2f292d557 100644 (file)
@@ -430,17 +430,17 @@ void i915_fini_program( struct i915_fragment_program *p )
 
    if (p->error) {
       p->FragProg.Base.NumNativeInstructions = 0;
-      p->FragProg.NumNativeAluInstructions = 0;
-      p->FragProg.NumNativeTexInstructions = 0;
-      p->FragProg.NumNativeTexIndirections = 0;
+      p->FragProg.Base.NumNativeAluInstructions = 0;
+      p->FragProg.Base.NumNativeTexInstructions = 0;
+      p->FragProg.Base.NumNativeTexIndirections = 0;
    }
    else {
       p->FragProg.Base.NumNativeInstructions = (p->nr_alu_insn +
                                                 p->nr_tex_insn +
                                                 p->nr_decl_insn);
-      p->FragProg.NumNativeAluInstructions = p->nr_alu_insn;
-      p->FragProg.NumNativeTexInstructions = p->nr_tex_insn;
-      p->FragProg.NumNativeTexIndirections = p->nr_tex_indirect;
+      p->FragProg.Base.NumNativeAluInstructions = p->nr_alu_insn;
+      p->FragProg.Base.NumNativeTexInstructions = p->nr_tex_insn;
+      p->FragProg.Base.NumNativeTexIndirections = p->nr_tex_indirect;
    }
 
    p->declarations[0] |= program_size + decl_size - 2;
index fd11e10652e22dd8d4d4049312c4ed8b5b3ff354..56922893366fbd0d3cca8f830479819729146556 100644 (file)
@@ -531,7 +531,7 @@ void i915_update_fog( GLcontext *ctx )
    GLboolean enabled;
    GLboolean try_pixel_fog;
    
-   if (ctx->FragmentProgram._Active) {
+   if (ctx->FragmentProgram._Enabled) {
       /* Pull in static fog state from program */
       
       mode = ctx->FragmentProgram._Current->FogOption;
index 7924754c82ce295b9ab1e9a0cd7dd8a4772d60e1..82a421b961c65ed6c9b63996a1c5ef908342976d 100644 (file)
@@ -49,7 +49,7 @@ static void i915_render_start( intelContextPtr intel )
    if (ctx->FragmentProgram._Current) 
       i915ValidateFragmentProgram( i915 );
    else {
-      assert(!ctx->_MaintainTexEnvProgram);
+      assert(!ctx->FragmentProgram._MaintainTexEnvProgram);
       i915ValidateTextureProgram( i915 );
    }
 }
index 9b4d72eab3ec5221aaa29f968382a2c8ed22998b..d4187238f3ce48722b30689d505b0fa7fb057c21 100644 (file)
@@ -157,8 +157,8 @@ i915CreateContext(const __GLcontextModes * mesaVis,
       I915_MAX_TEX_INDIRECT;
    ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
 
-   ctx->_MaintainTexEnvProgram = 1;
-   ctx->_UseTexEnvProgram = 1;
+   ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
+   /*ctx->_UseTexEnvProgram = 1;*/
 
    driInitExtensions(ctx, i915_extensions, GL_FALSE);
 
index 8772e702307fe5c491504b02a7dce6cf27afce4f..cbea6092a8146996c80f9c851ff49d703e86877e 100644 (file)
@@ -37,7 +37,8 @@
 #include "i915_context.h"
 #include "i915_program.h"
 
-#include "program_instruction.h"
+#include "prog_instruction.h"
+#include "prog_parameter.h"
 #include "program.h"
 #include "programopt.h"
 
@@ -772,9 +773,6 @@ fixup_depth_write(struct i915_fragment_program *p)
 }
 
 
-#define FRAG_BIT_TEX(n)  (FRAG_BIT_TEX0 << (n))
-
-
 static void
 check_wpos(struct i915_fragment_program *p)
 {
index 0be89d332061b685dd62947725571d1459bde820..ed45e4f8069806581497fb88d9c416d67d0fd0a9 100644 (file)
@@ -446,17 +446,17 @@ i915_fini_program(struct i915_fragment_program *p)
 
    if (p->error) {
       p->FragProg.Base.NumNativeInstructions = 0;
-      p->FragProg.NumNativeAluInstructions = 0;
-      p->FragProg.NumNativeTexInstructions = 0;
-      p->FragProg.NumNativeTexIndirections = 0;
+      p->FragProg.Base.NumNativeAluInstructions = 0;
+      p->FragProg.Base.NumNativeTexInstructions = 0;
+      p->FragProg.Base.NumNativeTexIndirections = 0;
    }
    else {
       p->FragProg.Base.NumNativeInstructions = (p->nr_alu_insn +
                                                 p->nr_tex_insn +
                                                 p->nr_decl_insn);
-      p->FragProg.NumNativeAluInstructions = p->nr_alu_insn;
-      p->FragProg.NumNativeTexInstructions = p->nr_tex_insn;
-      p->FragProg.NumNativeTexIndirections = p->nr_tex_indirect;
+      p->FragProg.Base.NumNativeAluInstructions = p->nr_alu_insn;
+      p->FragProg.Base.NumNativeTexInstructions = p->nr_tex_insn;
+      p->FragProg.Base.NumNativeTexIndirections = p->nr_tex_indirect;
    }
 
    p->declarations[0] |= program_size + decl_size - 2;
index 78ae4bdb5fcd2dcadea80b19dfe8055ea7f70e5d..4816afc9343bbb54c1cb4ae7cd36f2c84f165f44 100644 (file)
@@ -561,7 +561,7 @@ i915_update_fog(GLcontext * ctx)
    GLboolean enabled;
    GLboolean try_pixel_fog;
 
-   if (ctx->FragmentProgram._Active) {
+   if (ctx->FragmentProgram._Enabled) {
       /* Pull in static fog state from program */
 
       mode = ctx->FragmentProgram._Current->FogOption;
index 6faee65542b683ad69cf235f953b119e70172d22..397a9bd3f5cd2c36abf60d26929d566117533783 100644 (file)
@@ -148,7 +148,7 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
 
    brw->emit_state_always = 0;
 
-   ctx->_MaintainTexEnvProgram = 1;
+   ctx->FragmentProgram._MaintainTexEnvProgram = 1;
 
    brw_draw_init( brw );
 
index 4352c3bcb0f5f1029523af6ab3461250df2e181a..3f0aaa1f86dd67268e68fb9d0abb1ff2cc39911a 100644 (file)
@@ -35,7 +35,8 @@
 #include "context.h"
 #include "macros.h"
 #include "enums.h"
-#include "shader/program.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_statevars.h"
 #include "intel_batchbuffer.h"
 #include "brw_context.h"
 #include "brw_defines.h"
index d4dbcf38a7a9c652ddf66d147ed081a6abf993b7..52f89d577ca857a631c6c9e6d7fa8e19543f017f 100644 (file)
@@ -35,7 +35,7 @@
 
 #include "brw_structs.h"
 #include "brw_defines.h"
-#include "shader/program.h"
+#include "shader/prog_instruction.h"
 
 #define BRW_SWIZZLE4(a,b,c,d) (((a)<<0) | ((b)<<2) | ((c)<<4) | ((d)<<6))
 #define BRW_GET_SWZ(swz, idx) (((swz) >> ((idx)*2)) & 0x3)
index 1579762b6d1ed6963777b519197720d8d6e413a8..6e030f191efeb12bc98a905d557cc890c92f1647 100644 (file)
@@ -35,8 +35,6 @@
 #include "glheader.h"
 #include "context.h"
 #include "macros.h"
-#include "enums.h"
-#include "dd.h"
 
 #include "shader/arbprogparse.h"
 
index 9d12c26486d4595e18b5b4ad70561c5efaf040db..b6deee2376955b257f8fbb664190da3d798f1fef 100644 (file)
@@ -30,9 +30,9 @@
   */
          
 
-#include "brw_util.h"
 #include "mtypes.h"
-#include "shader/program.h"
+#include "shader/prog_parameter.h"
+#include "brw_util.h"
 #include "brw_defines.h"
 
 GLuint brw_count_bits( GLuint val )
@@ -45,7 +45,7 @@ GLuint brw_count_bits( GLuint val )
 }
 
 
-static GLuint brw_parameter_state_flags(const enum state_index state[])
+static GLuint brw_parameter_state_flags(const gl_state_index state[])
 {
    switch (state[0]) {
    case STATE_MATERIAL:
@@ -70,22 +70,16 @@ static GLuint brw_parameter_state_flags(const enum state_index state[])
    case STATE_POINT_ATTENUATION:
       return _NEW_POINT;
 
-   case STATE_MATRIX:
-      switch (state[1]) {
-      case STATE_MODELVIEW:
-        return _NEW_MODELVIEW;
-      case STATE_PROJECTION:
-        return _NEW_PROJECTION;
-      case STATE_MVP:
-        return _NEW_MODELVIEW | _NEW_PROJECTION;
-      case STATE_TEXTURE:
-        return _NEW_TEXTURE_MATRIX;
-      case STATE_PROGRAM:
-        return _NEW_TRACK_MATRIX;
-      default:
-        assert(0);
-        return 0;
-      }
+   case STATE_MODELVIEW_MATRIX:
+      return _NEW_MODELVIEW;
+   case STATE_PROJECTION_MATRIX:
+      return _NEW_PROJECTION;
+   case STATE_MVP_MATRIX:
+      return _NEW_MODELVIEW | _NEW_PROJECTION;
+   case STATE_TEXTURE_MATRIX:
+      return _NEW_TEXTURE_MATRIX;
+   case STATE_PROGRAM_MATRIX:
+      return _NEW_TRACK_MATRIX;
 
    case STATE_DEPTH_RANGE:
       return _NEW_VIEWPORT;
index 74c9d88e4649457107538b03f57e7064898d51c7..e173f6fce3e8b6ec0c2abb3c7d5b8ab387ba1f58 100644 (file)
@@ -34,8 +34,7 @@
 #include "brw_vs.h"
 #include "brw_util.h"
 #include "brw_state.h"
-#include "program.h"
-#include "shader/arbprogparse.h"
+#include "shader/prog_print.h"
 
 
 
index 528e164db8c6f5df51eb49f8ff31a6e51b032645..caef042f1cdd774c7fc9bdd9f202ba3702e957ee 100644 (file)
   */
             
 
-#include "brw_context.h"
-#include "program.h"
-#include "program_instruction.h"
 #include "macros.h"
+#include "brw_context.h"
 #include "brw_vs.h"
 
 /* Component is active if it may diverge from [0,0,0,1].  Undef values
index ffdb843e85fe54e7fd04d0d0bc2b672d1a228b67..6eb11b19ad2f4f9c4069b9ee00045b06fbdd64f0 100644 (file)
   */
             
 
-#include "brw_context.h"
 #include "program.h"
-#include "program_instruction.h"
 #include "macros.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_print.h"
+#include "brw_context.h"
 #include "brw_vs.h"
 
 
index 0d61092247ab0b61ef992a8f7de6c85a421c40bf..21e961ce9cdcdd4d5a1c914fa74aa7d813b7a79b 100644 (file)
 #include "glheader.h"
 #include "macros.h"
 #include "enums.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_print.h"
 #include "brw_vs.h"
 #include "brw_state.h"
 
-#include "shader/program.h"
-#include "shader/program_instruction.h"
-#include "shader/arbprogparse.h"
 
 struct state_key {
    unsigned light_global_enabled:1;
@@ -398,11 +397,14 @@ static struct ureg register_const4f( struct tnl_program *p,
 {
    GLfloat values[4];
    GLint idx;
+   GLuint swizzle;
    values[0] = s0;
    values[1] = s1;
    values[2] = s2;
    values[3] = s3;
-   idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4 );
+   idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4,
+                                     &swizzle);
+   /* XXX what about swizzle? */
    return make_ureg(PROGRAM_STATE_VAR, idx);
 }
 
@@ -424,40 +426,37 @@ static struct ureg get_identity_param( struct tnl_program *p )
    return p->identity;
 }
 
-static struct ureg register_param6( struct tnl_program *p, 
-                                  GLint s0,
-                                  GLint s1,
-                                  GLint s2,
-                                  GLint s3,
-                                  GLint s4,
-                                  GLint s5)
+static struct ureg register_param5( struct tnl_program *p, 
+                                    GLint s0,
+                                    GLint s1,
+                                    GLint s2,
+                                    GLint s3,
+                                    GLint s4)
 {
-   GLint tokens[6];
+   gl_state_index tokens[STATE_LENGTH];
    GLint idx;
    tokens[0] = s0;
    tokens[1] = s1;
    tokens[2] = s2;
    tokens[3] = s3;
    tokens[4] = s4;
-   tokens[5] = s5;
    idx = _mesa_add_state_reference( p->program->Base.Parameters, tokens );
    return make_ureg(PROGRAM_STATE_VAR, idx);
 }
 
 
-#define register_param1(p,s0)          register_param6(p,s0,0,0,0,0,0)
-#define register_param2(p,s0,s1)       register_param6(p,s0,s1,0,0,0,0)
-#define register_param3(p,s0,s1,s2)    register_param6(p,s0,s1,s2,0,0,0)
-#define register_param4(p,s0,s1,s2,s3) register_param6(p,s0,s1,s2,s3,0,0)
+#define register_param1(p,s0)          register_param5(p,s0,0,0,0,0)
+#define register_param2(p,s0,s1)       register_param5(p,s0,s1,0,0,0)
+#define register_param3(p,s0,s1,s2)    register_param5(p,s0,s1,s2,0,0)
+#define register_param4(p,s0,s1,s2,s3) register_param5(p,s0,s1,s2,s3,0)
 
 
-static void register_matrix_param6( struct tnl_program *p,
-                                   GLint s0,
-                                   GLint s1,
-                                   GLint s2,
-                                   GLint s3,
-                                   GLint s4,
-                                   GLint s5,
+static void register_matrix_param5( struct tnl_program *p,
+                                   GLint s0, /* matrix name */
+                                   GLint s1, /* texture matrix number */
+                                   GLint s2, /* first row */
+                                   GLint s3, /* last row */
+                                   GLint s4, /* modifier */
                                    struct ureg *matrix )
 {
    GLint i;
@@ -465,8 +464,8 @@ static void register_matrix_param6( struct tnl_program *p,
    /* This is a bit sad as the support is there to pull the whole
     * matrix out in one go:
     */
-   for (i = 0; i <= s4 - s3; i++) 
-      matrix[i] = register_param6( p, s0, s1, s2, i, i, s5 );
+   for (i = 0; i <= s3 - s2; i++) 
+      matrix[i] = register_param5( p, s0, s1, i, i, s4 );
 }
 
 
@@ -650,13 +649,13 @@ static struct ureg get_eye_position( struct tnl_program *p )
       p->eye_position = reserve_temp(p);
 
       if (PREFER_DP4) {
-        register_matrix_param6( p, STATE_MATRIX, STATE_MODELVIEW, 0, 0, 3, 
-                                STATE_MATRIX, modelview );
+        register_matrix_param5( p, STATE_MODELVIEW_MATRIX, 0, 0, 3, 
+                                0, modelview );
 
         emit_matrix_transform_vec4(p, p->eye_position, modelview, pos);
       }
       else {
-        register_matrix_param6( p, STATE_MATRIX, STATE_MODELVIEW, 0, 0, 3, 
+        register_matrix_param5( p, STATE_MODELVIEW_MATRIX, 0, 0, 3, 
                                 STATE_MATRIX_TRANSPOSE, modelview );
 
         emit_transpose_matrix_transform_vec4(p, p->eye_position, modelview, pos);
@@ -710,7 +709,7 @@ static struct ureg get_eye_normal( struct tnl_program *p )
       struct ureg normal = register_input(p, VERT_ATTRIB_NORMAL );
       struct ureg mvinv[3];
 
-      register_matrix_param6( p, STATE_MATRIX, STATE_MODELVIEW, 0, 0, 2,
+      register_matrix_param5( p, STATE_MODELVIEW_MATRIX, 0, 0, 2,
                              STATE_MATRIX_INVTRANS, mvinv );
 
       p->eye_normal = reserve_temp(p);
@@ -745,12 +744,12 @@ static void build_hpos( struct tnl_program *p )
    struct ureg mvp[4];
 
    if (PREFER_DP4) {
-      register_matrix_param6( p, STATE_MATRIX, STATE_MVP, 0, 0, 3, 
-                             STATE_MATRIX, mvp );
+      register_matrix_param5( p, STATE_MVP_MATRIX, 0, 0, 3, 
+                             0, mvp );
       emit_matrix_transform_vec4( p, hpos, mvp, pos );
    }
    else {
-      register_matrix_param6( p, STATE_MATRIX, STATE_MVP, 0, 0, 3, 
+      register_matrix_param5( p, STATE_MVP_MATRIX, 0, 0, 3, 
                              STATE_MATRIX_TRANSPOSE, mvp );
       emit_transpose_matrix_transform_vec4( p, hpos, mvp, pos );
    }
@@ -988,7 +987,7 @@ static void build_lighting( struct tnl_program *p )
             */
            VPpli = register_param3(p, STATE_LIGHT, i, 
                                    STATE_POSITION_NORMALIZED); 
-           half = register_param3(p, STATE_LIGHT, i, STATE_HALF);
+           half = register_param3(p, STATE_LIGHT, i, STATE_HALF_VECTOR);
         } 
         else {
            struct ureg Ppli = register_param3(p, STATE_LIGHT, i, 
@@ -1356,13 +1355,13 @@ static void build_texture_transform( struct tnl_program *p )
                              out_texgen : 
                              register_input(p, VERT_ATTRIB_TEX0+i));
            if (PREFER_DP4) {
-              register_matrix_param6( p, STATE_MATRIX, STATE_TEXTURE, i, 
-                                      0, 3, STATE_MATRIX, texmat );
+              register_matrix_param5( p, STATE_TEXTURE_MATRIX, i, 0, 3,
+                                      0, texmat );
               emit_matrix_transform_vec4( p, out, texmat, in );
            }
            else {
-              register_matrix_param6( p, STATE_MATRIX, STATE_TEXTURE, i, 
-                                      0, 3, STATE_MATRIX_TRANSPOSE, texmat );
+              register_matrix_param5( p, STATE_TEXTURE_MATRIX, i, 0, 3,
+                                      STATE_MATRIX_TRANSPOSE, texmat );
               emit_transpose_matrix_transform_vec4( p, out, texmat, in );
            }
         }
index 0f842d289d7e9612d62f510d1e09c573cb456edf..1497dc79687d0683e056b178a20111be996954c4 100644 (file)
 #include "brw_state.h"
 #include "brw_hal.h"
 
-#include "program.h"
-#include "program_instruction.h"
-#include "arbprogparse.h"
-
 
 GLuint brw_wm_nr_args( GLuint opcode )
 {
index ec6ad6105ca440b12483219558176f0af3c33971..f5fddfdb68a7c9dd5a8170d48c7b8f3c6df8cf19 100644 (file)
@@ -36,7 +36,7 @@
 
 #include "brw_context.h"
 #include "brw_eu.h"
-#include "program_instruction.h"
+#include "prog_instruction.h"
 
 /* A big lookup table is used to figure out which and how many
  * additional regs will inserted before the main payload in the WM
index 9a6154b33368d2584d92fb8999f381d95effb9fc..f31d0974ecf32318f2c8446da9e87896fd142f88 100644 (file)
@@ -32,9 +32,6 @@
 
 #include "brw_context.h"
 #include "brw_wm.h"
-#include "program.h"
-#include "shader/arbprogparse.h"
-#include "shader/program_instruction.h"
 
 
 void brw_wm_print_value( struct brw_wm_compile *c,
index d96a9b717c01877af8bf42815866da517d816ad4..fd605159727822c055e0f736ad1ffa0904654ecf 100644 (file)
   */
                
 
-#include "brw_context.h"
-#include "program.h"
-#include "program_instruction.h"
 #include "macros.h"
+#include "brw_context.h"
 #include "brw_wm.h"
 
 #define SATURATE (1<<5)
index bb0aa3561507e73dd64c99b1e2b3852dc72377ee..47ddcd0f05e2cd292ae7c274c8a313e3d59dd11f 100644 (file)
 #include "brw_wm.h"
 #include "brw_util.h"
 
-#include "shader/program.h"
-#include "shader/program_instruction.h"
-#include "shader/arbprogparse.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_print.h"
+#include "shader/prog_statevars.h"
+
 
 #define FIRST_INTERNAL_TEMP MAX_NV_FRAGMENT_PROGRAM_TEMPS
 
@@ -370,23 +371,21 @@ static void emit_interp( struct brw_wm_compile *c,
  * harm and it's not as if the parameter handling isn't a big hack
  * anyway.
  */
-static struct prog_src_register search_or_add_param6( struct brw_wm_compile *c, 
-                                            GLint s0,
-                                            GLint s1,
-                                            GLint s2,
-                                            GLint s3,
-                                            GLint s4,
-                                            GLint s5)
+static struct prog_src_register search_or_add_param5(struct brw_wm_compile *c, 
+                                                     GLint s0,
+                                                     GLint s1,
+                                                     GLint s2,
+                                                     GLint s3,
+                                                     GLint s4)
 {
    struct gl_program_parameter_list *paramList = c->fp->program.Base.Parameters;
-   GLint tokens[6];
+   gl_state_index tokens[STATE_LENGTH];
    GLuint idx;
    tokens[0] = s0;
    tokens[1] = s1;
    tokens[2] = s2;
    tokens[3] = s3;
    tokens[4] = s4;
-   tokens[5] = s5;
    
    for (idx = 0; idx < paramList->NumParameters; idx++) {
       if (paramList->Parameters[idx].Type == PROGRAM_STATE_VAR &&
@@ -413,6 +412,7 @@ static struct prog_src_register search_or_add_const4f( struct brw_wm_compile *c,
    struct gl_program_parameter_list *paramList = c->fp->program.Base.Parameters;
    GLfloat values[4];
    GLuint idx;
+   GLuint swizzle;
 
    values[0] = s0;
    values[1] = s1;
@@ -432,8 +432,8 @@ static struct prog_src_register search_or_add_const4f( struct brw_wm_compile *c,
         return src_reg(PROGRAM_STATE_VAR, idx);
    }
    
-   idx = _mesa_add_unnamed_constant( paramList, values, 4 );
-
+   idx = _mesa_add_unnamed_constant( paramList, values, 4, &swizzle );
+   /* XXX what about swizzle? */
    return src_reg(PROGRAM_STATE_VAR, idx);
 }
 
@@ -527,11 +527,11 @@ static void precalc_tex( struct brw_wm_compile *c,
 
    if (inst->TexSrcTarget == TEXTURE_RECT_INDEX) {
       struct prog_src_register scale = 
-        search_or_add_param6( c, 
+        search_or_add_param5( c, 
                               STATE_INTERNAL, 
                               STATE_TEXRECT_SCALE,
                               inst->TexSrcUnit,
-                              0,0,0 );
+                              0,0 );
 
       tmpcoord = get_temp(c);
 
@@ -724,7 +724,7 @@ static void fog_blend( struct brw_wm_compile *c,
                             struct prog_src_register fog_factor )
 {
    struct prog_dst_register outcolor = dst_reg(PROGRAM_OUTPUT, FRAG_RESULT_COLR);
-   struct prog_src_register fogcolor = search_or_add_param6( c, STATE_FOG_COLOR, 0,0,0,0,0 );
+   struct prog_src_register fogcolor = search_or_add_param5( c, STATE_FOG_COLOR, 0,0,0,0 );
 
    /* color.xyz = LRP fog_factor.xxxx, output_color, fog_color */
    
index 36b69b706818e99784ad77fb3af36918e218e978..00f6f6b9a4f778bb5549c1da75e5d50f9d2eed88 100644 (file)
@@ -32,9 +32,7 @@
 
 #include "brw_context.h"
 #include "brw_wm.h"
-#include "program.h"
-#include "arbprogparse.h"
-#include "program_instruction.h"
+#include "shader/prog_parameter.h"
 
 
 
index 21d0881d57e9a11f0584ffc14bb0895f4a0acf37..d668def7007ea9aabec22664f2abdf0783211244 100644 (file)
@@ -32,9 +32,6 @@
 
 #include "brw_context.h"
 #include "brw_wm.h"
-#include "program.h"
-#include "arbprogparse.h"
-#include "program_instruction.h"
 
 
 static GLuint get_tracked_mask(struct brw_wm_compile *c,
index cb8d51fb5cf3a3dd2c22ebc119261c524ba85ea8..a1edbd6168d7bafa3fe621822b6c77305e3e2584 100644 (file)
@@ -32,9 +32,7 @@
 
 #include "brw_context.h"
 #include "brw_wm.h"
-#include "program.h"
-#include "arbprogparse.h"
-#include "program_instruction.h"
+
 
 /* Use these to force spilling so that that functionality can be
  * tested with known-good examples rather than having to construct new
index 7872c206f58ccd5a335697e66c8af1fb8052eff7..519ec81e548a213481c9488536c291e85b696233 100644 (file)
@@ -52,14 +52,14 @@ void TAG(translate_vertex)(GLcontext *ctx,
         {
            float rhw = 1.0 / LE32_IN_FLOAT( p + 2 );
            
-           dst->texcoord[1][0] = rhw*LE32_IN_FLOAT( p++ );
-           dst->texcoord[1][1] = rhw*LE32_IN_FLOAT( p++ );
+           dst->attrib[FRAG_ATTRIB_TEX1][0] = rhw*LE32_IN_FLOAT( p++ );
+           dst->attrib[FRAG_ATTRIB_TEX1][1] = rhw*LE32_IN_FLOAT( p++ );
         }
 #else
-        dst->texcoord[1][0] = LE32_IN_FLOAT( p++ );
-        dst->texcoord[1][1] = LE32_IN_FLOAT( p++ );
+        dst->attrib[FRAG_ATTRIB_TEX1][0] = LE32_IN_FLOAT( p++ );
+        dst->attrib[FRAG_ATTRIB_TEX1][1] = LE32_IN_FLOAT( p++ );
 #endif
-        dst->texcoord[1][3] = 1.0;
+        dst->attrib[FRAG_ATTRIB_TEX1][3] = 1.0;
         p++;
 
       case TEX0_VERTEX_FORMAT:
@@ -67,14 +67,14 @@ void TAG(translate_vertex)(GLcontext *ctx,
         {
            float rhw = 1.0 / LE32_IN_FLOAT( p + 2 );
            
-           dst->texcoord[0][0] = rhw*LE32_IN_FLOAT( p++ );
-           dst->texcoord[0][1] = rhw*LE32_IN_FLOAT( p++ );
+           dst->attrib[FRAG_ATTRIB_TEX0][0] = rhw*LE32_IN_FLOAT( p++ );
+           dst->attrib[FRAG_ATTRIB_TEX0][1] = rhw*LE32_IN_FLOAT( p++ );
         }
 #else
-        dst->texcoord[0][0] = LE32_IN_FLOAT( p++ );
-        dst->texcoord[0][1] = LE32_IN_FLOAT( p++ );
+        dst->attrib[FRAG_ATTRIB_TEX0][0] = LE32_IN_FLOAT( p++ );
+        dst->attrib[FRAG_ATTRIB_TEX0][1] = LE32_IN_FLOAT( p++ );
 #endif
-        dst->texcoord[0][3] = 1.0;
+        dst->attrib[FRAG_ATTRIB_TEX0][3] = 1.0;
         dst->win[3] = LE32_IN_FLOAT( p++ );
        
       case NOTEX_VERTEX_FORMAT:
index f811dc1b72e4a15bf7dcc4b67c15f828fefa4914..6f1b57d74edffa30c5e7ec8a66b649f946a4bf26 100644 (file)
@@ -195,7 +195,7 @@ GLboolean nouveauCreateContext( const __GLcontextModes *glVisual,
        nouveauShaderInitFuncs(ctx);
        /* Install Mesa's fixed-function texenv shader support */
        if (nmesa->screen->card->type >= NV_40)
-               ctx->_MaintainTexEnvProgram = GL_TRUE;
+               ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
 
        /* Initialize the swrast */
        _swrast_CreateContext( ctx );
index ba471325aaa1efadf5f01612ea79a7f3e16f3e24..bee8d5a935440cefed58d2263322c78f7cc5bb51 100644 (file)
 #include "enums.h"
 #include "extensions.h"
 
-#include "program.h"
+#include "shader/program.h"
+#include "shader/prog_instruction.h"
+/*#include "shader/arbprogparse.h"*/
 #include "tnl/tnl.h"
-#include "shader/arbprogparse.h"
 
 #include "nouveau_context.h"
 #include "nouveau_shader.h"
index 73c1f7c2a538b393e98796bcce4c7a97ec5347f7..abba59dc0c26984229f26f73ba47bafea4ff0506 100644 (file)
 #include "macros.h"
 #include "enums.h"
 
-#include "program.h"
-#include "programopt.h"
-#include "program_instruction.h"
+#include "shader/prog_instruction.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_statevars.h"
+#include "shader/programopt.h"
 
 #include "nouveau_context.h"
 #include "nouveau_shader.h"
@@ -411,8 +412,10 @@ pass0_fixup_swizzle(nvsPtr nvs, nvsFragmentHeader *parent, int fpos,
 
        if (!rec->swzconst_done) {
                struct gl_program *prog = &nvs->mesa.vp.Base;
+                GLuint swizzle;
                rec->swzconst_id = _mesa_add_unnamed_constant(prog->Parameters,
-                                                             sc, 4);
+                                                             sc, 4, &swizzle);
+                /* XXX what about swizzle? */
                rec->swzconst_done = 1;
                COPY_4V(nvs->params[rec->swzconst_id].val, sc);
        }
@@ -818,7 +821,8 @@ pass0_vp_insert_ff_clip_planes(GLcontext *ctx, nouveauShader *nvs)
        nvsInstruction *nvsinst;
        GLuint fpos = 0;
        nvsRegister opos, epos, eqn, mv[4];
-       GLint tokens[6] = { STATE_MATRIX, STATE_MODELVIEW, 0, 0, 0, 0 };
+       gl_state_index tokens[STATE_LENGTH]
+           = { STATE_MODELVIEW_MATRIX, 0, 0, 0, 0 };
        GLint id;
        int i;
 
@@ -826,7 +830,7 @@ pass0_vp_insert_ff_clip_planes(GLcontext *ctx, nouveauShader *nvs)
        pass0_make_reg(nvs, &opos, NVS_FILE_ATTRIB, NVS_FR_POSITION);
        pass0_make_reg(nvs, &epos, NVS_FILE_TEMP  , -1);
        for (i=0; i<4; i++) {
-               tokens[3] = tokens[4] = i;
+               tokens[2] = tokens[3] = i;
                id = _mesa_add_state_reference(prog->Parameters, tokens);
                pass0_make_reg(nvs, &mv[i], NVS_FILE_CONST, id);
        }
index b043f877e420b5e52f91afd98d5bbba2d3303eee..6eb9de477699b5561fb0d6e393e96645dd2f98a1 100644 (file)
@@ -34,7 +34,8 @@
 #include "macros.h"
 #include "enums.h"
 
-#include "program.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_print.h"
 
 #include "nouveau_context.h"
 #include "nouveau_shader.h"
index 4960d481d5da337006c344457fb6135f981513ca..6089d617c6b68cca15fa91487d740962a670a7d4 100644 (file)
@@ -34,14 +34,16 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "macros.h"
 #include "enums.h"
 #include "program.h"
+#include "shader/prog_instruction.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_statevars.h"
+#include "shader/programopt.h"
+#include "tnl/tnl.h"
 
 #include "r200_context.h"
 #include "r200_vertprog.h"
 #include "r200_ioctl.h"
 #include "r200_tcl.h"
-#include "program_instruction.h"
-#include "programopt.h"
-#include "tnl/tnl.h"
 
 #if SWIZZLE_X != VSF_IN_COMPONENT_X || \
     SWIZZLE_Y != VSF_IN_COMPONENT_Y || \
@@ -462,7 +464,7 @@ static GLboolean r200_translate_vertex_program(GLcontext *ctx, struct r200_verte
       base e isn't directly available neither. */
    if ((mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_FOGC)) && !vp->fogpidx) {
       struct gl_program_parameter_list *paramList;
-      GLint tokens[6] = { STATE_FOG_PARAMS, 0, 0, 0, 0, 0 };
+      gl_state_index tokens[STATE_LENGTH] = { STATE_FOG_PARAMS, 0, 0, 0, 0 };
       paramList = mesa_vp->Base.Parameters;
       vp->fogpidx = _mesa_add_state_reference(paramList, tokens);
    }
index d10a9d87d3115bb4c1e48f0e1b5ca823d8170838..8aaf50b6d81783a0bca051871139119b7453a719 100644 (file)
@@ -334,7 +334,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
        ctx->Const.FragmentProgram.MaxNativeTexIndirections = PFS_MAX_TEX_INDIRECT;
        ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* and these are?? */
        _tnl_ProgramCacheInit(ctx);
-       ctx->_MaintainTexEnvProgram = GL_TRUE;
+       ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
 
        driInitExtensions(ctx, card_extensions, GL_TRUE);
        
index 8e45bd54030762af28c48a421c0eb68da718576a..9330ec5b95d01523ba98f5bb77a8561fcc8582da 100644 (file)
 #include "glheader.h"
 #include "macros.h"
 #include "enums.h"
+#include "shader/prog_instruction.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_print.h"
 
-#include "program.h"
-#include "program_instruction.h"
 #include "r300_context.h"
 #include "r300_fragprog.h"
 #include "r300_reg.h"
index 73986abc3cc611f099d7bb7b10816c9771c4fec8..d883aee2d72d629ba5632df9401a5489a84999fc 100644 (file)
 #include "glheader.h"
 #include "macros.h"
 #include "enums.h"
+#include "shader/program.h"
+#include "shader/prog_instruction.h"
 
-#include "program.h"
 #include "r300_context.h"
-#include "program_instruction.h"
+
 
 #if 0
 /* representation of a register for emit_arith/swizzle */
index 26721e8dfda6cce0cc396682c3f2e0c681b3ba3c..e8bce93458fe8aa5707219aea9e16263bdf5404e 100644 (file)
 static void
 r300BindProgram(GLcontext *ctx, GLenum target, struct gl_program *prog)
 {
-       
-       r300ContextPtr rmesa = R300_CONTEXT(ctx);
-       struct r300_vertex_program_cont *vp=(void *)prog;
-       
-       
        switch(target){
                case GL_VERTEX_PROGRAM_ARB:
                //rmesa->curr_vp = (struct gl_vertex_program *)vp;
index 906dfceb482e4867a5ebf307fbf8f96781ee14e8..62bbc965441f8cb412afd6ef6446a11268d9958e 100644 (file)
@@ -46,6 +46,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "api_arrayelt.h"
 #include "swrast/swrast.h"
 #include "swrast_setup/swrast_setup.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_statevars.h"
 #include "vbo/vbo.h"
 #include "tnl/tnl.h"
 #include "texformat.h"
@@ -1055,8 +1057,10 @@ r300UpdateDrawBuffer(GLcontext *ctx)
 #endif
 }
 
-static void r300FetchStateParameter(GLcontext *ctx, const enum state_index state[],
-                  GLfloat *value)
+static void
+r300FetchStateParameter(GLcontext *ctx,
+                        const gl_state_index state[STATE_LENGTH],
+                        GLfloat *value)
 {
     r300ContextPtr r300 = R300_CONTEXT(ctx);
 
index 2ff92e13289060c979fb23990e5ae14be962f218..cc8e0775f80ba0d0914da8e3c83ff0f83dc18014 100644 (file)
@@ -33,11 +33,13 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "macros.h"
 #include "enums.h"
 #include "program.h"
-#include "nvvertexec.h"
+#include "shader/prog_instruction.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_statevars.h"
+#include "tnl/tnl.h"
 
 #include "r300_context.h"
 #include "r300_program.h"
-#include "program_instruction.h"
 
 #if SWIZZLE_X != VSF_IN_COMPONENT_X || \
     SWIZZLE_Y != VSF_IN_COMPONENT_Y || \
@@ -103,7 +105,7 @@ int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program_cont *
         struct gl_program_parameter_list *paramList;
        
        if (mesa_vp->IsNVProgram) {
-               _mesa_init_vp_per_primitive_registers(ctx);
+               _mesa_load_tracked_matrices(ctx);
                
                for (pi=0; pi < MAX_NV_VERTEX_PROGRAM_PARAMS; pi++) {
                        *dst++=ctx->VertexProgram.Parameters[pi][0];
@@ -880,7 +882,7 @@ static void position_invariant(struct gl_program *prog)
        struct gl_program_parameter_list *paramList;
        int i;
 
-       GLint tokens[6] = { STATE_MATRIX, STATE_MVP, 0, 0, 0, STATE_MATRIX };
+       gl_state_index tokens[STATE_LENGTH] = { STATE_MVP_MATRIX, 0, 0, 0, 0 };
 
 #ifdef PREFER_DP4
        tokens[5] = STATE_MATRIX;
@@ -963,7 +965,8 @@ static void insert_wpos(struct r300_vertex_program *vp,
                       GLuint temp_index)
 {
 
-       GLint tokens[6] = { STATE_INTERNAL, STATE_R300_WINDOW_DIMENSION, 0, 0, 0, 0 };
+        gl_state_index tokens[STATE_LENGTH]
+           = { STATE_INTERNAL, STATE_R300_WINDOW_DIMENSION, 0, 0, 0 };
        struct prog_instruction *vpi;
        struct prog_instruction *vpi_insert;
        GLuint window_index;
index 16318f4c4022ed4a0b80648aa4c0d5ed54adcb05..696fc02250f7b10b228ec888423ff060ccbb54bf 100644 (file)
@@ -407,17 +407,17 @@ do { \
                 ctx->Texture.Unit[0]._Current->DriverData); \
         deltwx = deltwy = wstart = deltdx = deltdy = dstart = 0; \
 \
-        u0 = (v[idx[0]].texcoord[0][0] \
+        u0 = (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][0] \
                 * (GLfloat)(t->image[0].image->Width) * 256.0); \
-        u1 = (v[idx[1]].texcoord[0][0] \
+        u1 = (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][0] \
                 * (GLfloat)(t->globj->Image[0][0]->Width) * 256.0); \
-        u2 = (v[idx[2]].texcoord[0][0] \
+        u2 = (v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0] \
                 * (GLfloat)(t->globj->Image[0][0]->Width) * 256.0); \
-        v0 = (v[idx[0]].texcoord[0][1] \
+        v0 = (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][1] \
                 * (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \
-        v1 = (v[idx[1]].texcoord[0][1] \
+        v1 = (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][1] \
                 * (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \
-        v2 = (v[idx[2]].texcoord[0][1] \
+        v2 = (v[idx[2]].attrib[FRAG_ATTRIB_TEX0][1] \
                 * (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \
 \
         w0 = (v[idx[0]].win[3]); \
@@ -485,23 +485,23 @@ do { \
         GLfloat sxy, suv; \
         int lev; \
 \
-        suv = (v[idx[0]].texcoord[0][0] - \
-                v[idx[2]].texcoord[0][0]) * \
-                (v[idx[1]].texcoord[0][1] - \
-                v[idx[2]].texcoord[0][1]) - \
-                (v[idx[1]].texcoord[0][0] - \
-                v[idx[2]].texcoord[0][0]) * \
-                (v[idx[0]].texcoord[0][1] - \
-                v[idx[2]].texcoord[0][2]); \
-\
-        sxy = (v[idx[0]].texcoord[0][0] - \
-                v[idx[2]].texcoord[0][0]) * \
-                (v[idx[1]].texcoord[0][1] - \
-                v[idx[2]].texcoord[0][1]) - \
-                (v[idx[1]].texcoord[0][0] - \
-                v[idx[2]].texcoord[0][0]) * \
-                (v[idx[0]].texcoord[0][1] - \
-                v[idx[2]].texcoord[0][2]); \
+        suv = (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][0] - \
+                v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0]) * \
+                (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][1] - \
+                v[idx[2]].attrib[FRAG_ATTRIB_TEX0][1]) - \
+                (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][0] - \
+                v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0]) * \
+                (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][1] - \
+                v[idx[2]].attrib[FRAG_ATTRIB_TEX0][2]); \
+\
+        sxy = (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][0] - \
+                v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0]) * \
+                (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][1] - \
+                v[idx[2]].attrib[FRAG_ATTRIB_TEX0][1]) - \
+                (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][0] - \
+                v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0]) * \
+                (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][1] - \
+                v[idx[2]].attrib[FRAG_ATTRIB_TEX0][2]); \
 \
        if (sxy < 0) sxy *= -1.0; \
        if (suv < 0) suv *= -1.0; \
index ac8daf47497ab12cc0ef42b5d06ea52012becc1b..4ba2f40b9e83d48b7b0d790b76efd674e315013d 100644 (file)
@@ -165,21 +165,21 @@ tdfx_translate_vertex( GLcontext *ctx, const tdfxVertex *src, SWvertex *dst)
       dst->color[2] = src->color[0];
       dst->color[3] = src->color[3];
 
-      dst->texcoord[0][0] = 1.0 / fxMesa->sScale0 * w * src->tu0;
-      dst->texcoord[0][1] = 1.0 / fxMesa->tScale0 * w * src->tv0;
+      dst->attrib[FRAG_ATTRIB_TEX0][0] = 1.0 / fxMesa->sScale0 * w * src->tu0;
+      dst->attrib[FRAG_ATTRIB_TEX0][1] = 1.0 / fxMesa->tScale0 * w * src->tv0;
       if (fxMesa->vertexFormat == TDFX_LAYOUT_PROJ1 || fxMesa->vertexFormat == TDFX_LAYOUT_PROJ2) {
-         dst->texcoord[0][3] = w * src->tq0;
+         dst->attrib[FRAG_ATTRIB_TEX0][3] = w * src->tq0;
       } else {
-        dst->texcoord[0][3] = 1.0;
+        dst->attrib[FRAG_ATTRIB_TEX0][3] = 1.0;
       }
 
       if (fxMesa->SetupIndex & TDFX_TEX1_BIT) {
-         dst->texcoord[1][0] = 1.0 / fxMesa->sScale1 * w * src->tu1;
-         dst->texcoord[1][1] = 1.0 / fxMesa->tScale1 * w * src->tv1;
+         dst->attrib[FRAG_ATTRIB_TEX1][0] = 1.0 / fxMesa->sScale1 * w * src->tu1;
+         dst->attrib[FRAG_ATTRIB_TEX1][1] = 1.0 / fxMesa->tScale1 * w * src->tv1;
          if (fxMesa->vertexFormat == TDFX_LAYOUT_PROJ2) {
-            dst->texcoord[1][3] = w * src->tq1;
+            dst->attrib[FRAG_ATTRIB_TEX1][3] = w * src->tq1;
          } else {
-           dst->texcoord[1][3] = 1.0;
+           dst->attrib[FRAG_ATTRIB_TEX1][3] = 1.0;
          }
       }
    }
index b1e68b01663cb968b5a57ee5d55a83c5eb3f451d..1d3ca84400da2d4ce78b52b525d6705104303d04 100644 (file)
@@ -179,7 +179,7 @@ struct trident_context {
        GLuint vertex_format;
        GLuint vertex_size;
        GLuint vertex_stride_shift;
-       char *verts;
+       GLubyte *verts;
 
        GLint tmu_source[2];