Properly set queue family indices
This commit is contained in:
parent
54155bd73b
commit
517c4504c6
1 changed files with 6 additions and 6 deletions
|
@ -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_);
|
||||
}
|
||||
|
|
Reference in a new issue