r600g: put the rest of CS overflow checks in r600_need_cs_space
[mesa.git] / src / gallium / drivers / r600 / r700_asm.c
index 3eb6fb50ca721671a909508e215305dd56b76638..74efe22653097f702101ec716f9b952411d69e81 100644 (file)
 #include "r600_asm.h"
 #include "r700_sq.h"
 
-
-int r700_bc_alu_build(struct r600_bc *bc, struct r600_bc_alu *alu, unsigned id)
+void r700_bytecode_cf_vtx_build(uint32_t *bytecode, const struct r600_bytecode_cf *cf)
 {
-       unsigned i;
+       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_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) |
                S_SQ_ALU_WORD0_SRC0_CHAN(alu->src[0].chan) |
@@ -67,13 +74,5 @@ int r700_bc_alu_build(struct r600_bc *bc, struct r600_bc_alu *alu, unsigned id)
                                        S_SQ_ALU_WORD1_OP2_UPDATE_EXECUTE_MASK(alu->predicate) |
                                        S_SQ_ALU_WORD1_OP2_UPDATE_PRED(alu->predicate);
        }
-       if (alu->last) {
-               if (alu->nliteral && !alu->literal_added) {
-                       R600_ERR("Bug in ALU processing for instruction 0x%08x, literal not added correctly\n", alu->inst);
-               }
-               for (i = 0; i < alu->nliteral; i++) {
-                       bc->bytecode[id++] = alu->value[i];
-               }
-       }
        return 0;
 }