[Mesa-dev] [PATCH] radv: don't check for inline uniform blocks in radv_CmdPushDescriptorSetKHR() in release builds

Matthias Lorenz oschowa at web.de
Sun Jun 16 13:55:50 UTC 2019

When NDEBUG is defined, the loop is a no-op, so wrap it in #ifndef
to avoid unused variable warnings in release builds.

Fixes: 32e1d85cb699 radv: assert on inline uniform blocks in radv_CmdPushDescriptorSetKHR()
 src/amd/vulkan/radv_cmd_buffer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 2fd5f8b7a07..184c61e7e58 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -3248,10 +3248,12 @@ void radv_CmdPushDescriptorSetKHR(
 	/* Check that there are no inline uniform block updates when calling vkCmdPushDescriptorSetKHR()
 	 * because it is invalid, according to Vulkan spec.
+#ifndef NDEBUG
 	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,

More information about the mesa-dev mailing list