CONGE-2 REMOVED PRESENTATION QUEUE ON MAC
This commit is contained in:
parent
11b558f836
commit
d74d19fdf2
@ -21,11 +21,6 @@ find_package(glm REQUIRED)
|
|||||||
find_package(SDL2 REQUIRED)
|
find_package(SDL2 REQUIRED)
|
||||||
find_package(Vulkan REQUIRED)
|
find_package(Vulkan REQUIRED)
|
||||||
|
|
||||||
IF (WIN32)
|
|
||||||
define_property(TARGET PROPERTY VK_PROTOTYPES )
|
|
||||||
define_property(TARGET PROPERTY VK_USE_PLATFORM_WIN32_KHR)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
add_library(${PROJECT_NAME} STATIC ${HEADER_FILES} ${SOURCES_FILES})
|
add_library(${PROJECT_NAME} STATIC ${HEADER_FILES} ${SOURCES_FILES})
|
||||||
|
|
||||||
# Specify include directories
|
# Specify include directories
|
||||||
|
|||||||
@ -4,15 +4,13 @@
|
|||||||
|
|
||||||
#include "VulkanContext.h"
|
#include "VulkanContext.h"
|
||||||
|
|
||||||
#ifdef __WIN32__
|
|
||||||
// #include <vulkan/vulkan_win32.h>
|
|
||||||
#endif
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include "vulkan/vulkan_metal.h"
|
#include "vulkan/vulkan_metal.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace ConjureEngine {
|
namespace ConjureEngine {
|
||||||
VulkanContext::VulkanContext(SDL_Window* window, const VkApplicationInfo& appInfo) {
|
VulkanContext::VulkanContext(SDL_Window* window, const VkApplicationInfo& appInfo)
|
||||||
|
{
|
||||||
// LOAD THE EXTENSIONS
|
// LOAD THE EXTENSIONS
|
||||||
SDL_Vulkan_GetInstanceExtensions(window, &m_extensionCount, nullptr);
|
SDL_Vulkan_GetInstanceExtensions(window, &m_extensionCount, nullptr);
|
||||||
m_extensionNames.reserve(m_extensionCount);
|
m_extensionNames.reserve(m_extensionCount);
|
||||||
@ -92,10 +90,20 @@ namespace ConjureEngine {
|
|||||||
|
|
||||||
|
|
||||||
// CREATE VIRTUAL DEVICE FOR RENDERING
|
// CREATE VIRTUAL DEVICE FOR RENDERING
|
||||||
vkCreateDevice(m_selectedPhysicalDevice, &m_deviceCreateInfo, nullptr, &m_device);
|
VkResult result = vkCreateDevice(m_selectedPhysicalDevice, &m_deviceCreateInfo, nullptr, &m_device);
|
||||||
|
if(result != VkResult::VK_SUCCESS) {
|
||||||
|
SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Error while creating the device: %d", static_cast<int>(result));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
SDL_Log("DEVICE CREATED SUCCESSFULLY");
|
||||||
|
}
|
||||||
|
|
||||||
vkGetDeviceQueue(m_device, graphicsQueueIndex, 0, &m_graphicQueue);
|
vkGetDeviceQueue(m_device, graphicsQueueIndex, 0, &m_graphicQueue);
|
||||||
|
|
||||||
|
#ifndef __APPLE__ // MAC DOESNT SUPPORT 2 QUEUES LIKE ON WINDOWS/
|
||||||
vkGetDeviceQueue(m_device, presentQueueIndex, 0, &m_presentQueue);
|
vkGetDeviceQueue(m_device, presentQueueIndex, 0, &m_presentQueue);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
const std::string error = SDL_GetError();
|
const std::string error = SDL_GetError();
|
||||||
if(!error.empty()) {
|
if(!error.empty()) {
|
||||||
|
|||||||
@ -16,16 +16,18 @@ namespace ConjureEngine {
|
|||||||
private:
|
private:
|
||||||
uint32_t m_extensionCount{0};
|
uint32_t m_extensionCount{0};
|
||||||
std::vector<const char*> m_extensionNames;
|
std::vector<const char*> m_extensionNames;
|
||||||
VkInstance m_vkInst{};
|
VkInstance m_vkInst{nullptr};
|
||||||
uint32_t m_physicalDeviceCount{0};
|
uint32_t m_physicalDeviceCount{0};
|
||||||
std::vector<VkPhysicalDevice> m_physicalDevices;
|
std::vector<VkPhysicalDevice> m_physicalDevices;
|
||||||
VkPhysicalDevice m_selectedPhysicalDevice;
|
VkPhysicalDevice m_selectedPhysicalDevice{nullptr};
|
||||||
uint32_t m_queueFamilyCount{0};
|
uint32_t m_queueFamilyCount{0};
|
||||||
VkSurfaceKHR m_surface;
|
VkSurfaceKHR m_surface{nullptr};
|
||||||
VkDeviceQueueCreateInfo m_deviceQueueCreateInfo;
|
VkDeviceQueueCreateInfo m_deviceQueueCreateInfo{};
|
||||||
VkDeviceCreateInfo m_deviceCreateInfo;
|
VkDeviceCreateInfo m_deviceCreateInfo{};
|
||||||
VkDevice m_device;
|
VkDevice m_device{nullptr};
|
||||||
VkQueue m_graphicQueue;
|
VkQueue m_graphicQueue{nullptr};
|
||||||
VkQueue m_presentQueue;
|
#ifndef __APPLE__
|
||||||
|
VkQueue m_presentQueue{nullptr};
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
} // ConjureEngine
|
} // ConjureEngine
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user