diff options
author | Bas Nieuwenhuizen <[email protected]> | 2019-06-29 03:07:03 +0200 |
---|---|---|
committer | Juan A. Suarez Romero <[email protected]> | 2019-07-02 09:53:58 +0200 |
commit | 334f0d3ead6d92d19a545171bfa509ab53e8df9b (patch) | |
tree | ced6e043211a0ee35317b54e656c2c8b57b662bb /src/amd | |
parent | 515f4b2f20086abf8170c5b9dd56dd9cb19cccdb (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]>
(cherry picked from commit d7e6541cc720a7d11d678adbeec7143b099127b0)
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; |