From 7536af670b7501228628a8c90f9e8456b5aec9e1 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Wed, 27 Feb 2019 18:26:07 +1100 Subject: glsl: fix shader cache for packed param list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some types of params such as some builtins are always padded. We need to keep track of this so we can restore the list correctly. Here we also remove a couple of cache entries that are not actually required as they get rebuilt by the _mesa_add_parameter() calls. This patch fixes a bunch of arb_texture_multisample and arb_sample_shading piglit tests for the radeonsi NIR backend. Fixes: edded1237607 ("mesa: rework ParameterList to allow packing") Reviewed-by: Marek Olšák --- src/mesa/program/prog_parameter.c | 1 + src/mesa/program/prog_parameter.h | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'src/mesa/program') diff --git a/src/mesa/program/prog_parameter.c b/src/mesa/program/prog_parameter.c index 62f31f205af..2f3520bf750 100644 --- a/src/mesa/program/prog_parameter.c +++ b/src/mesa/program/prog_parameter.c @@ -275,6 +275,7 @@ _mesa_add_parameter(struct gl_program_parameter_list *paramList, p->Name = strdup(name ? name : ""); p->Type = type; p->Size = size; + p->Padded = pad_and_align; p->DataType = datatype; paramList->ParameterValueOffset[oldNum] = oldValNum; diff --git a/src/mesa/program/prog_parameter.h b/src/mesa/program/prog_parameter.h index 78c9909f5cc..57050042012 100644 --- a/src/mesa/program/prog_parameter.h +++ b/src/mesa/program/prog_parameter.h @@ -104,6 +104,12 @@ struct gl_program_parameter * A sequence of STATE_* tokens and integers to identify GL state. */ gl_state_index16 StateIndexes[STATE_LENGTH]; + + /** + * We need to keep track of whether the param is padded for use in the + * shader cache. + */ + bool Padded; }; -- cgit v1.2.3