Update DeviceManager

This commit is contained in:
2021-07-21 01:59:11 +02:00
parent cfbf31cb77
commit 58f2efb360
6 changed files with 100 additions and 43 deletions

View File

@@ -29,8 +29,8 @@ namespace openVulkanoCpp::Vulkan
CreateDevice();
swapChain.Init(device, surface, window);
swapChainRenderPass.Init(device, &swapChain);
swapChain.Init(device.get(), surface, window);
swapChainRenderPass.Init(device.get(), &swapChain);
pipeline.Init(device->device);
@@ -75,10 +75,11 @@ namespace openVulkanoCpp::Vulkan
void Context::CreateDevice()
{
const std::vector<std::string> neededExtensions = { VK_KHR_SWAPCHAIN_EXTENSION_NAME };
deviceManager.Init(instance);
device = deviceManager.GetCompatibleDevice({ VK_KHR_SWAPCHAIN_EXTENSION_NAME });
device->PrepareDevice({ VK_KHR_SWAPCHAIN_EXTENSION_NAME }, surface);
device = deviceManager.GetCompatibleDevice(neededExtensions);
device->PrepareDevice(neededExtensions, surface);
dynamicDispatch.init(instance, &vkGetInstanceProcAddr, device->device, &vkGetDeviceProcAddr);
Logger::RENDER->info("Found device: {0}", device->GetDeviceName());;
Logger::RENDER->info("Found device: {0}", device->GetDeviceName());
}
}