diff options
author | Dave Airlie <[email protected]> | 2015-12-18 12:25:53 +0000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-12-18 12:26:23 +0000 |
commit | 10773ed2498f1482fcfd8933efdf6797c980491c (patch) | |
tree | 3f0803dcec64a033b5b0276ae4f8f437934b27bd /src/gallium/drivers | |
parent | ea8d4b0f4ec75d6650ffc4182464fa63f532c769 (diff) |
r600/shader: split address get out to a function.
This will be used in the tess shaders.
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
(cherry picked from commit 4d64459a92a4c1a64fb7051fd1320c14c1854dcb)
[Emil Velikov: required by the commit after the next one]
Nominated-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/r600/r600_shader.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index b16900bc698..9cd148a1950 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -598,6 +598,11 @@ static int select_twoside_color(struct r600_shader_ctx *ctx, int front, int back return 0; } +static inline int get_address_file_reg(struct r600_shader_ctx *ctx, int index) +{ + return index > 0 ? ctx->bc->index_reg[index - 1] : ctx->bc->ar_reg; +} + static int vs_add_primid_output(struct r600_shader_ctx *ctx, int prim_id_sid) { int i; @@ -6675,7 +6680,7 @@ static int tgsi_eg_arl(struct r600_shader_ctx *ctx) struct r600_bytecode_alu alu; int r; int i, lasti = tgsi_last_instruction(inst->Dst[0].Register.WriteMask); - unsigned reg = inst->Dst[0].Register.Index > 0 ? ctx->bc->index_reg[inst->Dst[0].Register.Index - 1] : ctx->bc->ar_reg; + unsigned reg = get_address_file_reg(ctx, inst->Dst[0].Register.Index); assert(inst->Dst[0].Register.Index < 3); memset(&alu, 0, sizeof(struct r600_bytecode_alu)); |