diff options
author | Bas Nieuwenhuizen <[email protected]> | 2019-06-29 03:07:03 +0200 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2019-07-01 20:53:33 +0200 |
commit | d7e6541cc720a7d11d678adbeec7143b099127b0 (patch) | |
tree | 8ce6463ac5ec39d0ee9d6c8d4ffb0c0bbd52c35a /src/amd | |
parent | 177c35bf13ca6e0e950802cbea909b149a7bf579 (diff) |
radv: Only allocate supplied number of descriptors when variable.
Fixes: b5e04e9217b "radv: Support allocating variable size descriptor sets."
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111019
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/vulkan/radv_descriptor_set.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_descriptor_set.c b/src/amd/vulkan/radv_descriptor_set.c index bd00f68a3cb..2891808e418 100644 --- a/src/amd/vulkan/radv_descriptor_set.c +++ b/src/amd/vulkan/radv_descriptor_set.c @@ -503,7 +503,13 @@ radv_descriptor_set_create(struct radv_device *device, } set->layout = layout; - uint32_t layout_size = align_u32(layout->size, 32); + uint32_t layout_size = layout->size; + if (variable_count) { + assert(layout->has_variable_descriptors); + layout_size = layout->binding[layout->binding_count - 1].offset + + *variable_count * layout->binding[layout->binding_count - 1].size; + } + layout_size = align_u32(layout_size, 32); if (layout_size) { set->size = layout_size; |