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
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to