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

« back to all changes in this revision

Viewing changes to src/mesa/drivers/dri/i965/brw_cc.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:
83
83
static void
84
84
cc_unit_populate_key(struct brw_context *brw, struct brw_cc_unit_key *key)
85
85
{
86
 
   struct gl_stencil_attrib *stencil = brw->attribs.Stencil;
 
86
   GLcontext *ctx = &brw->intel.ctx;
 
87
   const unsigned back = ctx->Stencil._BackFace;
87
88
 
88
89
   memset(key, 0, sizeof(*key));
89
90
 
90
 
   key->stencil = stencil->Enabled;
91
 
   key->stencil_two_side = stencil->_TestTwoSide;
 
91
   key->stencil = ctx->Stencil.Enabled;
 
92
   key->stencil_two_side = ctx->Stencil._TestTwoSide;
92
93
 
93
94
   if (key->stencil) {
94
 
      key->stencil_func[0] = stencil->Function[0];
95
 
      key->stencil_fail_op[0] = stencil->FailFunc[0];
96
 
      key->stencil_pass_depth_fail_op[0] = stencil->ZFailFunc[0];
97
 
      key->stencil_pass_depth_pass_op[0] = stencil->ZPassFunc[0];
98
 
      key->stencil_ref[0] = stencil->Ref[0];
99
 
      key->stencil_write_mask[0] = stencil->WriteMask[0];
100
 
      key->stencil_test_mask[0] = stencil->ValueMask[0];
 
95
      key->stencil_func[0] = ctx->Stencil.Function[0];
 
96
      key->stencil_fail_op[0] = ctx->Stencil.FailFunc[0];
 
97
      key->stencil_pass_depth_fail_op[0] = ctx->Stencil.ZFailFunc[0];
 
98
      key->stencil_pass_depth_pass_op[0] = ctx->Stencil.ZPassFunc[0];
 
99
      key->stencil_ref[0] = ctx->Stencil.Ref[0];
 
100
      key->stencil_write_mask[0] = ctx->Stencil.WriteMask[0];
 
101
      key->stencil_test_mask[0] = ctx->Stencil.ValueMask[0];
101
102
   }
102
103
   if (key->stencil_two_side) {
103
 
      key->stencil_func[1] = stencil->Function[1];
104
 
      key->stencil_fail_op[1] = stencil->FailFunc[1];
105
 
      key->stencil_pass_depth_fail_op[1] = stencil->ZFailFunc[1];
106
 
      key->stencil_pass_depth_pass_op[1] = stencil->ZPassFunc[1];
107
 
      key->stencil_ref[1] = stencil->Ref[1];
108
 
      key->stencil_write_mask[1] = stencil->WriteMask[1];
109
 
      key->stencil_test_mask[1] = stencil->ValueMask[1];
 
104
      key->stencil_func[1] = ctx->Stencil.Function[back];
 
105
      key->stencil_fail_op[1] = ctx->Stencil.FailFunc[back];
 
106
      key->stencil_pass_depth_fail_op[1] = ctx->Stencil.ZFailFunc[back];
 
107
      key->stencil_pass_depth_pass_op[1] = ctx->Stencil.ZPassFunc[back];
 
108
      key->stencil_ref[1] = ctx->Stencil.Ref[back];
 
109
      key->stencil_write_mask[1] = ctx->Stencil.WriteMask[back];
 
110
      key->stencil_test_mask[1] = ctx->Stencil.ValueMask[back];
110
111
   }
111
112
 
112
 
   if (brw->attribs.Color->_LogicOpEnabled)
113
 
      key->logic_op = brw->attribs.Color->LogicOp;
 
113
   if (ctx->Color._LogicOpEnabled)
 
114
      key->logic_op = ctx->Color.LogicOp;
114
115
   else
115
116
      key->logic_op = GL_COPY;
116
117
 
117
 
   key->color_blend = brw->attribs.Color->BlendEnabled;
 
118
   key->color_blend = ctx->Color.BlendEnabled;
118
119
   if (key->color_blend) {
119
 
      key->blend_eq_rgb = brw->attribs.Color->BlendEquationRGB;
120
 
      key->blend_eq_a = brw->attribs.Color->BlendEquationA;
121
 
      key->blend_src_rgb = brw->attribs.Color->BlendSrcRGB;
122
 
      key->blend_dst_rgb = brw->attribs.Color->BlendDstRGB;
123
 
      key->blend_src_a = brw->attribs.Color->BlendSrcA;
124
 
      key->blend_dst_a = brw->attribs.Color->BlendDstA;
 
120
      key->blend_eq_rgb = ctx->Color.BlendEquationRGB;
 
121
      key->blend_eq_a = ctx->Color.BlendEquationA;
 
122
      key->blend_src_rgb = ctx->Color.BlendSrcRGB;
 
123
      key->blend_dst_rgb = ctx->Color.BlendDstRGB;
 
124
      key->blend_src_a = ctx->Color.BlendSrcA;
 
125
      key->blend_dst_a = ctx->Color.BlendDstA;
125
126
   }
126
127
 
127
 
   key->alpha_enabled = brw->attribs.Color->AlphaEnabled;
 
128
   key->alpha_enabled = ctx->Color.AlphaEnabled;
128
129
   if (key->alpha_enabled) {
129
 
      key->alpha_func = brw->attribs.Color->AlphaFunc;
130
 
      key->alpha_ref = brw->attribs.Color->AlphaRef;
 
130
      key->alpha_func = ctx->Color.AlphaFunc;
 
131
      key->alpha_ref = ctx->Color.AlphaRef;
131
132
   }
132
133
 
133
 
   key->dither = brw->attribs.Color->DitherFlag;
 
134
   key->dither = ctx->Color.DitherFlag;
134
135
 
135
 
   key->depth_test = brw->attribs.Depth->Test;
 
136
   key->depth_test = ctx->Depth.Test;
136
137
   if (key->depth_test) {
137
 
      key->depth_func = brw->attribs.Depth->Func;
138
 
      key->depth_write = brw->attribs.Depth->Mask;
 
138
      key->depth_func = ctx->Depth.Func;
 
139
      key->depth_write = ctx->Depth.Mask;
139
140
   }
140
141
}
141
142