mirror of https://github.com/snes9xgit/snes9x.git
vulkan: Fix compile errors reported in Issue #946.
This commit is contained in:
parent
645a4712e7
commit
5449e2d3c5
|
@ -224,27 +224,33 @@ bool Context::init_device(int preferred_device)
|
||||||
};
|
};
|
||||||
|
|
||||||
auto device_list = instance->enumeratePhysicalDevices().value;
|
auto device_list = instance->enumeratePhysicalDevices().value;
|
||||||
physical_device = nullptr;
|
bool device_chosen = false;
|
||||||
|
physical_device = vk::PhysicalDevice();
|
||||||
|
|
||||||
if (preferred_device > -1 &&
|
if (preferred_device > -1 &&
|
||||||
(size_t)preferred_device < device_list.size() &&
|
(size_t)preferred_device < device_list.size() &&
|
||||||
check_extensions(required_extensions, device_list[preferred_device]))
|
check_extensions(required_extensions, device_list[preferred_device]))
|
||||||
{
|
{
|
||||||
physical_device = device_list[preferred_device];
|
physical_device = device_list[preferred_device];
|
||||||
|
device_chosen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (physical_device == nullptr)
|
if (!device_chosen)
|
||||||
{
|
{
|
||||||
for (auto &device : device_list)
|
for (auto &device : device_list)
|
||||||
{
|
{
|
||||||
if (check_extensions(required_extensions, device))
|
if (check_extensions(required_extensions, device))
|
||||||
{
|
{
|
||||||
physical_device = device;
|
physical_device = device;
|
||||||
|
device_chosen = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!device_chosen)
|
||||||
|
return false;
|
||||||
|
|
||||||
graphics_queue_family_index = find_graphics_queue(physical_device);
|
graphics_queue_family_index = find_graphics_queue(physical_device);
|
||||||
if (graphics_queue_family_index == UINT32_MAX)
|
if (graphics_queue_family_index == UINT32_MAX)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
#include "vulkan_pipeline_image.hpp"
|
#include "vulkan_pipeline_image.hpp"
|
||||||
#include "slang_helpers.hpp"
|
#include "slang_helpers.hpp"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
#include "vulkan_shader_chain.hpp"
|
#include "vulkan_shader_chain.hpp"
|
||||||
#include "slang_helpers.hpp"
|
#include "slang_helpers.hpp"
|
||||||
#include "stb_image.h"
|
#include "stb_image.h"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
#include "vulkan_texture.hpp"
|
#include "vulkan_texture.hpp"
|
||||||
#include "vulkan/vulkan_enums.hpp"
|
#include "vulkan/vulkan_enums.hpp"
|
||||||
#include "slang_helpers.hpp"
|
#include "slang_helpers.hpp"
|
||||||
|
|
Loading…
Reference in New Issue