merge of glsl-compiler-1 branch
authorBrian <brian@yutani.localnet.net>
Mon, 26 Mar 2007 16:13:02 +0000 (10:13 -0600)
committerBrian <brian@yutani.localnet.net>
Mon, 26 Mar 2007 16:13:02 +0000 (10:13 -0600)
1  2 
src/mesa/drivers/dri/i965/brw_wm_fp.c
src/mesa/drivers/dri/r300/r300_context.c
src/mesa/drivers/dri/r300/r300_fragprog.c
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/main/texenvprogram.c
src/mesa/tnl/t_vp_build.c

Simple merge
index 68c8f5b87d0c65f6d54127e8550761172e1da0cd,8aaf50b6d81783a0bca051871139119b7453a719..1f8d95078fbe9a7e29ca7e1355a06147476f65ce
@@@ -331,13 -334,13 +331,13 @@@ GLboolean r300CreateContext(const __GLc
        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);
 -      
 +
        if (driQueryOptionb(&r300->radeon.optionCache, "disable_stencil_two_side") == 0)
                driInitSingleExtension(ctx, stencil_two_side);
 -      
 +
        if (r300->radeon.glCtx->Mesa_DXTn && !driQueryOptionb (&r300->radeon.optionCache, "disable_s3tc")) {
          _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" );
          _mesa_enable_extension( ctx, "GL_S3_s3tc" );
index 17658efdb2f38215955af0ed1870146b9d3f9518,fff11653de1451faa6f34961c15c17ef148a6840..ff3c51c5edf02b484912fa0532392842b90c6a36
@@@ -1055,44 -1057,28 +1057,46 @@@ 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);
 +      r300ContextPtr r300 = R300_CONTEXT(ctx);
  
 -    switch(state[0])
 -    {
 -    case STATE_INTERNAL:
 -      switch(state[1])
 -      {
 -      case STATE_R300_WINDOW_DIMENSION:
 -          value[0] = r300->radeon.dri.drawable->w*0.5f;/* width*0.5 */
 -          value[1] = r300->radeon.dri.drawable->h*0.5f;/* height*0.5 */
 -          value[2] = 0.5F;                            /* for moving range [-1 1] -> [0 1] */
 -          value[3] = 1.0F;                            /* not used */
 -          break;
 -      default:;
 +      switch(state[0]) {
 +      case STATE_INTERNAL:
 +              switch(state[1]) {
 +              case STATE_R300_WINDOW_DIMENSION:
 +                      value[0] = r300->radeon.dri.drawable->w*0.5f;/* width*0.5 */
 +                      value[1] = r300->radeon.dri.drawable->h*0.5f;/* height*0.5 */
 +                      value[2] = 0.5F;                                /* for moving range [-1 1] -> [0 1] */
 +                      value[3] = 1.0F;                                /* not used */
 +                      break;
 +
 +              case STATE_R300_TEXRECT_FACTOR: {
 +                      struct gl_texture_object* t = ctx->Texture.Unit[state[2]].CurrentRect;
 +
 +                      if (t && t->Image[0][t->BaseLevel]) {
 +                              struct gl_texture_image* image = t->Image[0][t->BaseLevel];
 +                              value[0] = 1.0 / image->Width2;
 +                              value[1] = 1.0 / image->Height2;
 +                      } else {
 +                              value[0] = 1.0;
 +                              value[1] = 1.0;
 +                      }
 +                      value[2] = 1.0;
 +                      value[3] = 1.0;
 +                      break; }
 +
 +              default:
 +                      break;
 +              }
 +              break;
 +
 +      default:
 +              break;
        }
 -    default:;
 -    }
  }
  
  /**
index d1994f76d1b70167a3f1ce30d48de149368b0bed,54ae7ce0a13002f3a165bfab091cd1ceaec00f4f..0c6fa82f112f35fd5f699c737e21a00fd7730cf3
@@@ -1010,10 -1011,10 +1011,10 @@@ create_new_program(GLcontext *ctx, stru
      */
     p.program->Base.Instructions = instBuffer;
     p.program->Base.Target = GL_FRAGMENT_PROGRAM_ARB;
-    p.program->NumTexIndirections = 1; /* correct? */
-    p.program->NumTexInstructions = 0;
-    p.program->NumAluInstructions = 0;
+    p.program->Base.NumTexIndirections = 1;    /* correct? */
+    p.program->Base.NumTexInstructions = 0;
+    p.program->Base.NumAluInstructions = 0;
 -   p.program->Base.String = 0;
 +   p.program->Base.String = NULL;
     p.program->Base.NumInstructions =
     p.program->Base.NumTemporaries =
     p.program->Base.NumParameters =
Simple merge