diff --git a/src/renderer.cpp b/src/renderer.cpp index 6249073..076074a 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -156,17 +156,17 @@ void Renderer::createLogicalDevice() { VkQueueFamilyProperties* queueFamilyProperties = new VkQueueFamilyProperties[queueFamilyPropertiesCount]; vkGetPhysicalDeviceQueueFamilyProperties(physicalDevice_, &queueFamilyPropertiesCount, queueFamilyProperties); - - uint32_t graphicsFamilyIndex = 0; - + for(uint32_t i = 0; i < queueFamilyPropertiesCount; i++) { if(queueFamilyProperties[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) - graphicsFamilyIndex = i; + queueIndices.graphics = i; } delete[] queueFamilyProperties; - const std::set queueFamilyIndices = {graphicsFamilyIndex}; + queueIndices.presentation = queueIndices.graphics; //FIXME: this may not always be true!! + + const std::set queueFamilyIndices = {queueIndices.graphics}; std::vector deviceQueueCreateInfos; for(auto queueFamilyIndex : queueFamilyIndices) { const float priority = 1.0f; @@ -191,5 +191,5 @@ void Renderer::createLogicalDevice() { vkCreateDevice(physicalDevice_, &deviceCreateInfo, nullptr, &device_); - vkGetDeviceQueue(device_, graphicsFamilyIndex, 0, &graphicsQueue_); + vkGetDeviceQueue(device_, queueIndices.graphics, 0, &graphicsQueue_); }