summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-11-30 15:10:51 +1000
committerDave Airlie <airlied@redhat.com>2015-12-04 04:03:58 +0000
commite67fbea8acccf74cdd0b5c92d30dbee6b5ded738 (patch)
treed6a353b84034eda3ccc250b443e6ee864071e19f
parent8b3732fb8df707552d4b593c32232e91d75e6225 (diff)
r600/shader: move get_temp and last_instruction helpers up
These are required for tess to be used earlier. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--src/gallium/drivers/r600/r600_shader.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index 4d59af224d1..284eeead3e4 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -354,6 +354,18 @@ static void r600_bytecode_src(struct r600_bytecode_alu_src *bc_src,
const struct r600_shader_src *shader_src,
unsigned chan);
+static int tgsi_last_instruction(unsigned writemask)
+{
+ int i, lasti = 0;
+
+ for (i = 0; i < 4; i++) {
+ if (writemask & (1 << i)) {
+ lasti = i;
+ }
+ }
+ return lasti;
+}
+
static int tgsi_is_supported(struct r600_shader_ctx *ctx)
{
struct tgsi_full_instruction *i = &ctx->parse.FullToken.FullInstruction;
@@ -659,6 +671,11 @@ 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 r600_get_temp(struct r600_shader_ctx *ctx)
+{
+ return ctx->temp_reg + ctx->max_driver_temp_used++;
+}
+
static int vs_add_primid_output(struct r600_shader_ctx *ctx, int prim_id_sid)
{
int i;
@@ -826,11 +843,6 @@ static int tgsi_declaration(struct r600_shader_ctx *ctx)
return 0;
}
-static int r600_get_temp(struct r600_shader_ctx *ctx)
-{
- return ctx->temp_reg + ctx->max_driver_temp_used++;
-}
-
static int allocate_system_value_inputs(struct r600_shader_ctx *ctx, int gpr_offset)
{
struct tgsi_parse_context parse;
@@ -2767,20 +2779,6 @@ static void tgsi_dst(struct r600_shader_ctx *ctx,
}
}
-static int tgsi_last_instruction(unsigned writemask)
-{
- int i, lasti = 0;
-
- for (i = 0; i < 4; i++) {
- if (writemask & (1 << i)) {
- lasti = i;
- }
- }
- return lasti;
-}
-
-
-
static int tgsi_op2_64_params(struct r600_shader_ctx *ctx, bool singledest, bool swap)
{
struct tgsi_full_instruction *inst = &ctx->parse.FullToken.FullInstruction;