diff --git a/projects/apis/vulkan/src/presentation_queue/vulkan_presentation_queue.c b/projects/apis/vulkan/src/presentation_queue/vulkan_presentation_queue.c index 5ab52d6..ee2e83c 100644 --- a/projects/apis/vulkan/src/presentation_queue/vulkan_presentation_queue.c +++ b/projects/apis/vulkan/src/presentation_queue/vulkan_presentation_queue.c @@ -30,12 +30,18 @@ gnReturnCode createPresentationQueue(gnPresentationQueueHandle presentationQueue createInfo.imageArrayLayers = 1; createInfo.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; - if (presentationInfo.imageSharingMode == GN_SHARING_MODE_EXCLUSIVE) - createInfo.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE; - else + if (presentationInfo.surface->windowSurface->presentQueueIndex != device->outputDevice->graphicsQueueIndex) { createInfo.imageSharingMode = VK_SHARING_MODE_CONCURRENT; - createInfo.queueFamilyIndexCount = 1; - createInfo.pQueueFamilyIndices = &device->outputDevice->queues[presentationInfo.surface->windowSurface->presentQueueIndex].queueInfo.queueIndex; + createInfo.queueFamilyIndexCount = 2; + createInfo.pQueueFamilyIndices = (uint32_t[]){ + device->outputDevice->queues[presentationInfo.surface->windowSurface->presentQueueIndex].queueInfo.queueIndex, + device->outputDevice->queues[device->outputDevice->graphicsQueueIndex].queueInfo.queueIndex + }; + } else { + createInfo.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE; + createInfo.queueFamilyIndexCount = 1; + createInfo.pQueueFamilyIndices = &device->outputDevice->queues[presentationInfo.surface->windowSurface->presentQueueIndex].queueInfo.queueIndex; + } createInfo.preTransform = details.capabilities.currentTransform; createInfo.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; createInfo.presentMode = presentMode; diff --git a/projects/core/src/presentation_queue/gryphn_presentation_queue.h b/projects/core/src/presentation_queue/gryphn_presentation_queue.h index f568694..39756a9 100644 --- a/projects/core/src/presentation_queue/gryphn_presentation_queue.h +++ b/projects/core/src/presentation_queue/gryphn_presentation_queue.h @@ -9,7 +9,7 @@ typedef struct gnPresentationQueueInfo { gnUInt2 imageSize; gnWindowSurfaceHandle surface; gnSurfaceFormat format; - gnImageSharingMode imageSharingMode; + // gnImageSharingMode imageSharingMode; // uint32_t queueFamilyCount; // uint32_t* queueFamilies; } gnPresentationQueueInfo;