From: Marek Olšák Date: Wed, 13 Apr 2016 15:46:23 +0000 (+0200) Subject: radeonsi: don't overwrite the scratch offset in shader prologs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=112291964e27c1e0e570cdff267306b4332af903;p=mesa.git radeonsi: don't overwrite the scratch offset in shader prologs Prologs only look at num_input_sgprs. Reviewed-by: Bas Nieuwenhuizen --- 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); }