[Mesa-dev] [PATCH 2/2] nir/inline: Constant-initialize local variables in the callee if needed

Kenneth Graunke kenneth at whitecape.org
Wed Jul 20 17:54:46 UTC 2016


On Friday, July 15, 2016 3:47:40 PM PDT Jason Ekstrand wrote:
> Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
> Cc: "12.0" <mesa-stable at lists.freedesktop.org>
> Cc: Connor Abbott <cwabbott0 at gmail.com>
> ---
>  src/compiler/nir/nir_inline_functions.c | 41 +++++++++++++++++++++++++++++++--
>  1 file changed, 39 insertions(+), 2 deletions(-)
> 
> diff --git a/src/compiler/nir/nir_inline_functions.c b/src/compiler/nir/nir_inline_functions.c
> index c36748d..5e7382a 100644
> --- a/src/compiler/nir/nir_inline_functions.c
> +++ b/src/compiler/nir/nir_inline_functions.c
> @@ -25,6 +25,19 @@
>  #include "nir_builder.h"
>  #include "nir_control_flow.h"
>  
> +static bool
> +deref_apply_constant_initializer(nir_deref_var *deref, void *state)
> +{
> +   struct nir_builder *b = state;
> +
> +   nir_load_const_instr *initializer =
> +      nir_deref_get_const_initializer_load(b->shader, deref);

With the load_const properly added to the instruction list, this is:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

(Jason actually found this bug and already fixed it locally...I didn't
catch it.)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160720/08f7356d/attachment.sig>


More information about the mesa-dev mailing list