84
84
cc_unit_populate_key(struct brw_context *brw, struct brw_cc_unit_key *key)
86
struct gl_stencil_attrib *stencil = brw->attribs.Stencil;
86
GLcontext *ctx = &brw->intel.ctx;
87
const unsigned back = ctx->Stencil._BackFace;
88
89
memset(key, 0, sizeof(*key));
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;
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];
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];
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;
115
116
key->logic_op = GL_COPY;
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;
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;
133
key->dither = brw->attribs.Color->DitherFlag;
134
key->dither = ctx->Color.DitherFlag;
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;