* in one slot at least:
*/
assert(type1 == SVGA3DREG_SAMPLER);
+ (void) type1;
if (type0 == SVGA3DREG_CONST &&
((type3 == SVGA3DREG_CONST && src0.base.num != src3.base.num) ||
}
if (!emit_instruction(emit, opcode) ||
- !svga_shader_emit_dwords( emit, def.values, Elements(def.values)))
+ !svga_shader_emit_dwords( emit, def.values, ARRAY_SIZE(def.values)))
return FALSE;
return TRUE;
/* build writemasks and srcSwizzle terms */
for (i = 0; i < 4; i++) {
- if (swizzleIn[i] == PIPE_SWIZZLE_ZERO) {
+ if (swizzleIn[i] == PIPE_SWIZZLE_0) {
srcSwizzle[i] = TGSI_SWIZZLE_X + i;
zeroWritemask |= (1 << i);
}
- else if (swizzleIn[i] == PIPE_SWIZZLE_ONE) {
+ else if (swizzleIn[i] == PIPE_SWIZZLE_1) {
srcSwizzle[i] = TGSI_SWIZZLE_X + i;
oneWritemask |= (1 << i);
}
PIPE_TEX_COMPARE_R_TO_TEXTURE);
/* texture swizzle */
- boolean swizzle = (emit->key.tex[unit].swizzle_r != PIPE_SWIZZLE_RED ||
- emit->key.tex[unit].swizzle_g != PIPE_SWIZZLE_GREEN ||
- emit->key.tex[unit].swizzle_b != PIPE_SWIZZLE_BLUE ||
- emit->key.tex[unit].swizzle_a != PIPE_SWIZZLE_ALPHA);
+ boolean swizzle = (emit->key.tex[unit].swizzle_r != PIPE_SWIZZLE_X ||
+ emit->key.tex[unit].swizzle_g != PIPE_SWIZZLE_Y ||
+ emit->key.tex[unit].swizzle_b != PIPE_SWIZZLE_Z ||
+ emit->key.tex[unit].swizzle_a != PIPE_SWIZZLE_W);
boolean saturate = insn->Instruction.Saturate;
break;
}
- if (emit->nr_labels == Elements(emit->label))
+ if (emit->nr_labels == ARRAY_SIZE(emit->label))
return FALSE;
if (i == emit->nr_labels) {
assert(emit->inverted_texcoords & (1 << unit));
- assert(unit < Elements(emit->ps_true_texcoord));
+ assert(unit < ARRAY_SIZE(emit->ps_true_texcoord));
- assert(unit < Elements(emit->ps_inverted_texcoord_input));
+ assert(unit < ARRAY_SIZE(emit->ps_inverted_texcoord_input));
assert(emit->ps_inverted_texcoord_input[unit]
- < Elements(emit->input_map));
+ < ARRAY_SIZE(emit->input_map));
/* inverted = coord * (1, -1, 1, 1) + (0, 1, 0, 0) */
if (!submit_op3(emit,
if (emit->inverted_texcoords)
return TRUE;
- /* look for any PIPE_SWIZZLE_ZERO/ONE terms */
+ /* look for any PIPE_SWIZZLE_0/ONE terms */
for (i = 0; i < emit->key.num_textures; i++) {
- if (emit->key.tex[i].swizzle_r > PIPE_SWIZZLE_ALPHA ||
- emit->key.tex[i].swizzle_g > PIPE_SWIZZLE_ALPHA ||
- emit->key.tex[i].swizzle_b > PIPE_SWIZZLE_ALPHA ||
- emit->key.tex[i].swizzle_a > PIPE_SWIZZLE_ALPHA)
+ if (emit->key.tex[i].swizzle_r > PIPE_SWIZZLE_W ||
+ emit->key.tex[i].swizzle_g > PIPE_SWIZZLE_W ||
+ emit->key.tex[i].swizzle_b > PIPE_SWIZZLE_W ||
+ emit->key.tex[i].swizzle_a > PIPE_SWIZZLE_W)
return TRUE;
}
}
if (emit->unit == PIPE_SHADER_FRAGMENT) {
+ if (!svga_shader_emit_samplers_decl( emit ))
+ return FALSE;
+
if (!emit_ps_preamble( emit ))
return FALSE;
if (new_tokens) {
/* Setup texture state for stipple */
- emit->key.tex[unit].texture_target = PIPE_TEXTURE_2D;
+ emit->sampler_target[unit] = TGSI_TEXTURE_2D;
emit->key.tex[unit].swizzle_r = TGSI_SWIZZLE_X;
emit->key.tex[unit].swizzle_g = TGSI_SWIZZLE_Y;
emit->key.tex[unit].swizzle_b = TGSI_SWIZZLE_Z;