On Wed, Apr 13, 2016 at 2:19 PM, Marek Olšák <[email protected]> wrote: > From: Marek Olšák <[email protected]> > > This fixes GS piglit failures after adding SI_PARAM_SHADER_BUFFERS, > which bumped NUM_USER_SGPRS and uncovered this bug on SI. > > If this was fixed in LLVM, these workarounds wouldn't be needed. > > LLVM would have to look at the calling convention to know how many SGPR > inputs are declared, and add VCC and the scratch wave offset (which is > enabled even if we spill SGPRs but not VGPRs, oh well). > --- > src/gallium/drivers/radeonsi/si_shader.c | 11 ++++ > src/gallium/drivers/radeonsi/si_state_shaders.c | 67 > +++++-------------------- > 2 files changed, 23 insertions(+), 55 deletions(-) > > diff --git a/src/gallium/drivers/radeonsi/si_shader.c > b/src/gallium/drivers/radeonsi/si_shader.c > index c58467d..31fae85 100644 > --- a/src/gallium/drivers/radeonsi/si_shader.c > +++ b/src/gallium/drivers/radeonsi/si_shader.c > @@ -6761,6 +6761,16 @@ static bool si_shader_select_ps_parts(struct si_screen > *sscreen, > return true; > } > > +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 += 2; /* scratch wave offset */
Sorry, this should be += 1. Marek _______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
