if (prim_type == PIPE_PRIM_LINES)
std::swap(chanx, chany);
- auto v0 = nir_vec4(b,
- out_addr0,
- nir_channel(b, &tf_outer->dest.ssa, chanx),
- nir_iadd(b, out_addr0, nir_imm_int(b, 4)),
- nir_channel(b, &tf_outer->dest.ssa, chany));
+ int inner_base = 12;
+
+ tf_out.push_back(nir_vec2(b,
+ out_addr0,
+ nir_channel(b, &tf_outer->dest.ssa, chanx)));
+
+ tf_out.push_back(nir_vec2(b, nir_iadd(b, out_addr0, nir_imm_int(b, 4)),
+ nir_channel(b, &tf_outer->dest.ssa, chany)));
+
- tf_out.push_back(v0);
if (outer_comps > 2) {
- auto v1 = (outer_comps > 3) ? nir_vec4(b,
- nir_iadd(b, out_addr0, nir_imm_int(b, 8)),
- nir_channel(b, &tf_outer->dest.ssa, 2),
- nir_iadd(b, out_addr0, nir_imm_int(b, 12)),
- nir_channel(b, &tf_outer->dest.ssa, 3))
- : nir_vec2(b,
- nir_iadd(b, out_addr0, nir_imm_int(b, 8)),
- nir_channel(b, &tf_outer->dest.ssa, 2));
- tf_out.push_back(v1);
+ tf_out.push_back(nir_vec2(b,
+ nir_iadd(b, out_addr0, nir_imm_int(b, 8)),
+ nir_channel(b, &tf_outer->dest.ssa, 2)));
+ }
+
+ if (outer_comps > 3) {
+ tf_out.push_back(nir_vec2(b,
+ nir_iadd(b, out_addr0, nir_imm_int(b, 12)),
+ nir_channel(b, &tf_outer->dest.ssa, 3)));
+ inner_base = 16;
+
}
if (inner_comps) {
&tf_inner->instr, &tf_inner->dest, tf_inner->num_components, 32, NULL);
nir_builder_instr_insert(b, &tf_inner->instr);
- auto v2 = (inner_comps > 1) ? nir_vec4(b,
- nir_iadd(b, out_addr0, nir_imm_int(b, 16)),
- nir_channel(b, &tf_inner->dest.ssa, 0),
- nir_iadd(b, out_addr0, nir_imm_int(b, 20)),
- nir_channel(b, &tf_inner->dest.ssa, 1))
- : nir_vec2(b,
- nir_iadd(b, out_addr0, nir_imm_int(b, 12)),
- nir_channel(b, &tf_inner->dest.ssa, 0));
- tf_out.push_back(v2);
+ tf_out.push_back(nir_vec2(b,
+ nir_iadd(b, out_addr0, nir_imm_int(b, inner_base)),
+ nir_channel(b, &tf_inner->dest.ssa, 0)));
+
+
+ if (inner_comps > 1) {
+ tf_out.push_back(nir_vec2(b,
+ nir_iadd(b, out_addr0, nir_imm_int(b, inner_base + 4)),
+ nir_channel(b, &tf_inner->dest.ssa, 1)));
+
+ }
}
for (auto tf : tf_out)
bool
TCSShader::store_tess_factor(nir_intrinsic_instr *instr)
{
- bool two_parts = nir_src_num_components(instr->src[0]) == 4;
-
- auto value0 = value_factory().temp_vec4(pin_group, {0, 1, 7, 7});
- emit_instruction(new AluInstr(
- op1_mov, value0[0], value_factory().src(instr->src[0], 0), AluInstr::write));
- emit_instruction(new AluInstr(op1_mov,
- value0[1],
- value_factory().src(instr->src[0], 1),
- two_parts ? AluInstr::write : AluInstr::last_write));
-
- if (two_parts) {
- auto value1 = value_factory().temp_vec4(pin_group, {2, 3, 7, 7});
- emit_instruction(new AluInstr(
- op1_mov, value1[0], value_factory().src(instr->src[0], 2), AluInstr::write));
- emit_instruction(new AluInstr(op1_mov,
- value1[1],
- value_factory().src(instr->src[0], 3),
- AluInstr::last_write));
- emit_instruction(new WriteTFInstr(value1));
- }
-
+ auto value0 = value_factory().src_vec4(instr->src[0], pin_group, {0, 1, 7, 7});
emit_instruction(new WriteTFInstr(value0));
return true;
}