~ubuntu-branches/ubuntu/jaunty/mesa/jaunty

« back to all changes in this revision

Viewing changes to src/mesa/drivers/dri/i965/brw_sf.c

  • Committer: Bazaar Package Importer
  • Author(s): Timo Aaltonen
  • Date: 2009-04-03 12:42:06 UTC
  • mfrom: (1.2.16 upstream) (3.1.5 experimental)
  • Revision ID: james.westby@ubuntu.com-20090403124206-0oo9dl0tcmd0qr38
Tags: 7.4-0ubuntu1
* New upstream release, merge from debian-experimental
  (LP: #330476, #347171, #349127)
* Drop 103_rs600_support.patch, included in this version.
* Drop 104_swrast_fbconfigs.patch, included in this version.
* Add 103_bump_965_texture_limit.diff. (LP: #146298)
* Add 104_fix_dri2_ext_tfp.diff. (LP: #324854)

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
static void compile_sf_prog( struct brw_context *brw,
47
47
                             struct brw_sf_prog_key *key )
48
48
{
 
49
   GLcontext *ctx = &brw->intel.ctx;
49
50
   struct brw_sf_compile c;
50
51
   const GLuint *program;
51
52
   GLuint program_size;
74
75
         c.idx_to_attr[idx] = i;
75
76
         if (i >= VERT_RESULT_TEX0 && i <= VERT_RESULT_TEX7) {
76
77
            c.point_attrs[i].CoordReplace = 
77
 
               brw->attribs.Point->CoordReplace[i - VERT_RESULT_TEX0];
 
78
               ctx->Point.CoordReplace[i - VERT_RESULT_TEX0];
78
79
         }
79
80
         else {
80
81
            c.point_attrs[i].CoordReplace = GL_FALSE;
128
129
 */
129
130
static void upload_sf_prog(struct brw_context *brw)
130
131
{
 
132
   GLcontext *ctx = &brw->intel.ctx;
131
133
   struct brw_sf_prog_key key;
132
134
 
133
135
   memset(&key, 0, sizeof(key));
158
160
      break;
159
161
   }
160
162
 
161
 
   key.do_point_sprite = brw->attribs.Point->PointSprite;
162
 
   key.SpriteOrigin = brw->attribs.Point->SpriteOrigin;
 
163
   key.do_point_sprite = ctx->Point.PointSprite;
 
164
   key.SpriteOrigin = ctx->Point.SpriteOrigin;
163
165
   /* _NEW_LIGHT */
164
 
   key.do_flat_shading = (brw->attribs.Light->ShadeModel == GL_FLAT);
165
 
   key.do_twoside_color = (brw->attribs.Light->Enabled && brw->attribs.Light->Model.TwoSide);
 
166
   key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT);
 
167
   key.do_twoside_color = (ctx->Light.Enabled && ctx->Light.Model.TwoSide);
166
168
 
167
169
   /* _NEW_POLYGON */
168
 
   if (key.do_twoside_color)
169
 
      key.frontface_ccw = (brw->attribs.Polygon->FrontFace == GL_CCW);
 
170
   if (key.do_twoside_color) {
 
171
      /* If we're rendering to a FBO, we have to invert the polygon
 
172
       * face orientation, just as we invert the viewport in
 
173
       * sf_unit_create_from_key().  ctx->DrawBuffer->Name will be
 
174
       * nonzero if we're rendering to such an FBO.
 
175
       */
 
176
      key.frontface_ccw = (ctx->Polygon.FrontFace == GL_CCW) ^ (ctx->DrawBuffer->Name != 0);
 
177
   }
170
178
 
171
179
   dri_bo_unreference(brw->sf.prog_bo);
172
180
   brw->sf.prog_bo = brw_search_cache(&brw->cache, BRW_SF_PROG,