OSDN Git Service

spirv: handle OpUndef as part of the variable parsing pass
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 26 Jan 2017 16:57:25 +0000 (16:57 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 3 Feb 2017 11:08:55 +0000 (11:08 +0000)
commit939c0c82e50e2f73f2d5ea0ac5af3d5e5cb36a93
tree45395f2a01ddee00ff0d8148bb938c1d91902441
parent7c663b1d5efe8c8861fb0b137d40e141c2bc3589
spirv: handle OpUndef as part of the variable parsing pass

Looking at the following bit of SPIRV shader :

...
%zero        = OpConstant %i32 0
%ivec3_0     = OpConstantComposite %ivec3 %zero %zero %zero
%vec3_undef  = OpUndef %ivec3
%sc_0        = OpSpecConstant %i32 0
%sc_1        = OpSpecConstant %i32 0
%sc_2        = OpSpecConstant %i32 0
...

Our compiler currently stops parsing variables & types on the OpUndef
and switches to instructions, leaving the following sc_[0-2] variables
untreated.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "17.0 13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit df7063cba35ea273827ba60f643596cd80539458)
src/compiler/spirv/spirv_to_nir.c
src/compiler/spirv/vtn_variables.c