Lines Matching refs:rc

65 #define INIT_COMBINER(chan, ctx, rc, i) do {			\
68 (rc)->ctx = ctx; \
69 (rc)->unit = i; \
70 (rc)->alpha = __INIT_COMBINER_ALPHA_##chan; \
71 (rc)->premodulate = c->_NumArgs##chan == 4; \
72 (rc)->mode = c->Mode##chan; \
73 (rc)->source = c->Source##chan; \
74 (rc)->operand = c->Operand##chan; \
75 (rc)->logscale = c->ScaleShift##chan; \
76 (rc)->hw = 0; \
82 get_input_source(struct combiner_state *rc, int source)
89 return rc->unit ? COMBINER_SOURCE(TEXTURE1) :
105 return rc->unit ? COMBINER_SOURCE(PREVIOUS) :
118 get_input_mapping(struct combiner_state *rc, int operand, int flags)
122 if (!is_color_operand(operand) && !rc->alpha)
132 get_input_arg(struct combiner_state *rc, int arg, int flags)
134 int source = rc->source[arg];
135 int operand = rc->operand[arg];
140 rc->unit : source - GL_TEXTURE0);
141 struct gl_texture_object *t = rc->ctx->Texture.Unit[i]._Current;
148 get_input_mapping(rc, operand, flags);
154 get_input_mapping(rc, operand,
159 return get_input_source(rc, source) |
160 get_input_mapping(rc, operand, flags);
165 #define INPUT_SRC(rc, in, src, flags) \
166 (rc)->hw |= ((flags & INVERT ? COMBINER_INVERT : 0) | \
171 #define INPUT_ARG(rc, in, arg, flags) \
172 (rc)->hw |= get_input_arg(rc, arg, flags) << COMBINER_SHIFT(in)
174 #define UNSIGNED_OP(rc) \
175 (rc)->hw |= ((rc)->logscale ? \
178 #define SIGNED_OP(rc) \
179 (rc)->hw |= ((rc)->logscale ? \
184 setup_combiner(struct combiner_state *rc)
186 switch (rc->mode) {
188 INPUT_ARG(rc, 0, 0, 0);
189 INPUT_SRC(rc, 1, ZERO, INVERT);
190 INPUT_SRC(rc, 2, ZERO, 0);
191 INPUT_SRC(rc, 3, ZERO, 0);
192 UNSIGNED_OP(rc);
196 INPUT_ARG(rc, 0, 0, 0);
197 INPUT_ARG(rc, 1, 1, 0);
198 INPUT_SRC(rc, 2, ZERO, 0);
199 INPUT_SRC(rc, 3, ZERO, 0);
200 UNSIGNED_OP(rc);
205 if (rc->premodulate) {
206 INPUT_ARG(rc, 0, 0, 0);
207 INPUT_ARG(rc, 1, 1, 0);
208 INPUT_ARG(rc, 2, 2, 0);
209 INPUT_ARG(rc, 3, 3, 0);
211 INPUT_ARG(rc, 0, 0, 0);
212 INPUT_SRC(rc, 1, ZERO, INVERT);
213 INPUT_ARG(rc, 2, 1, 0);
214 INPUT_SRC(rc, 3, ZERO, INVERT);
217 if (rc->mode == GL_ADD_SIGNED)
218 SIGNED_OP(rc);
220 UNSIGNED_OP(rc);
225 INPUT_ARG(rc, 0, 0, 0);
226 INPUT_ARG(rc, 1, 2, 0);
227 INPUT_ARG(rc, 2, 1, 0);
228 INPUT_ARG(rc, 3, 2, INVERT);
229 UNSIGNED_OP(rc);