test: use volk rather than Vulkan linkage

This commit is contained in:
PancakeTAS 2025-07-24 17:43:22 +02:00 committed by Pancake
parent 308c5789b7
commit f24263b83b
34 changed files with 103 additions and 61 deletions

3
.gitmodules vendored
View file

@ -7,3 +7,6 @@
[submodule "thirdparty/toml11"]
path = thirdparty/toml11
url = https://github.com/ToruNiina/toml11
[submodule "thirdparty/volk"]
path = thirdparty/volk
url = https://github.com/zeux/volk

View file

@ -19,6 +19,7 @@ set(GLFW_BUILD_X11 ON)
add_subdirectory(thirdparty/dxbc EXCLUDE_FROM_ALL)
add_subdirectory(thirdparty/pe-parse/pe-parser-library EXCLUDE_FROM_ALL)
add_subdirectory(thirdparty/toml11 EXCLUDE_FROM_ALL)
add_subdirectory(thirdparty/volk EXCLUDE_FROM_ALL)
add_subdirectory(framegen)
# main project
@ -45,7 +46,7 @@ target_include_directories(lsfg-vk
PRIVATE include)
target_link_libraries(lsfg-vk PRIVATE
pe-parse dxbc toml11 SPIRV-Headers
lsfg-vk-framegen vulkan
lsfg-vk-framegen
-static-libstdc++ -static-libgcc)
get_target_property(TOML11_INCLUDE_DIRS toml11 INTERFACE_INCLUDE_DIRECTORIES)

View file

