more GN_EXT_QUEUES business
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "vulkan_command_pool.h"
|
||||
#include "output_device/vulkan_output_devices.h"
|
||||
#include "instance/gryphn_instance.h"
|
||||
|
||||
gnReturnCode createCommandPool(gnCommandPool commandPool, gnDevice device, gnCommandPoolInfo info) {
|
||||
commandPool->commandPool = malloc(sizeof(gnPlatformCommandPool));
|
||||
@@ -7,12 +8,12 @@ gnReturnCode createCommandPool(gnCommandPool commandPool, gnDevice device, gnCom
|
||||
VkCommandPoolCreateInfo poolInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
|
||||
.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,
|
||||
.queueFamilyIndex = device->outputDevice->queues[device->outputDevice->graphicsQueueIndex].queueInfo.queueIndex,
|
||||
.queueFamilyIndex = info.queueFamilyIndex,
|
||||
};
|
||||
if (!device->instance->enabledExtensions[GN_EXT_QUEUES]) poolInfo.queueFamilyIndex = device->outputDevice->queues[device->outputDevice->graphicsQueueIndex].queueInfo.queueIndex;
|
||||
|
||||
if (vkCreateCommandPool(device->outputDevice->device, &poolInfo, NULL, &commandPool->commandPool->commandPool) != VK_SUCCESS) {
|
||||
if (vkCreateCommandPool(device->outputDevice->device, &poolInfo, NULL, &commandPool->commandPool->commandPool) != VK_SUCCESS)
|
||||
return GN_FAILED_TO_CREATE_COMMAND_POOL;
|
||||
}
|
||||
|
||||
return GN_SUCCESS;
|
||||
}
|
||||
|
@@ -30,6 +30,11 @@ gnReturnCode createPresentationQueue(gnPresentationQueueHandle presentationQueue
|
||||
createInfo.imageArrayLayers = 1;
|
||||
createInfo.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
|
||||
|
||||
if (device->instance->enabledExtensions[GN_EXT_QUEUES]) {
|
||||
createInfo.imageSharingMode = (presentationInfo.imageSharingMode == GN_SHARING_MODE_CONCURRENT) ? VK_SHARING_MODE_CONCURRENT : VK_SHARING_MODE_EXCLUSIVE;
|
||||
createInfo.queueFamilyIndexCount = presentationInfo.queueFamilyCount;
|
||||
createInfo.pQueueFamilyIndices = presentationInfo.queueFamilies;
|
||||
} else {
|
||||
if (presentationInfo.surface->windowSurface->presentQueueIndex != device->outputDevice->graphicsQueueIndex) {
|
||||
createInfo.imageSharingMode = VK_SHARING_MODE_CONCURRENT;
|
||||
createInfo.queueFamilyIndexCount = 2;
|
||||
@@ -42,6 +47,7 @@ gnReturnCode createPresentationQueue(gnPresentationQueueHandle presentationQueue
|
||||
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;
|
||||
|
@@ -11,6 +11,7 @@ typedef gnFlags gnCommandPoolFlags;
|
||||
|
||||
typedef struct gnCommandPoolInfo {
|
||||
gnCommandPoolFlags flags;
|
||||
uint32_t queueFamilyIndex; // ignored unless GN_EXT_QUEUES is enabled
|
||||
} gnCommandPoolInfo;
|
||||
|
||||
#ifdef GN_REVEAL_IMPL
|
||||
|
@@ -9,9 +9,11 @@ typedef struct gnPresentationQueueInfo {
|
||||
gnUInt2 imageSize;
|
||||
gnWindowSurfaceHandle surface;
|
||||
gnSurfaceFormat format;
|
||||
// gnImageSharingMode imageSharingMode;
|
||||
// uint32_t queueFamilyCount;
|
||||
// uint32_t* queueFamilies;
|
||||
|
||||
// ignored unless GN_EXT_QUEUES is enabled
|
||||
gnImageSharingMode imageSharingMode;
|
||||
uint32_t queueFamilyCount;
|
||||
uint32_t* queueFamilies;
|
||||
} gnPresentationQueueInfo;
|
||||
|
||||
struct gnPlatformPresentationQueue_t;
|
||||
|
Reference in New Issue
Block a user