radv: mark the fence as submitted and signalled in vkAcquireNextImageKHR
authorFredrik Höglund <fredrik@kde.org>
Tue, 25 Oct 2016 18:31:41 +0000 (20:31 +0200)
committerDave Airlie <airlied@redhat.com>
Wed, 26 Oct 2016 02:25:35 +0000 (12:25 +1000)
This stops the debug layers from complaining when fences are used to
throttle image acquisition.

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_private.h
src/amd/vulkan/radv_wsi.c

index af5a151f03316d7cde172974a3c75a8cb3f3eb36..7410bbcf456d9cd8a6a58d7794f21fa510c2953b 100644 (file)
 #include "util/debug.h"
 struct radv_dispatch_table dtable;
 
-struct radv_fence {
-       struct radeon_winsys_fence *fence;
-       bool submitted;
-       bool signalled;
-};
-
 static VkResult
 radv_physical_device_init(struct radv_physical_device *device,
                          struct radv_instance *instance,
index caf27f2c2de46eafb15ecd38e894ac621eb3157a..cfdda365480147604470cc12b933c45a0619166e 100644 (file)
@@ -1206,6 +1206,13 @@ void radv_initialise_cmask(struct radv_cmd_buffer *cmd_buffer,
                           struct radv_image *image, uint32_t value);
 void radv_initialize_dcc(struct radv_cmd_buffer *cmd_buffer,
                         struct radv_image *image, uint32_t value);
+
+struct radv_fence {
+       struct radeon_winsys_fence *fence;
+       bool submitted;
+       bool signalled;
+};
+
 #define RADV_DEFINE_HANDLE_CASTS(__radv_type, __VkType)                \
                                                                \
        static inline struct __radv_type *                      \
index 948be63c2c0bb40444ef6ddf8ba2e625938e5f24..a946bd4a8c5ad6cf1b9ef1be706571e6e7f3d373 100644 (file)
@@ -318,13 +318,21 @@ VkResult radv_AcquireNextImageKHR(
        VkSwapchainKHR                               _swapchain,
        uint64_t                                     timeout,
        VkSemaphore                                  semaphore,
-       VkFence                                      fence,
+       VkFence                                      _fence,
        uint32_t*                                    pImageIndex)
 {
        RADV_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain);
+       RADV_FROM_HANDLE(radv_fence, fence, _fence);
 
-       return swapchain->acquire_next_image(swapchain, timeout, semaphore,
-                                            pImageIndex);
+       VkResult result = swapchain->acquire_next_image(swapchain, timeout, semaphore,
+                                                       pImageIndex);
+
+       if (fence && result == VK_SUCCESS) {
+               fence->submitted = true;
+               fence->signalled = true;
+       }
+
+       return result;
 }
 
 VkResult radv_QueuePresentKHR(