summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFredrik Höglund <fredrik@kde.org>2016-10-25 20:31:41 +0200
committerEmil Velikov <emil.l.velikov@gmail.com>2016-10-27 11:17:55 +0100
commit8ec30b87c0f4a7b7fb7adc86ce2429b40b8b557d (patch)
tree2ed705b598ef7ad032407784f29a8a05a657aa49
parentcc5995d9e65fc10703304744a9e58e1a518ad88c (diff)
downloadexternal_mesa3d-8ec30b87c0f4a7b7fb7adc86ce2429b40b8b557d.zip
external_mesa3d-8ec30b87c0f4a7b7fb7adc86ce2429b40b8b557d.tar.gz
external_mesa3d-8ec30b87c0f4a7b7fb7adc86ce2429b40b8b557d.tar.bz2
radv: mark the fence as submitted and signalled in vkAcquireNextImageKHR
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> (cherry picked from commit 0a153f4ee472f8f17575bbfe05f1c96fb5ecf1ea)
-rw-r--r--src/amd/vulkan/radv_device.c6
-rw-r--r--src/amd/vulkan/radv_private.h7
-rw-r--r--src/amd/vulkan/radv_wsi.c14
3 files changed, 18 insertions, 9 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index af5a151..7410bbc 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -44,12 +44,6 @@
#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,
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index caf27f2..cfdda36 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -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 * \
diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c
index 948be63..a946bd4 100644
--- a/src/amd/vulkan/radv_wsi.c
+++ b/src/amd/vulkan/radv_wsi.c
@@ -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(