CONGE-2 Tweaked the logic to handle cases where presentation queue is not available instead of using #ifndef

This commit is contained in:
Jimmy Tremblay-Bernier 2024-11-22 15:08:02 -05:00
parent d74d19fdf2
commit 194ea8eeef
2 changed files with 6 additions and 5 deletions

View File

@ -100,9 +100,11 @@ namespace ConjureEngine {
vkGetDeviceQueue(m_device, graphicsQueueIndex, 0, &m_graphicQueue); vkGetDeviceQueue(m_device, graphicsQueueIndex, 0, &m_graphicQueue);
#ifndef __APPLE__ // MAC DOESNT SUPPORT 2 QUEUES LIKE ON WINDOWS/ // WHEN POSSIBLE, WE WANT TO USE THE PRESENTATION QUEUE, BUT MAC DOESN'T SUPPORT IT
vkGetDeviceQueue(m_device, presentQueueIndex, 0, &m_presentQueue); if(presentQueueIndex != UINT32_MAX) {
#endif m_supportsPresentationQueue = true;
vkGetDeviceQueue(m_device, presentQueueIndex, 0, &m_presentQueue);
}
const std::string error = SDL_GetError(); const std::string error = SDL_GetError();

View File

@ -26,8 +26,7 @@ namespace ConjureEngine {
VkDeviceCreateInfo m_deviceCreateInfo{}; VkDeviceCreateInfo m_deviceCreateInfo{};
VkDevice m_device{nullptr}; VkDevice m_device{nullptr};
VkQueue m_graphicQueue{nullptr}; VkQueue m_graphicQueue{nullptr};
#ifndef __APPLE__
VkQueue m_presentQueue{nullptr}; VkQueue m_presentQueue{nullptr};
#endif bool m_supportsPresentationQueue = false;
}; };
} // ConjureEngine } // ConjureEngine