return &load->dest.ssa;
}
-static inline void
-store_output(nir_builder *b, nir_ssa_def *value, int offset, unsigned comps)
-{
- nir_intrinsic_instr *store =
- nir_intrinsic_instr_create(b->shader, nir_intrinsic_store_output);
- store->num_components = comps;
- nir_intrinsic_set_write_mask(store, (1u << comps) - 1);
- store->src[0] = nir_src_for_ssa(value);
- store->src[1] = nir_src_for_ssa(nir_imm_int(b, 0));
- nir_builder_instr_insert(b, &store->instr);
-}
-
static void
emit_quads_workaround(nir_builder *b, nir_block *block)
{
/* Fill out the new then-block */
b->cursor = nir_after_cf_list(&if_stmt->then_list);
- store_output(b, nir_bcsel(b, nir_fge(b, nir_imm_float(b, 1.0f), inner),
- nir_imm_float(b, 2.0f), inner), 0, 2);
+ inner = nir_bcsel(b, nir_fge(b, nir_imm_float(b, 1.0f), inner),
+ nir_imm_float(b, 2.0f), inner);
+
+ nir_intrinsic_instr *store =
+ nir_intrinsic_instr_create(b->shader, nir_intrinsic_store_output);
+ store->num_components = 2;
+ nir_intrinsic_set_write_mask(store, WRITEMASK_XY);
+ store->src[0] = nir_src_for_ssa(inner);
+ store->src[1] = nir_src_for_ssa(nir_imm_int(b, 0));
+ nir_builder_instr_insert(b, &store->instr);
}
void