aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2019-07-02 11:32:44 +0200
committerJuan A. Suarez Romero <[email protected]>2019-07-04 10:36:29 +0200
commit50c3dcd2f8a4f3d5114d26a66f1472f618d10e46 (patch)
tree7063e8ed3abdeb70fe28e75a5b8f7ca9ec6a9a5d /src/amd
parent202eb29e5522b7480c33937f9fd5db43774ad381 (diff)
radv: Fix interactions between variable descriptor count and inline uniform blocks.
Fixes: d7e6541cc72 "radv: Only allocate supplied number of descriptors when variable." Reviewed-by: Samuel Pitoiset <[email protected]> (cherry picked from commit 8a053254b81497cb6b0708fe86986e461ee43771)
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/vulkan/radv_descriptor_set.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_descriptor_set.c b/src/amd/vulkan/radv_descriptor_set.c
index 2891808e418..9a6e9cead9c 100644
--- a/src/amd/vulkan/radv_descriptor_set.c
+++ b/src/amd/vulkan/radv_descriptor_set.c
@@ -506,8 +506,12 @@ radv_descriptor_set_create(struct radv_device *device,
uint32_t layout_size = layout->size;
if (variable_count) {
assert(layout->has_variable_descriptors);
+ uint32_t stride = layout->binding[layout->binding_count - 1].size;
+ if (layout->binding[layout->binding_count - 1].type == VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT)
+ stride = 1;
+
layout_size = layout->binding[layout->binding_count - 1].offset +
- *variable_count * layout->binding[layout->binding_count - 1].size;
+ *variable_count * stride;
}
layout_size = align_u32(layout_size, 32);
if (layout_size) {