nir/spirv: Fix assert when unsampled OpTypeImage has unknown 'Depth'
authorXavier Bouchoux <xavierb@gmail.com>
Mon, 15 Oct 2018 14:24:29 +0000 (16:24 +0200)
committerXavier Bouchoux <xavierb@gmail.com>
Mon, 11 Mar 2019 22:28:39 +0000 (23:28 +0100)
commitc5236fc6e299225a94234ea5e381679ffbd36227
tree48c60b1e33647da8aec0fbe7a9066652aa3d9ecf
parentd75f84cb6521c323092f50af41bce435d515a647
nir/spirv: Fix assert when unsampled OpTypeImage has unknown 'Depth'

'dxc' hlsl-to-spirv compiler appears to emit 2 (Unknown) in the depth field,
when the image is not sampled and the value is not needed.

Previously, shaders failed with:

SPIR-V parsing FAILED:
    In file ../src/compiler/spirv/spirv_to_nir.c:1412
    !is_shadow
    632 bytes into the SPIR-V binary

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/spirv/spirv_to_nir.c