diff options
author | Jason Ekstrand <[email protected]> | 2015-12-15 16:24:19 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-12-15 16:24:22 -0800 |
commit | d61ff1ed0827df87b811862cf4e0d2985c075aa7 (patch) | |
tree | d60890457268d025ced3eaa825e785333a16e10f /src/vulkan | |
parent | 28c4ef9d6ce63b03c5849332ed93ada4a563ecee (diff) |
anv/descriptor_set: Initialize immutable_samplers to NULL
Previously this wasn't a problem. However, with the new API update,
descriptor sets can now be sparse so the client doesn't have to provide an
entry for every binding. This means that it's possible for a binding to be
uninitialized other than the memset. In that case, we want to have a null
array of immutable samplers.
Diffstat (limited to 'src/vulkan')
-rw-r--r-- | src/vulkan/anv_descriptor_set.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/vulkan/anv_descriptor_set.c b/src/vulkan/anv_descriptor_set.c index a7b6b773012..904051b4f13 100644 --- a/src/vulkan/anv_descriptor_set.c +++ b/src/vulkan/anv_descriptor_set.c @@ -70,9 +70,12 @@ VkResult anv_CreateDescriptorSetLayout( set_layout->shader_stages = 0; set_layout->size = 0; - /* Initialize all binding_layout entries to -1 */ - memset(set_layout->binding, -1, - (max_binding + 1) * sizeof(set_layout->binding[0])); + for (uint32_t b = 0; b <= max_binding; b++) { + /* Initialize all binding_layout entries to -1 */ + memset(&set_layout->binding[b], -1, sizeof(set_layout->binding[b])); + + set_layout->binding[b].immutable_samplers = NULL; + } /* Initialize all samplers to 0 */ memset(samplers, 0, immutable_sampler_count * sizeof(*samplers)); |