map[m_index->sel()].used = true;
}
+void MemRingOutIntruction::patch_ring(int stream)
+{
+ const ECFOpCode ring_op[4] = {cf_mem_ring, cf_mem_ring2, cf_mem_ring3, cf_mem_ring3};
+
+ assert(stream < 4);
+ m_ring_op = ring_op[stream];
+}
+
}
void replace_values_child(const ValueSet& candiates, PValue new_value) override;
void remap_registers_child(std::vector<rename_reg_pair>& map,
ValueMap& values) override;
+ void patch_ring(int stream);
private:
bool is_equal_to(const Instruction& lhs) const override;
void do_print(std::ostream& os) const override;
auto ir = new MemRingOutIntruction(cf_mem_ring, mem_write_ind, out_value,
4 * out_var->data.driver_location,
instr->num_components, m_export_base);
- emit_instruction(ir);
+
+ streamout_data[out_var->data.location] = ir;
return true;
}
int stream = nir_intrinsic_stream_id(instr);
assert(stream < 4);
+ for(auto v: streamout_data) {
+ if (stream == 0 || v.first != VARYING_SLOT_POS) {
+ v.second->patch_ring(stream);
+ emit_instruction(v.second);
+ } else
+ delete v.second;
+ }
+ streamout_data.clear();
emit_instruction(new EmitVertex(stream, cut));
if (!cut)