OSDN Git Service

anv/descriptor_set: memset anv_descriptor_set_layout
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 25 Aug 2016 09:37:19 +0000 (02:37 -0700)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 1 Sep 2016 10:39:46 +0000 (11:39 +0100)
We hash this data structure so we can't afford to have uninitialized data
even if it is just structure padding.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d316cec1c1e3a77f63332f99883ffeeeb21a6f5e)

src/intel/vulkan/anv_descriptor_set.c

index cf1fe15..4ab1802 100644 (file)
@@ -67,9 +67,8 @@ VkResult anv_CreateDescriptorSetLayout(
    struct anv_sampler **samplers =
       (struct anv_sampler **)&set_layout->binding[max_binding + 1];
 
+   memset(set_layout, 0, sizeof(*set_layout));
    set_layout->binding_count = max_binding + 1;
-   set_layout->shader_stages = 0;
-   set_layout->size = 0;
 
    for (uint32_t b = 0; b <= max_binding; b++) {
       /* Initialize all binding_layout entries to -1 */