mesa/src/compiler/spirv
Caio Marcelo de Oliveira Filho 10b3eecd36 spirv: Don't remove variables used by resource indexing intrinsics
In Vulkan, for some variable modes, the generated NIR will have derefs
pointing to resource index intrinsics instead of the variable.  This
was letting nir_remove_dead_variables pass remove those variables,
which would lose information relevant for later passes after
spirv2nir.

Add a set to keep track of such variables and prevent them to be
removed when producing the NIR output.

Issue reported by Rhys.

Fixes: c4c9c780b1 ("spirv: Remove more dead variables")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8706>
2021-01-26 05:58:34 +00:00
..
tests spirv: Initialize spirv_test member shader. 2020-09-09 22:24:09 +00:00
gl_spirv.c spirv: workaround setjmp/longjmp crash on MinGW 2020-11-18 13:53:36 +00:00
GLSL.ext.AMD.h spirv: import AMD extensions header from glslang 2018-03-07 23:09:58 +01:00
GLSL.std.450.h spirv: bump headers to SPIRV 1.1 2017-01-25 17:22:23 +00:00
meson.build spirv: add and use a generator id enum 2020-10-12 11:07:38 +00:00
nir_load_libclc.c nir_load_libclc: Mark libclc shader as internal 2020-11-18 04:05:37 +00:00
nir_lower_libclc.c spirv: Move nir_lower_libclc to src/compiler/spirv 2020-10-07 21:52:04 +00:00
nir_spirv.h spirv: Implement OpArrayLength for OpenGL 2020-12-18 17:13:46 +00:00
OpenCL.std.h spirv: Update the OpenCL.std.h header 2019-06-04 12:12:51 -07:00
spir-v.xml spirv: Update headers and metadata from latest Khronos commit 2020-10-15 21:40:09 +00:00
spirv.core.grammar.json spirv: Update JSON and headers from Khronos main 2020-11-24 15:47:06 +00:00
spirv.h spirv: Update JSON and headers from Khronos main 2020-11-24 15:47:06 +00:00
spirv2nir.c spirv2nir: Add --opengl (-g) argument for OpenGL SPIR-V 2020-12-22 09:34:00 -08:00
spirv_info.h spirv: vtn_fail with a nice message on unsupported rounding modes 2020-09-25 01:43:28 +00:00
spirv_info_c.py spirv: vtn_fail with a nice message on unsupported rounding modes 2020-09-25 01:43:28 +00:00
spirv_to_nir.c spirv: Don't remove variables used by resource indexing intrinsics 2021-01-26 05:58:34 +00:00
vtn_alu.c spirv: handle NoContraction in GLSL450 alu ops 2021-01-23 01:39:09 +00:00
vtn_amd.c spirv: use intrinsic builders 2020-11-26 17:50:38 +00:00
vtn_cfg.c spirv: use intrinsic builders 2020-11-26 17:50:38 +00:00
vtn_gather_types_c.py spirv: Handle instruction aliases in vtn_gather_types 2020-04-24 05:56:05 +00:00
vtn_generator_ids_h.py android: fix SPIR-V -> NIR build 2020-10-12 22:26:05 +00:00
vtn_glsl450.c spirv: handle NoContraction in GLSL450 alu ops 2021-01-23 01:39:09 +00:00
vtn_opencl.c nir/vtn: Implement printf opcode in terms of intrinsic (v9) 2020-12-29 09:07:23 +10:00
vtn_private.h spirv: Don't remove variables used by resource indexing intrinsics 2021-01-26 05:58:34 +00:00
vtn_subgroup.c spirv: Implement SpvCapabilitySubgroupShuffleINTEL from SPV_INTEL_subgroups 2020-11-04 20:24:48 +00:00
vtn_variables.c spirv: Don't remove variables used by resource indexing intrinsics 2021-01-26 05:58:34 +00:00