summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/amd/vulkan/radv_descriptor_set.c8
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;