diff options
| author | Bob Ellison <bob@lunarg.com> | 2024-05-07 16:36:22 -0600 |
|---|---|---|
| committer | Bob Ellison <45772930+lunarpapillo@users.noreply.github.com> | 2024-06-05 14:23:10 -0600 |
| commit | 5aac257490e8941e4592113ccd8644f31f7de575 (patch) | |
| tree | a86f877ed0f947fbc286af6e40ec5d21aecd7e3e /cube/cube.cpp | |
| parent | d67a9d3a394e11c1c4c0f480124f5b7925cb1b4d (diff) | |
| download | usermoji-5aac257490e8941e4592113ccd8644f31f7de575.tar.xz | |
cube: Make Volk requirement explicit
See also:
Cannot build DEMOS.sln
https://gitlab.khronos.org/vulkan/Vulkan-SDK-Packaging/-/issues/1417
Volk requires that VK_NO_PROTOTYPES be defined before vulkan.h or vulkan.hpp is
included. Currently, the various flavors of vkcube hide this definition in the
cube/CMakeLists.txt file, which can confuse users who may copy the source for their
own use, and may require investigation to figure out why it doesn't "just work".
This change makes the #define explicit in the cube.c and cube.cpp source files,
which should both be clearer and be more similar to how most applications use Volk.
cube/CMakeLists.txt:
- remove
- vulkaninfo already had a #VK_NO_PROTOTYPES somewhere
- macOS DemoViewController includes of mvk_vulkan.h are confusing Volk and don't seem to be necessary,
since cube.c and cube.cpp #include vulkan.h and vulkan.hpp, respectively
Diffstat (limited to 'cube/cube.cpp')
| -rw-r--r-- | cube/cube.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cube/cube.cpp b/cube/cube.cpp index edefbf09..ccf0ec80 100644 --- a/cube/cube.cpp +++ b/cube/cube.cpp @@ -41,6 +41,9 @@ #define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1 #define VULKAN_HPP_NO_EXCEPTIONS #define VULKAN_HPP_TYPESAFE_CONVERSION 1 + +// Volk requires VK_NO_PROTOTYPES before including vulkan.hpp +#define VK_NO_PROTOTYPES #include <vulkan/vulkan.hpp> #define VOLK_IMPLEMENTATION |