@ -34,7 +34,7 @@ target_include_directories(lsfg-vk-framegen
PRIVATE v3.1_include
PRIVATE v3.1p_include)
target_link_libraries(lsfg-vk-framegen
PUBLIC vulkan)
PUBLIC volk)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set_target_properties(lsfg-vk-framegen PROPERTIES

View file

@ -1,3 +1,6 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "common/utils.hpp"
#include "core/buffer.hpp"
#include "core/image.hpp"
@ -6,8 +9,6 @@
#include "core/fence.hpp"
#include "common/exception.hpp"
#include <vulkan/vulkan_core.h>
#include <cstdint>
#include <cerrno>
#include <cstdlib>

View file

@ -1,9 +1,10 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "core/buffer.hpp"
#include "core/device.hpp"
#include "common/exception.hpp"
#include <vulkan/vulkan_core.h>
#include <algorithm>
#include <cstdint>
#include <memory>

View file

@ -1,3 +1,6 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "core/commandbuffer.hpp"
#include "core/device.hpp"
#include "core/commandpool.hpp"
@ -5,8 +8,6 @@
#include "core/semaphore.hpp"
#include "common/exception.hpp"
#include <vulkan/vulkan_core.h>
#include <memory>
#include <stdexcept>
#include <cstdint>

View file

@ -1,9 +1,10 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "core/commandpool.hpp"
#include "core/device.hpp"
#include "common/exception.hpp"
#include <vulkan/vulkan_core.h>
#include <memory>
using namespace LSFG::Core;

View file

@ -1,9 +1,10 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "core/descriptorpool.hpp"
#include "core/device.hpp"
#include "common/exception.hpp"
#include <vulkan/vulkan_core.h>
#include <array>
#include <cstdint>
#include <memory>

View file

@ -1,3 +1,6 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "core/descriptorset.hpp"
#include "core/device.hpp"
#include "core/descriptorpool.hpp"
@ -9,8 +12,6 @@
#include "core/buffer.hpp"
#include "common/exception.hpp"
#include <vulkan/vulkan_core.h>
#include <memory>
#include <cstdint>

View file

@ -1,9 +1,10 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "core/device.hpp"
#include "core/instance.hpp"
#include "common/exception.hpp"
#include <vulkan/vulkan_core.h>
#include <cstdint>
#include <memory>
#include <optional>
@ -97,6 +98,8 @@ Device::Device(const Instance& instance, uint64_t deviceUUID) {
if (res != VK_SUCCESS | deviceHandle == VK_NULL_HANDLE)
throw LSFG::vulkan_error(res, "Failed to create logical device");
volkLoadDevice(deviceHandle);
// get compute queue
VkQueue queueHandle{};
vkGetDeviceQueue(deviceHandle, *computeFamilyIdx, 0, &queueHandle);

View file

@ -1,9 +1,10 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "core/fence.hpp"
#include "core/device.hpp"
#include "common/exception.hpp"
#include <vulkan/vulkan_core.h>
#include <memory>
#include <cstdint>

View file

@ -1,9 +1,10 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "core/image.hpp"
#include "core/device.hpp"
#include "common/exception.hpp"
#include <vulkan/vulkan_core.h>
#include <cstdint>
#include <memory>
#include <optional>

View file

@ -1,10 +1,12 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "core/instance.hpp"
#include "common/exception.hpp"
#include <cstdint>
#include <memory>
#include <vector>
#include <vulkan/vulkan_core.h>
using namespace LSFG::Core;
@ -13,6 +15,8 @@ const std::vector<const char*> requiredExtensions = {
};
Instance::Instance() {
volkInitialize();
// create Vulkan instance
const VkApplicationInfo appInfo{
.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,
@ -33,6 +37,8 @@ Instance::Instance() {
if (res != VK_SUCCESS)
throw LSFG::vulkan_error(res, "Failed to create Vulkan instance");
volkLoadInstance(instanceHandle);
// store in shared ptr
this->instance = std::shared_ptr<VkInstance>(
new VkInstance(instanceHandle),

View file

@ -1,11 +1,12 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "core/pipeline.hpp"
#include "core/device.hpp"
#include "core/shadermodule.hpp"
#include "core/commandbuffer.hpp"
#include "common/exception.hpp"
#include <vulkan/vulkan_core.h>
#include <memory>
using namespace LSFG::Core;

View file

@ -1,9 +1,10 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "core/sampler.hpp"
#include "core/device.hpp"
#include "common/exception.hpp"
#include <vulkan/vulkan_core.h>
#include <memory>
using namespace LSFG::Core;

View file

@ -1,9 +1,10 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "core/semaphore.hpp"
#include "core/device.hpp"
#include "common/exception.hpp"
#include <vulkan/vulkan_core.h>
#include <optional>
#include <cstdint>
#include <memory>

View file

@ -1,9 +1,10 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "core/shadermodule.hpp"
#include "core/device.hpp"
#include "common/exception.hpp"
#include <vulkan/vulkan_core.h>
#include <vector>
#include <cstdint>
#include <utility>

View file

@ -1,9 +1,10 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "v3_1/context.hpp"
#include "common/utils.hpp"
#include "common/exception.hpp"
#include <vulkan/vulkan_core.h>
#include <vector>
#include <cstddef>
#include <algorithm>

View file

@ -1,3 +1,6 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "lsfg_3_1.hpp"
#include "v3_1/context.hpp"
#include "core/commandpool.hpp"
@ -7,8 +10,6 @@
#include "common/exception.hpp"
#include "common/utils.hpp"
#include <vulkan/vulkan_core.h>
#include <cstdint>
#include <optional>
#include <cstdlib>

View file

@ -1,10 +1,11 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "v3_1/shaders/alpha.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"
#include <vulkan/vulkan_core.h>
#include <utility>
#include <cstddef>
#include <cstdint>

View file

@ -1,10 +1,11 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "v3_1/shaders/beta.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"
#include <vulkan/vulkan_core.h>
#include <array>
#include <utility>
#include <cstddef>

View file

@ -1,10 +1,11 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "v3_1/shaders/delta.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"
#include <vulkan/vulkan_core.h>
#include <array>
#include <optional>
#include <utility>

View file

@ -1,10 +1,11 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "v3_1/shaders/gamma.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"
#include <vulkan/vulkan_core.h>
#include <array>
#include <optional>
#include <utility>

View file

@ -1,10 +1,11 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "v3_1/shaders/generate.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"
#include <vulkan/vulkan_core.h>
#include <vector>
#include <utility>
#include <cstddef>

View file

@ -1,10 +1,11 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "v3_1/shaders/mipmaps.hpp"
#include "common/utils.hpp"
#include "core/image.hpp"
#include "core/commandbuffer.hpp"
#include <vulkan/vulkan_core.h>
#include <utility>
#include <cstddef>
#include <cstdint>

View file

@ -1,9 +1,10 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "v3_1p/context.hpp"
#include "common/utils.hpp"
#include "common/exception.hpp"
#include <vulkan/vulkan_core.h>
#include <vector>
#include <cstddef>
#include <algorithm>

View file

@ -1,3 +1,6 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "lsfg_3_1p.hpp"
#include "v3_1p/context.hpp"
#include "core/commandpool.hpp"
@ -7,8 +10,6 @@
#include "common/exception.hpp"
#include "common/utils.hpp"
#include <vulkan/vulkan_core.h>
#include <cstdint>
#include <optional>
#include <cstdlib>

View file

@ -1,10 +1,11 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "v3_1p/shaders/alpha.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"
#include <vulkan/vulkan_core.h>
#include <utility>
#include <cstddef>
#include <cstdint>

View file

@ -1,10 +1,11 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "v3_1p/shaders/beta.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"
#include <vulkan/vulkan_core.h>
#include <array>
#include <utility>
#include <cstddef>

View file

@ -1,10 +1,11 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "v3_1p/shaders/delta.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"
#include <vulkan/vulkan_core.h>
#include <array>
#include <optional>
#include <utility>

View file

@ -1,10 +1,11 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "v3_1p/shaders/gamma.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"
#include <vulkan/vulkan_core.h>
#include <array>
#include <optional>
#include <utility>

View file

@ -1,10 +1,11 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "v3_1p/shaders/generate.hpp"
#include "common/utils.hpp"
#include "core/commandbuffer.hpp"
#include "core/image.hpp"
#include <vulkan/vulkan_core.h>
#include <vector>
#include <utility>
#include <cstddef>

View file

@ -1,10 +1,11 @@
#include <volk.h>
#include <vulkan/vulkan_core.h>
#include "v3_1p/shaders/mipmaps.hpp"
#include "common/utils.hpp"
#include "core/image.hpp"
#include "core/commandbuffer.hpp"
#include <vulkan/vulkan_core.h>
#include <utility>
#include <cstddef>
#include <cstdint>

1
thirdparty/volk vendored Submodule

@ -0,0 +1 @@
Subproject commit be3dbd49bf77052665e96b6c7484af855e7e5f67