radv: don't check for inline uniform blocks in radv_CmdPushDescriptorSetKHR() in release builds

Submitted by Matthias Lorenz on June 16, 2019, 1:55 p.m.

Details

Message ID 20190616135550.10282-1-oschowa@web.de
State New
Headers show
Series "radv: don't check for inline uniform blocks in radv_CmdPushDescriptorSetKHR() in release builds" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Matthias Lorenz June 16, 2019, 1:55 p.m.
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(+)

--
2.22.0

Patch hide | download patch | download mbox

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);
 	}
+#endif

 	radv_update_descriptor_sets(cmd_buffer->device, cmd_buffer,
 	                            radv_descriptor_set_to_handle(push_set),

Comments

On 6/16/19 3:55 PM, Matthias Lorenz wrote:
> 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];
MAYBE_UNUSED is better.
>   		assert(writeset->descriptorType != VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT);
>   	}
> +#endif
>
>   	radv_update_descriptor_sets(cmd_buffer->device, cmd_buffer,
>   	                            radv_descriptor_set_to_handle(push_set),
> --
> 2.22.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev