summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-04-13 17:46:23 +0200
committerMarek Olšák <[email protected]>2016-04-14 17:00:14 +0200
commit112291964e27c1e0e570cdff267306b4332af903 (patch)
tree31d58186aa4458febc3cc58cb4ae1065732d7060 /src/gallium/drivers/radeonsi
parentffe44d0283e2a987d2083b75e045316ac2898c40 (diff)
radeonsi: don't overwrite the scratch offset in shader prologs
Prologs only look at num_input_sgprs. Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index e180fc89d51..c26960b1ca3 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -5839,6 +5839,10 @@ int si_compile_tgsi_shader(struct si_screen *sscreen,
radeon_llvm_dispose(&ctx.radeon_bld);
+ /* Add the scratch offset to input SGPRs. */
+ if (shader->config.scratch_bytes_per_wave)
+ shader->info.num_input_sgprs += 1; /* scratch byte offset */
+
/* Calculate the number of fragment input VGPRs. */
if (ctx.type == TGSI_PROCESSOR_FRAGMENT) {
shader->info.num_input_vgprs = 0;
@@ -6765,9 +6769,6 @@ static void si_fix_num_sgprs(struct si_shader *shader)
{
unsigned min_sgprs = shader->info.num_input_sgprs + 2; /* VCC */
- if (shader->config.scratch_bytes_per_wave)
- min_sgprs += 1; /* scratch wave offset */
-
shader->config.num_sgprs = MAX2(shader->config.num_sgprs, min_sgprs);
}