r600g/bc: add support for indexed memory writes.
authorDave Airlie <airlied@redhat.com>
Mon, 13 Jan 2014 00:19:00 +0000 (10:19 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 5 Feb 2014 00:40:33 +0000 (10:40 +1000)
It looks like we need these for geom shaders in the future.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/drivers/r600/eg_asm.c
src/gallium/drivers/r600/r600_asm.c
src/gallium/drivers/r600/r600_asm.h

index 42e78c0f06997c0de07997e0c3fba7789799ca1b..5ad3d7719744ffb6f26502b1ef1e5f66a0c02431 100644 (file)
@@ -79,7 +79,8 @@ int eg_bytecode_cf_build(struct r600_bytecode *bc, struct r600_bytecode_cf *cf)
                        bc->bytecode[id++] = S_SQ_CF_ALLOC_EXPORT_WORD0_RW_GPR(cf->output.gpr) |
                                        S_SQ_CF_ALLOC_EXPORT_WORD0_ELEM_SIZE(cf->output.elem_size) |
                                        S_SQ_CF_ALLOC_EXPORT_WORD0_ARRAY_BASE(cf->output.array_base) |
-                                       S_SQ_CF_ALLOC_EXPORT_WORD0_TYPE(cf->output.type);
+                                       S_SQ_CF_ALLOC_EXPORT_WORD0_TYPE(cf->output.type) |
+                                       S_SQ_CF_ALLOC_EXPORT_WORD0_INDEX_GPR(cf->output.index_gpr);
                        bc->bytecode[id] =
                                        S_SQ_CF_ALLOC_EXPORT_WORD1_BURST_COUNT(cf->output.burst_count - 1) |
                                        S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_X(cf->output.swizzle_x) |
@@ -97,7 +98,8 @@ int eg_bytecode_cf_build(struct r600_bytecode *bc, struct r600_bytecode_cf *cf)
                        bc->bytecode[id++] = S_SQ_CF_ALLOC_EXPORT_WORD0_RW_GPR(cf->output.gpr) |
                                        S_SQ_CF_ALLOC_EXPORT_WORD0_ELEM_SIZE(cf->output.elem_size) |
                                        S_SQ_CF_ALLOC_EXPORT_WORD0_ARRAY_BASE(cf->output.array_base) |
-                                       S_SQ_CF_ALLOC_EXPORT_WORD0_TYPE(cf->output.type);
+                                       S_SQ_CF_ALLOC_EXPORT_WORD0_TYPE(cf->output.type) |
+                                       S_SQ_CF_ALLOC_EXPORT_WORD0_INDEX_GPR(cf->output.index_gpr);
                        bc->bytecode[id] = S_SQ_CF_ALLOC_EXPORT_WORD1_BURST_COUNT(cf->output.burst_count - 1) |
                                        S_SQ_CF_ALLOC_EXPORT_WORD1_BARRIER(cf->barrier) |
                                        S_SQ_CF_ALLOC_EXPORT_WORD1_CF_INST(opcode) |
index e062fcb6be8c3338ba027a94a44ef67a281e8776..14ee2c210b5e1c18b9ac9c6e619e2569dcae4d87 100644 (file)
@@ -1525,7 +1525,8 @@ static int r600_bytecode_cf_build(struct r600_bytecode *bc, struct r600_bytecode
                bc->bytecode[id++] = S_SQ_CF_ALLOC_EXPORT_WORD0_RW_GPR(cf->output.gpr) |
                        S_SQ_CF_ALLOC_EXPORT_WORD0_ELEM_SIZE(cf->output.elem_size) |
                        S_SQ_CF_ALLOC_EXPORT_WORD0_ARRAY_BASE(cf->output.array_base) |
-                       S_SQ_CF_ALLOC_EXPORT_WORD0_TYPE(cf->output.type);
+                       S_SQ_CF_ALLOC_EXPORT_WORD0_TYPE(cf->output.type) |
+                       S_SQ_CF_ALLOC_EXPORT_WORD0_INDEX_GPR(cf->output.index_gpr);
                bc->bytecode[id++] = S_SQ_CF_ALLOC_EXPORT_WORD1_BURST_COUNT(cf->output.burst_count - 1) |
                        S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_X(cf->output.swizzle_x) |
                        S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Y(cf->output.swizzle_y) |
@@ -1538,7 +1539,8 @@ static int r600_bytecode_cf_build(struct r600_bytecode *bc, struct r600_bytecode
                bc->bytecode[id++] = S_SQ_CF_ALLOC_EXPORT_WORD0_RW_GPR(cf->output.gpr) |
                        S_SQ_CF_ALLOC_EXPORT_WORD0_ELEM_SIZE(cf->output.elem_size) |
                        S_SQ_CF_ALLOC_EXPORT_WORD0_ARRAY_BASE(cf->output.array_base) |
-                       S_SQ_CF_ALLOC_EXPORT_WORD0_TYPE(cf->output.type);
+                       S_SQ_CF_ALLOC_EXPORT_WORD0_TYPE(cf->output.type) |
+                       S_SQ_CF_ALLOC_EXPORT_WORD0_INDEX_GPR(cf->output.index_gpr);
                bc->bytecode[id++] = S_SQ_CF_ALLOC_EXPORT_WORD1_BURST_COUNT(cf->output.burst_count - 1) |
                        S_SQ_CF_ALLOC_EXPORT_WORD1_BARRIER(cf->barrier) |
                        S_SQ_CF_ALLOC_EXPORT_WORD1_CF_INST(opcode) |
@@ -1963,6 +1965,9 @@ void r600_bytecode_disasm(struct r600_bytecode *bc)
                                                o += print_swizzle(7);
                                }
 
+                               if (cf->output.type == V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_WRITE_IND)
+                                       o += fprintf(stderr, " R%d", cf->output.index_gpr);
+
                                o += print_indent(o, 67);
 
                                fprintf(stderr, " ES:%i ", cf->output.elem_size);
index 3bfbcb282a34058f0307b49ca529381de32ddd6e..4fb0ef06956a8d61c5bad27f492cdb596f82ea15 100644 (file)
@@ -125,6 +125,7 @@ struct r600_bytecode_output {
        unsigned                        swizzle_z;
        unsigned                        swizzle_w;
        unsigned                        burst_count;
+       unsigned                        index_gpr;
 };
 
 struct r600_bytecode_kcache {