OSDN Git Service

spirv: Propagate layout decorations to created glsl_types
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 12 Dec 2018 22:07:07 +0000 (16:07 -0600)
committerJason Ekstrand <jason@jlekstrand.net>
Tue, 8 Jan 2019 00:38:30 +0000 (00:38 +0000)
commitbf1a1eed882980a1cd08482386e3a001ce64a5a4
treead641a504f2b72ed480f7a01d7d933f791ad1504
parent6cebeb4f71918aded1ddade5727f79fae83780fd
spirv: Propagate layout decorations to created glsl_types

Instead of just storing the decorations in the vtn_type, propagate them
all the way through to the glsl_type.  For array strides, this means we
need to handle them earlier so we break array stride handling into it's
own function and explicitly call it for both pointer and array types.

Due to type deduplication in the SPIR-V, we may have explicit layout
decorations on all sorts of types that don't actually want them.  In
order to prevent these leaking into unfortunate places in NIR, we
explicitly strip them off before creating NIR variables and when casting
pointers to non-external memory.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
src/compiler/spirv/spirv_to_nir.c
src/compiler/spirv/vtn_cfg.c
src/compiler/spirv/vtn_variables.c