summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_wsi.c
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2017-04-03 21:33:51 +0200
committerBas Nieuwenhuizen <[email protected]>2017-04-03 23:00:07 +0200
commitd64f689f616580344b512235dac3ca9673e83f88 (patch)
tree2c41126a120be7230913ef4570c0e7e096aecd8e /src/amd/vulkan/radv_wsi.c
parent0817110969e35eb265dc41fc5fd5d2fe2236db17 (diff)
radv: Enable VK_KHR_incremental_present.
Just enabling the driver-independent implementation that Jason did. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_wsi.c')
-rw-r--r--src/amd/vulkan/radv_wsi.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c
index 8b66095b263..b8999f4eb02 100644
--- a/src/amd/vulkan/radv_wsi.c
+++ b/src/amd/vulkan/radv_wsi.c
@@ -26,6 +26,7 @@
#include "radv_private.h"
#include "radv_meta.h"
#include "wsi_common.h"
+#include "util/vk_util.h"
static const struct wsi_callbacks wsi_cbs = {
.get_phys_device_format_properties = radv_GetPhysicalDeviceFormatProperties,
@@ -452,9 +453,14 @@ VkResult radv_QueuePresentKHR(
RADV_FROM_HANDLE(radv_queue, queue, _queue);
VkResult result = VK_SUCCESS;
+ const VkPresentRegionsKHR *regions =
+ vk_find_struct_const(pPresentInfo->pNext, PRESENT_REGIONS_KHR);
+
for (uint32_t i = 0; i < pPresentInfo->swapchainCount; i++) {
RADV_FROM_HANDLE(wsi_swapchain, swapchain, pPresentInfo->pSwapchains[i]);
struct radeon_winsys_cs *cs;
+ const VkPresentRegionKHR *region = NULL;
+
assert(radv_device_from_handle(swapchain->device) == queue->device);
if (swapchain->fences[0] == VK_NULL_HANDLE) {
result = radv_CreateFence(radv_device_to_handle(queue->device),
@@ -484,9 +490,12 @@ VkResult radv_QueuePresentKHR(
pPresentInfo->waitSemaphoreCount, NULL, 0, false, base_fence);
fence->submitted = true;
+ if (regions && regions->pRegions)
+ region = &regions->pRegions[i];
+
result = swapchain->queue_present(swapchain,
pPresentInfo->pImageIndices[i],
- NULL);
+ region);
/* TODO: What if one of them returns OUT_OF_DATE? */
if (result != VK_SUCCESS)
return result;