8002493cec
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
60 lines
2.4 KiB
Diff
60 lines
2.4 KiB
Diff
From 5394a872f30022f64e6b2b58ef983b1fe5f6c08d Mon Sep 17 00:00:00 2001
|
|
From: Rob Clark <robclark@freedesktop.org>
|
|
Date: Tue, 20 Aug 2013 13:54:01 -0400
|
|
Subject: [PATCH 08/17] freedreno/a3xx/compiler: use max_reg rather than
|
|
file_count
|
|
|
|
Our current (rather naive) register assignment is based on mapping
|
|
different register files (INPUT, OUTPUT, TEMP, CONST, etc) based on the
|
|
max register index of the preceding file. But in some cases, the lowest
|
|
used register in a file might not be zero. In which case
|
|
file_count[file] != file_max[file] + 1.
|
|
|
|
Signed-off-by: Rob Clark <robclark@freedesktop.org>
|
|
---
|
|
src/gallium/drivers/freedreno/a3xx/fd3_compiler.c | 14 +++++++-------
|
|
1 file changed, 7 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_compiler.c b/src/gallium/drivers/freedreno/a3xx/fd3_compiler.c
|
|
index e2c7853..dc5c873 100644
|
|
--- a/src/gallium/drivers/freedreno/a3xx/fd3_compiler.c
|
|
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_compiler.c
|
|
@@ -159,19 +159,19 @@ compile_init(struct fd3_compile_context *ctx, struct fd3_shader_stateobj *so,
|
|
/* Immediates go after constants: */
|
|
ctx->base_reg[TGSI_FILE_CONSTANT] = 0;
|
|
ctx->base_reg[TGSI_FILE_IMMEDIATE] =
|
|
- ctx->info.file_count[TGSI_FILE_CONSTANT];
|
|
+ ctx->info.file_max[TGSI_FILE_CONSTANT] + 1;
|
|
|
|
/* Temporaries after outputs after inputs: */
|
|
ctx->base_reg[TGSI_FILE_INPUT] = 0;
|
|
ctx->base_reg[TGSI_FILE_OUTPUT] =
|
|
- ctx->info.file_count[TGSI_FILE_INPUT];
|
|
+ ctx->info.file_max[TGSI_FILE_INPUT] + 1;
|
|
ctx->base_reg[TGSI_FILE_TEMPORARY] =
|
|
- ctx->info.file_count[TGSI_FILE_INPUT] +
|
|
- ctx->info.file_count[TGSI_FILE_OUTPUT];
|
|
+ ctx->info.file_max[TGSI_FILE_INPUT] + 1 +
|
|
+ ctx->info.file_max[TGSI_FILE_OUTPUT] + 1;
|
|
|
|
so->first_immediate = ctx->base_reg[TGSI_FILE_IMMEDIATE];
|
|
- ctx->immediate_idx = 4 * (ctx->info.file_count[TGSI_FILE_CONSTANT] +
|
|
- ctx->info.file_count[TGSI_FILE_IMMEDIATE]);
|
|
+ ctx->immediate_idx = 4 * (ctx->info.file_max[TGSI_FILE_CONSTANT] + 1 +
|
|
+ ctx->info.file_max[TGSI_FILE_IMMEDIATE] + 1);
|
|
|
|
ret = tgsi_parse_init(&ctx->parser, tokens);
|
|
if (ret != TGSI_PARSE_OK)
|
|
@@ -309,7 +309,7 @@ get_internal_temp(struct fd3_compile_context *ctx,
|
|
/* assign next temporary: */
|
|
n = ctx->num_internal_temps++;
|
|
|
|
- tmp_dst->Index = ctx->info.file_count[TGSI_FILE_TEMPORARY] + n;
|
|
+ tmp_dst->Index = ctx->info.file_max[TGSI_FILE_TEMPORARY] + n + 1;
|
|
|
|
src_from_dst(tmp_src, tmp_dst);
|
|
}
|
|
--
|
|
1.8.4.2
|
|
|