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

« back to all changes in this revision

Viewing changes to src/mesa/drivers/dri/i965/brw_sf_emit.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:
59
59
   return (c->key.attrs & (1<<attr)) ? 1 : 0;
60
60
}
61
61
 
62
 
/**
63
 
 * Sets VERT_RESULT_FOGC.Y  for gl_FrontFacing
64
 
 *
65
 
 * This is currently executed if the fragment program uses VERT_RESULT_FOGC
66
 
 * at all, but this could be eliminated with a scan of the FP contents.
67
 
 */
68
 
static void
69
 
do_front_facing( struct brw_sf_compile *c )
70
 
{
71
 
   struct brw_compile *p = &c->func; 
72
 
   int i;
73
 
 
74
 
   if (!have_attr(c, VERT_RESULT_FOGC))
75
 
      return;
76
 
 
77
 
   brw_push_insn_state(p);
78
 
   brw_CMP(p, brw_null_reg(), 
79
 
        c->key.frontface_ccw ? BRW_CONDITIONAL_G : BRW_CONDITIONAL_L,
80
 
        c->det, brw_imm_f(0));
81
 
   brw_set_predicate_control(p, BRW_PREDICATE_NONE);
82
 
   for (i = 0; i < 3; i++) {
83
 
       struct brw_reg fogc = get_vert_attr(c, c->vert[i],FRAG_ATTRIB_FOGC);
84
 
       brw_MOV(p, get_element(fogc, 1), brw_imm_f(0));
85
 
       brw_set_predicate_control(p, BRW_PREDICATE_NORMAL);
86
 
       brw_MOV(p, get_element(fogc, 1), brw_imm_f(1));
87
 
       brw_set_predicate_control(p, BRW_PREDICATE_NONE);
88
 
   }
89
 
   brw_pop_insn_state(p);
90
 
}
91
 
 
92
 
                         
93
62
/*********************************************************************** 
94
63
 * Twoside lighting
95
64
 */
384
353
 
385
354
   invert_det(c);
386
355
   copy_z_inv_w(c);
387
 
   do_front_facing(c);
388
356
 
389
357
   if (c->key.do_twoside_color) 
390
358
      do_twoside_color(c);