r600g: put the rest of CS overflow checks in r600_need_cs_space
[mesa.git] / src / gallium / drivers / r600 / r700_asm.c
index a7f2f54736e9f39d25cacfe5b86de421d2e39de5..74efe22653097f702101ec716f9b952411d69e81 100644 (file)
 #include "r600_asm.h"
 #include "r700_sq.h"
 
+void r700_bytecode_cf_vtx_build(uint32_t *bytecode, const struct r600_bytecode_cf *cf)
+{
+       unsigned count = (cf->ndw / 4) - 1;
+       *bytecode++ = S_SQ_CF_WORD0_ADDR(cf->addr >> 1);
+       *bytecode++ = S_SQ_CF_WORD1_CF_INST(cf->inst) |
+                       S_SQ_CF_WORD1_BARRIER(1) |
+                       S_SQ_CF_WORD1_COUNT(count) |
+                       S_SQ_CF_WORD1_COUNT_3(count >> 3);
+}
 
-int r700_bc_alu_build(struct r600_bc *bc, struct r600_bc_alu *alu, unsigned id)
+int r700_bytecode_alu_build(struct r600_bytecode *bc, struct r600_bytecode_alu *alu, unsigned id)
 {
        bc->bytecode[id++] = S_SQ_ALU_WORD0_SRC0_SEL(alu->src[0].sel) |
                S_SQ_ALU_WORD0_SRC0_REL(alu->src[0].rel) |