[Mesa-dev] [PATCH v2] radv: assert on inline uniform blocks in radv_CmdPushDescriptorSetKHR()

Samuel Iglesias Gonsálvez siglesias at igalia.com
Tue Jun 11 14:03:37 UTC 2019

According to the Vulkan spec, inline uniform blocks are not allowed
to be updated through vkCmdPushDescriptorSetKHR().

There are these spec quotes from "13.2.1. Descriptor Set Layout"
that are relevant for this case:

 that descriptor sets must not be allocated using this layout, and
 descriptors are instead pushed by vkCmdPushDescriptorSetKHR."

"If flags contains
 elements of pBindings must not have a descriptorType of

There is no explicit mention in vkCmdPushDescriptorSetKHR() to forbid
this case but it is implied in the creation of the descriptor set
layout as aforementioned.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
 src/amd/vulkan/radv_cmd_buffer.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 3faaf94eb99..d69bec60bb8 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -3245,6 +3245,14 @@ void radv_CmdPushDescriptorSetKHR(
+	/* Check that there are no inline uniform block updates when calling vkCmdPushDescriptorSetKHR()
+	 * because it is invalid, according to Vulkan spec.
+	 */
+	for (int i = 0; i < descriptorWriteCount; i++) {
+		const VkWriteDescriptorSet *writeset = &pDescriptorWrites[i];
+		assert(writeset->descriptorType != VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT);
+	}
 	radv_update_descriptor_sets(cmd_buffer->device, cmd_buffer,
 	                            descriptorWriteCount, pDescriptorWrites, 0, NULL);

More information about the mesa-dev mailing list