Merge branch '7.8'
[mesa.git] / src / mesa / main / ffvertex_prog.c
index 48edec657bd7d7fb44a316dc235cecaf628660cc..70ac47f36d77fd7135593b501991604a7478c6a4 100644 (file)
@@ -75,6 +75,7 @@ struct state_key {
       unsigned light_attenuated:1;
       unsigned texunit_really_enabled:1;
       unsigned texmat_enabled:1;
+      unsigned coord_replace:1;
       unsigned texgen_enabled:4;
       unsigned texgen_mode0:4;
       unsigned texgen_mode1:4;
@@ -225,6 +226,10 @@ static void make_state_key( GLcontext *ctx, struct state_key *key )
       if (texUnit->_ReallyEnabled)
         key->unit[i].texunit_really_enabled = 1;
 
+      if (ctx->Point.PointSprite)
+        if (ctx->Point.CoordReplace[i])
+           key->unit[i].coord_replace = 1;
+
       if (ctx->Texture._TexMatEnabled & ENABLE_TEXMAT(i))
         key->unit[i].texmat_enabled = 1;
 
@@ -536,10 +541,10 @@ static void debug_insn( struct prog_instruction *inst, const char *fn,
 
       if (fn != last_fn) {
         last_fn = fn;
-        _mesa_printf("%s:\n", fn);
+        printf("%s:\n", fn);
       }
 
-      _mesa_printf("%d:\t", line);
+      printf("%d:\t", line);
       _mesa_print_instruction(inst);
    }
 }
@@ -1385,6 +1390,9 @@ static void build_texture_transform( struct tnl_program *p )
       if (!(p->state->fragprog_inputs_read & FRAG_BIT_TEX(i)))
         continue;
 
+      if (p->state->unit[i].coord_replace)
+        continue;
+
       if (p->state->unit[i].texgen_enabled ||
          p->state->unit[i].texmat_enabled) {
 
@@ -1577,7 +1585,7 @@ static void build_tnl_program( struct tnl_program *p )
    /* Disassemble:
     */
    if (DISASSEM) {
-      _mesa_printf ("\n");
+      printf ("\n");
    }
 }
 
@@ -1647,7 +1655,7 @@ _mesa_get_fixed_func_vertex_program(GLcontext *ctx)
    if (!prog) {
       /* OK, we'll have to build a new one */
       if (0)
-         _mesa_printf("Build new TNL program\n");
+         printf("Build new TNL program\n");
 
       prog = (struct gl_vertex_program *)
          ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0);