OSDN Git Service

nir/spirv: Fix atomic counter (multidimensional-)arrays
authorAntia Puentes <apuentes@igalia.com>
Wed, 2 May 2018 20:28:43 +0000 (22:28 +0200)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Tue, 3 Jul 2018 10:41:46 +0000 (12:41 +0200)
commit4110bc4c17990e5b10da6c3dcf8ad6fbd5b99656
tree31f24f68127e5fb572ae3f928c5a655ac79a40ee
parent480d2c56b34667d461962f34d5ace1b279516281
nir/spirv: Fix atomic counter (multidimensional-)arrays

When constructing NIR if we have a SPIR-V uint variable and the
storage class is SpvStorageClassAtomicCounter, we store as NIR's
glsl_type an atomic_uint to reflect the fact that the variable is an
atomic counter.

However, we were tweaking the type only for atomic_uint scalars, we
have to do it as well for atomic_uint arrays and atomic_uint arrays of
arrays of any depth.

Signed-off-by: Antia Puentes <apuentes@igalia.com>
Signed-off-by: Alejandro Piñeiro <apinheiro@igalia.com>
v2: update after deref patches got pushed (Alejandro Piñeiro)
v3: simplify repair_atomic_type (suggested by Timothy Arceri, included
    on the patch by Alejandro)

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/spirv/vtn_variables.c