anv/descriptor_set: Fix binding partly undefined descriptor sets
authorNanley Chery <nanley.g.chery@intel.com>
Tue, 12 Jul 2016 00:33:24 +0000 (17:33 -0700)
committerNanley Chery <nanley.g.chery@intel.com>
Fri, 15 Jul 2016 17:35:40 +0000 (10:35 -0700)
commitfd16e6432104389fa659bb1d011aa6fb82952737
tree09e8a96d9651657f3c24fbd1f6c044a05a064085
parent50a669de4e216d2e3bea3ec1148c7e79f77ecb27
anv/descriptor_set: Fix binding partly undefined descriptor sets

Section 13.2.3. of the Vulkan spec requires that implementations be able to
bind sparsely-defined Descriptor Sets without any errors or exceptions.

When binding a descriptor set that contains a dynamic buffer binding/descriptor,
the driver attempts to dereference the descriptor's buffer_view field if it is
non-NULL. It currently segfaults on undefined descriptors as this field is never
zero-initialized. Zero undefined descriptors to avoid segfaulting. This
solution was suggested by Jason Ekstrand.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96850
Cc: 12.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_descriptor_set.c