~ubuntu-branches/ubuntu/quantal/mesa/quantal

« back to all changes in this revision

Viewing changes to src/mesa/drivers/dri/i915/i915_fragprog.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-02-21 12:44:07 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20070221124407-rgcacs32mycrtadl
ImportĀ upstreamĀ versionĀ 6.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "macros.h"
30
30
#include "enums.h"
31
31
 
 
32
#include "tnl/tnl.h"
32
33
#include "tnl/t_context.h"
33
34
#include "intel_batchbuffer.h"
34
35
 
38
39
 
39
40
#include "program_instruction.h"
40
41
#include "program.h"
 
42
#include "programopt.h"
41
43
 
42
44
 
43
45
 
122
124
            p, p->ctx->FragmentProgram.Parameters[source->Index]);
123
125
         break;
124
126
 
 
127
      case PROGRAM_CONSTANT:
125
128
      case PROGRAM_STATE_VAR:
126
129
      case PROGRAM_NAMED_PARAM:
127
130
         src = i915_emit_param4fv( 
936
939
       */
937
940
      ctx->Driver.Enable( ctx, GL_FRAGMENT_PROGRAM_ARB, 
938
941
                          ctx->FragmentProgram.Enabled );
 
942
 
 
943
      if (p->FragProg.FogOption) {
 
944
         /* add extra instructions to do fog, then turn off FogOption field */
 
945
         _mesa_append_fog_code(ctx, &p->FragProg);
 
946
         p->FragProg.FogOption = GL_NONE;
 
947
      }
939
948
   }
 
949
 
 
950
   _tnl_program_string(ctx, target, prog);
940
951
}
941
952
 
942
953
 
955
966
   GLuint s2 = S2_TEXCOORD_NONE;
956
967
   int i, offset = 0;
957
968
 
 
969
   if (i915->current_program != p) 
 
970
   {
 
971
      if (i915->current_program) {
 
972
         i915->current_program->on_hardware = 0;
 
973
         i915->current_program->params_uptodate = 0;
 
974
      }
 
975
      
 
976
      i915->current_program = p;
 
977
   }
 
978
 
 
979
 
958
980
   /* Important:
959
981
    */
960
982
   VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr;
996
1018
         EMIT_PAD( 1 );
997
1019
   }
998
1020
 
999
 
#if 0
 
1021
   /* XXX this was disabled, but enabling this code helped fix the Glean
 
1022
    * tfragprog1 fog tests.
 
1023
    */
 
1024
#if 1
1000
1025
   if ((inputsRead & FRAG_BIT_FOGC) || i915->vertex_fog != I915_FOG_NONE) {
1001
1026
      EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F, S4_VFMT_FOG_PARAM, 4 );
1002
1027
   }