Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cube: Make Volk requirement explicit #992

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions cube/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ else()
endif()

target_include_directories(vkcube PRIVATE .)
target_compile_definitions(vkcube PRIVATE VK_NO_PROTOTYPES)

if (ANDROID)
install(TARGETS vkcube DESTINATION ${CMAKE_INSTALL_LIBDIR})
Expand Down Expand Up @@ -307,7 +306,6 @@ else()
target_link_libraries(vkcubepp Vulkan::Headers volk::volk_headers)
endif()
target_include_directories(vkcubepp PRIVATE .)
target_compile_definitions(vkcubepp PRIVATE VK_NO_PROTOTYPES)

if(APPLE)
install(
Expand Down Expand Up @@ -351,7 +349,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux|BSD")
Threads::Threads
PkgConfig::WAYLAND_CLIENT
)
target_compile_definitions(vkcube-wayland PRIVATE VK_USE_PLATFORM_WAYLAND_KHR VK_NO_PROTOTYPES)
target_compile_definitions(vkcube-wayland PRIVATE VK_USE_PLATFORM_WAYLAND_KHR)
include(CheckLibraryExists)
CHECK_LIBRARY_EXISTS("rt" clock_gettime "" NEED_RT)
if (NEED_RT)
Expand Down
2 changes: 2 additions & 0 deletions cube/cube.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
#define APP_NAME_STR_LEN 80
#endif // _WIN32

// Volk requires VK_NO_PROTOTYPES before including vulkan.h
#define VK_NO_PROTOTYPES
#include <vulkan/vulkan.h>
#define VOLK_IMPLEMENTATION
#include "volk.h"
Expand Down
3 changes: 3 additions & 0 deletions cube/cube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions cube/macOS/cube/DemoViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#import "DemoViewController.h"
#import <QuartzCore/CAMetalLayer.h>

#include <MoltenVK/mvk_vulkan.h>

#include "cube.c"

#pragma mark -
Expand Down
2 changes: 0 additions & 2 deletions cube/macOS/cubepp/DemoViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#import "DemoViewController.h"
#import <QuartzCore/CAMetalLayer.h>

#include <MoltenVK/mvk_vulkan.h>

#include "cube.cpp"

#pragma mark -
Expand Down
Loading