radv: disable conditional rendering for vkCmdCopyQueryPoolResults()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 5 Nov 2018 08:54:28 +0000 (09:54 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 7 Nov 2018 10:31:36 +0000 (11:31 +0100)
VK_EXT_conditional_rendering says that copy commands should not be
affected by conditional rendering.

Cc: 18.2 18.3 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_query.c

index 47e7f08001ac414705a69566fde9956545d38a5f..9993b9acd6d2e9bfdeafde725ac5b59d5dc0daa2 100644 (file)
@@ -913,6 +913,7 @@ static void radv_query_shader(struct radv_cmd_buffer *cmd_buffer,
 {
        struct radv_device *device = cmd_buffer->device;
        struct radv_meta_saved_state saved_state;
+       bool old_predicating;
 
        if (!*pipeline) {
                VkResult ret = radv_device_init_meta_query_state_internal(device);
@@ -927,6 +928,12 @@ static void radv_query_shader(struct radv_cmd_buffer *cmd_buffer,
                       RADV_META_SAVE_CONSTANTS |
                       RADV_META_SAVE_DESCRIPTORS);
 
+       /* VK_EXT_conditional_rendering says that copy commands should not be
+        * affected by conditional rendering.
+        */
+       old_predicating = cmd_buffer->state.predicating;
+       cmd_buffer->state.predicating = false;
+
        struct radv_buffer dst_buffer = {
                .bo = dst_bo,
                .offset = dst_offset,
@@ -1005,6 +1012,9 @@ static void radv_query_shader(struct radv_cmd_buffer *cmd_buffer,
 
        radv_unaligned_dispatch(cmd_buffer, count, 1, 1);
 
+       /* Restore conditional rendering. */
+       cmd_buffer->state.predicating = old_predicating;
+
        radv_meta_restore(&saved_state, cmd_buffer);
 }