blob: 9ddfbac1d938b7ad20510911989f168eed3172c1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
Backport of https://github.com/snes9xgit/snes9x/commit/5449e2d3c549c172f0e81397a9f2be19b800f902
Fix Vulkan compilation errors.
--- a/vulkan/vulkan_context.cpp
+++ b/vulkan/vulkan_context.cpp
@@ -224,27 +224,33 @@ bool Context::init_device(int preferred_device)
};
auto device_list = instance->enumeratePhysicalDevices().value;
- physical_device = nullptr;
+ bool device_chosen = false;
+ physical_device = vk::PhysicalDevice();
if (preferred_device > -1 &&
(size_t)preferred_device < device_list.size() &&
check_extensions(required_extensions, 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)
{
if (check_extensions(required_extensions, device))
{
physical_device = device;
+ device_chosen = true;
break;
}
}
}
+ if (!device_chosen)
+ return false;
+
auto extension_properties = physical_device.enumerateDeviceExtensionProperties().value;
physical_device.getProperties(&physical_device_props);
--- a/vulkan/vulkan_pipeline_image.cpp
+++ b/vulkan/vulkan_pipeline_image.cpp
@@ -1,3 +1,5 @@
+#include <cassert>
+
#include "vulkan_pipeline_image.hpp"
#include "slang_helpers.hpp"
--- a/vulkan/vulkan_shader_chain.cpp
+++ b/vulkan/vulkan_shader_chain.cpp
@@ -1,3 +1,5 @@
+#include <cassert>
+
#include "vulkan_shader_chain.hpp"
#include "slang_helpers.hpp"
#include "stb_image.h"
--- a/vulkan/vulkan_texture.cpp
+++ b/vulkan/vulkan_texture.cpp
@@ -1,3 +1,5 @@
+#include <cassert>
+
#include "vulkan_texture.hpp"
#include "vulkan/vulkan_enums.hpp"
#include "slang_helpers.hpp"
|