summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/ir3/ir3_group.c
diff options
context:
space:
mode:
authorRob Clark <robclark@freedesktop.org>2015-05-25 10:30:54 -0400
committerRob Clark <robclark@freedesktop.org>2015-06-21 07:54:04 -0400
commitc8fb5f8a011e1db78af3ceaf91c5cb3b1acaee14 (patch)
treee18b37a652bb3a203412df53f5a9c0375755e650 /src/gallium/drivers/freedreno/ir3/ir3_group.c
parentd52fb2f5ad828f879286b9068023b82b9897bc17 (diff)
downloadexternal_mesa3d-c8fb5f8a011e1db78af3ceaf91c5cb3b1acaee14.tar.gz
external_mesa3d-c8fb5f8a011e1db78af3ceaf91c5cb3b1acaee14.tar.bz2
external_mesa3d-c8fb5f8a011e1db78af3ceaf91c5cb3b1acaee14.zip
freedreno/ir3: move inputs/outputs to shader
These belong in the shader, rather than the block. Mostly a lot of churn and nothing too interesting. But splitting this out from the rest of ir3_block reshuffling to cut down the noise in the later patch. Signed-off-by: Rob Clark <robclark@freedesktop.org>
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3/ir3_group.c')
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_group.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_group.c b/src/gallium/drivers/freedreno/ir3/ir3_group.c
index d744477aad..85d0948fa9 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_group.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_group.c
@@ -99,7 +99,8 @@ static struct ir3_instruction *instr_get(void *arr, int idx)
{
return ssa(((struct ir3_instruction *)arr)->regs[idx+1]);
}
-static void instr_insert_mov(void *arr, int idx, struct ir3_instruction *instr)
+static void
+instr_insert_mov(void *arr, int idx, struct ir3_instruction *instr)
{
((struct ir3_instruction *)arr)->regs[idx+1]->instr =
ir3_MOV(instr->block, instr, TYPE_F32);
@@ -107,7 +108,8 @@ static void instr_insert_mov(void *arr, int idx, struct ir3_instruction *instr)
static struct group_ops instr_ops = { instr_get, instr_insert_mov };
-static void group_n(struct group_ops *ops, void *arr, unsigned n)
+static void
+group_n(struct group_ops *ops, void *arr, unsigned n)
{
unsigned i, j;
@@ -170,7 +172,8 @@ restart:
}
}
-static void instr_find_neighbors(struct ir3_instruction *instr)
+static void
+instr_find_neighbors(struct ir3_instruction *instr)
{
struct ir3_instruction *src;
@@ -189,7 +192,8 @@ static void instr_find_neighbors(struct ir3_instruction *instr)
* we need to insert dummy/padding instruction for grouping, and
* then take it back out again before anyone notices.
*/
-static void pad_and_group_input(struct ir3_instruction **input, unsigned n)
+static void
+pad_and_group_input(struct ir3_instruction **input, unsigned n)
{
int i, mask = 0;
struct ir3_block *block = NULL;
@@ -214,7 +218,8 @@ static void pad_and_group_input(struct ir3_instruction **input, unsigned n)
}
}
-static void block_find_neighbors(struct ir3_block *block)
+static void
+find_neighbors(struct ir3 *ir)
{
unsigned i;
@@ -232,22 +237,23 @@ static void block_find_neighbors(struct ir3_block *block)
* This logic won't quite cut it if we don't align smaller
* on vec4 boundaries
*/
- for (i = 0; i < block->ninputs; i += 4)
- pad_and_group_input(&block->inputs[i], 4);
- for (i = 0; i < block->noutputs; i += 4)
- group_n(&arr_ops_out, &block->outputs[i], 4);
+ for (i = 0; i < ir->ninputs; i += 4)
+ pad_and_group_input(&ir->inputs[i], 4);
+ for (i = 0; i < ir->noutputs; i += 4)
+ group_n(&arr_ops_out, &ir->outputs[i], 4);
- for (i = 0; i < block->noutputs; i++) {
- if (block->outputs[i]) {
- struct ir3_instruction *instr = block->outputs[i];
+ for (i = 0; i < ir->noutputs; i++) {
+ if (ir->outputs[i]) {
+ struct ir3_instruction *instr = ir->outputs[i];
instr_find_neighbors(instr);
}
}
}
-void ir3_block_group(struct ir3_block *block)
+void
+ir3_group(struct ir3 *ir)
{
- ir3_clear_mark(block->shader);
- block_find_neighbors(block);
+ ir3_clear_mark(ir->block->shader);
+ find_neighbors(ir);
}