aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordan sinclair <dj2@everburning.com>2019-01-24 15:42:21 -0500
committerGitHub <noreply@github.com>2019-01-24 15:42:21 -0500
commitd03f04bb4ff2412ed0490fb3594d8530a8e1ad61 (patch)
treee60354ba98fc1c1905372eade5d4f653584ac389 /include
parentc8091bac42db3a14b61cee2264e3931267724aa1 (diff)
downloadamber-d03f04bb4ff2412ed0490fb3594d8530a8e1ad61.tar.gz
[vulkan] Load vulkan methods through method. (#246)
This CL changes the vulkan backend to load all vulkan methods through the vkGetInstanceProcAddr method instead of accessing directly.
Diffstat (limited to 'include')
-rw-r--r--include/amber/amber_vulkan.h9
-rw-r--r--include/amber/vulkan_header.h4
2 files changed, 10 insertions, 3 deletions
diff --git a/include/amber/amber_vulkan.h b/include/amber/amber_vulkan.h
index d1fb105..c1b09c0 100644
--- a/include/amber/amber_vulkan.h
+++ b/include/amber/amber_vulkan.h
@@ -26,6 +26,12 @@ namespace amber {
/// Configuration for the Vulkan Engine.
struct VulkanEngineConfig : public EngineConfig {
+ /// REQUIRED. The Vulkan instance procedure loader.
+ PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
+
+ /// The VkInstance to use.
+ VkInstance instance;
+
/// The VkPhysicalDevice to use.
VkPhysicalDevice physical_device;
@@ -43,9 +49,6 @@ struct VulkanEngineConfig : public EngineConfig {
/// The VkQueue to use.
VkQueue queue;
-
- /// REQUIRED. The Vulkan instance procedure loader.
- PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
};
} // namespace amber
diff --git a/include/amber/vulkan_header.h b/include/amber/vulkan_header.h
index fa3d237..110e06e 100644
--- a/include/amber/vulkan_header.h
+++ b/include/amber/vulkan_header.h
@@ -26,7 +26,11 @@
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
+// Note, VK_NO_PROTOTYPES is used by vulkan/vulkan.h to disable defining
+// all of the vk* methods.
+#define VK_NO_PROTOTYPES
#include "vulkan/vulkan.h"
+#undef VK_NO_PROTOTYPES
#pragma clang diagnostic pop
#endif // AMBER_CTS_VULKAN_HEADER