nir: Look into uniform structs for samplers when counting num_textures.
authorEric Anholt <eric@anholt.net>
Fri, 30 Mar 2018 23:04:34 +0000 (16:04 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 6 Jun 2018 20:46:55 +0000 (13:46 -0700)
commit833c4046007f22ce1da0e1c2b89e8f1892f8d38e
tree41fc2aed75e84437d8cc83f0d6ecb84942832104
parentf69473a712147c27fefbe83b9beacb251969fd92
nir: Look into uniform structs for samplers when counting num_textures.

mesa/st decides whether to update samplers after a program change based on
whether num_textures is nonzero.  By not counting samplers in a uniform
struct, we would segfault in
KHR-GLES3.shaders.struct.uniform.sampler_vertex if it was run in the same
context after a non-vertex-shader-uniform testcase (as is the case during
a full conformance run).

v2: Implement using two separate pure functions instead of updating
    pointers.

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