VulkanRenderer: Fix physical device bullshit
Keep a single list instead of many
This commit is contained in:
parent
009e5a0466
commit
b62130dab9
|
|
@ -41,7 +41,6 @@ namespace Nz
|
|||
|
||||
private:
|
||||
std::list<Vk::Device> m_devices;
|
||||
std::vector<Vk::PhysicalDevice> m_physDevices;
|
||||
ParameterList m_initializationParameters;
|
||||
Vk::Instance m_instance;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -32,8 +32,10 @@ namespace Nz
|
|||
|
||||
std::shared_ptr<RenderDevice> VulkanRenderer::InstanciateRenderDevice(std::size_t deviceIndex)
|
||||
{
|
||||
assert(deviceIndex < m_physDevices.size());
|
||||
return Vulkan::SelectDevice(m_physDevices[deviceIndex]);
|
||||
const auto& physDevices = Vulkan::GetPhysicalDevices();
|
||||
|
||||
assert(deviceIndex < physDevices.size());
|
||||
return Vulkan::SelectDevice(physDevices[deviceIndex]);
|
||||
}
|
||||
|
||||
bool VulkanRenderer::Prepare(const ParameterList& parameters)
|
||||
|
|
@ -61,10 +63,12 @@ namespace Nz
|
|||
|
||||
std::vector<RenderDeviceInfo> VulkanRenderer::QueryRenderDevices() const
|
||||
{
|
||||
std::vector<RenderDeviceInfo> devices;
|
||||
devices.reserve(m_physDevices.size());
|
||||
const auto& physDevices = Vulkan::GetPhysicalDevices();
|
||||
|
||||
for (const Vk::PhysicalDevice& physDevice : m_physDevices)
|
||||
std::vector<RenderDeviceInfo> devices;
|
||||
devices.reserve(physDevices.size());
|
||||
|
||||
for (const Vk::PhysicalDevice& physDevice : physDevices)
|
||||
{
|
||||
RenderDeviceInfo& device = devices.emplace_back();
|
||||
device.name = physDevice.properties.deviceName;
|
||||
|
|
|
|||
Loading…
Reference in New Issue