Archived
1
Fork 0

Properly set queue family indices

This commit is contained in:
Joshua Goins 2018-09-29 21:20:58 -04:00
parent 54155bd73b
commit 517c4504c6

View file

@ -157,16 +157,16 @@ 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<uint32_t> queueFamilyIndices = {graphicsFamilyIndex};
queueIndices.presentation = queueIndices.graphics; //FIXME: this may not always be true!!
const std::set<uint32_t> queueFamilyIndices = {queueIndices.graphics};
std::vector<VkDeviceQueueCreateInfo> 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_);
}