diff --git a/.gitmodules b/.gitmodules index d5ff308..389035d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 5310793..c0540a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/framegen/CMakeLists.txt b/framegen/CMakeLists.txt index 26e6177..b88bebf 100644 --- a/framegen/CMakeLists.txt +++ b/framegen/CMakeLists.txt @@ -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 diff --git a/framegen/src/common/utils.cpp b/framegen/src/common/utils.cpp index 5b083ee..20346c5 100644 --- a/framegen/src/common/utils.cpp +++ b/framegen/src/common/utils.cpp @@ -1,3 +1,6 @@ +#include +#include + #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 - #include #include #include diff --git a/framegen/src/core/buffer.cpp b/framegen/src/core/buffer.cpp index 001c77b..319c829 100644 --- a/framegen/src/core/buffer.cpp +++ b/framegen/src/core/buffer.cpp @@ -1,9 +1,10 @@ +#include +#include + #include "core/buffer.hpp" #include "core/device.hpp" #include "common/exception.hpp" -#include - #include #include #include diff --git a/framegen/src/core/commandbuffer.cpp b/framegen/src/core/commandbuffer.cpp index 762db6a..7deea63 100644 --- a/framegen/src/core/commandbuffer.cpp +++ b/framegen/src/core/commandbuffer.cpp @@ -1,3 +1,6 @@ +#include +#include + #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 - #include #include #include diff --git a/framegen/src/core/commandpool.cpp b/framegen/src/core/commandpool.cpp index ffa89de..2ff457f 100644 --- a/framegen/src/core/commandpool.cpp +++ b/framegen/src/core/commandpool.cpp @@ -1,9 +1,10 @@ +#include +#include + #include "core/commandpool.hpp" #include "core/device.hpp" #include "common/exception.hpp" -#include - #include using namespace LSFG::Core; diff --git a/framegen/src/core/descriptorpool.cpp b/framegen/src/core/descriptorpool.cpp index f9cd359..eea5bb2 100644 --- a/framegen/src/core/descriptorpool.cpp +++ b/framegen/src/core/descriptorpool.cpp @@ -1,9 +1,10 @@ +#include +#include + #include "core/descriptorpool.hpp" #include "core/device.hpp" #include "common/exception.hpp" -#include - #include #include #include diff --git a/framegen/src/core/descriptorset.cpp b/framegen/src/core/descriptorset.cpp index e72ba72..9300daa 100644 --- a/framegen/src/core/descriptorset.cpp +++ b/framegen/src/core/descriptorset.cpp @@ -1,3 +1,6 @@ +#include +#include + #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 - #include #include diff --git a/framegen/src/core/device.cpp b/framegen/src/core/device.cpp index 72cfa4b..b4474da 100644 --- a/framegen/src/core/device.cpp +++ b/framegen/src/core/device.cpp @@ -1,9 +1,10 @@ +#include +#include + #include "core/device.hpp" #include "core/instance.hpp" #include "common/exception.hpp" -#include - #include #include #include @@ -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); diff --git a/framegen/src/core/fence.cpp b/framegen/src/core/fence.cpp index e402019..0284f08 100644 --- a/framegen/src/core/fence.cpp +++ b/framegen/src/core/fence.cpp @@ -1,9 +1,10 @@ +#include +#include + #include "core/fence.hpp" #include "core/device.hpp" #include "common/exception.hpp" -#include - #include #include diff --git a/framegen/src/core/image.cpp b/framegen/src/core/image.cpp index 50b522e..cfbf2e2 100644 --- a/framegen/src/core/image.cpp +++ b/framegen/src/core/image.cpp @@ -1,9 +1,10 @@ +#include +#include + #include "core/image.hpp" #include "core/device.hpp" #include "common/exception.hpp" -#include - #include #include #include diff --git a/framegen/src/core/instance.cpp b/framegen/src/core/instance.cpp index 1302b7a..981e634 100644 --- a/framegen/src/core/instance.cpp +++ b/framegen/src/core/instance.cpp @@ -1,10 +1,12 @@ +#include +#include + #include "core/instance.hpp" #include "common/exception.hpp" #include #include #include -#include using namespace LSFG::Core; @@ -13,6 +15,8 @@ const std::vector 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( new VkInstance(instanceHandle), diff --git a/framegen/src/core/pipeline.cpp b/framegen/src/core/pipeline.cpp index e3dfd9d..c2a6375 100644 --- a/framegen/src/core/pipeline.cpp +++ b/framegen/src/core/pipeline.cpp @@ -1,11 +1,12 @@ +#include +#include + #include "core/pipeline.hpp" #include "core/device.hpp" #include "core/shadermodule.hpp" #include "core/commandbuffer.hpp" #include "common/exception.hpp" -#include - #include using namespace LSFG::Core; diff --git a/framegen/src/core/sampler.cpp b/framegen/src/core/sampler.cpp index f44fe2d..2e8f4eb 100644 --- a/framegen/src/core/sampler.cpp +++ b/framegen/src/core/sampler.cpp @@ -1,9 +1,10 @@ +#include +#include + #include "core/sampler.hpp" #include "core/device.hpp" #include "common/exception.hpp" -#include - #include using namespace LSFG::Core; diff --git a/framegen/src/core/semaphore.cpp b/framegen/src/core/semaphore.cpp index 57bcd42..102898a 100644 --- a/framegen/src/core/semaphore.cpp +++ b/framegen/src/core/semaphore.cpp @@ -1,9 +1,10 @@ +#include +#include + #include "core/semaphore.hpp" #include "core/device.hpp" #include "common/exception.hpp" -#include - #include #include #include diff --git a/framegen/src/core/shadermodule.cpp b/framegen/src/core/shadermodule.cpp index 099b08b..92ce4e8 100644 --- a/framegen/src/core/shadermodule.cpp +++ b/framegen/src/core/shadermodule.cpp @@ -1,9 +1,10 @@ +#include +#include + #include "core/shadermodule.hpp" #include "core/device.hpp" #include "common/exception.hpp" -#include - #include #include #include diff --git a/framegen/v3.1_src/context.cpp b/framegen/v3.1_src/context.cpp index c594ed9..4984842 100644 --- a/framegen/v3.1_src/context.cpp +++ b/framegen/v3.1_src/context.cpp @@ -1,9 +1,10 @@ +#include +#include + #include "v3_1/context.hpp" #include "common/utils.hpp" #include "common/exception.hpp" -#include - #include #include #include diff --git a/framegen/v3.1_src/lsfg.cpp b/framegen/v3.1_src/lsfg.cpp index 9221730..a894f12 100644 --- a/framegen/v3.1_src/lsfg.cpp +++ b/framegen/v3.1_src/lsfg.cpp @@ -1,3 +1,6 @@ +#include +#include + #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 - #include #include #include diff --git a/framegen/v3.1_src/shaders/alpha.cpp b/framegen/v3.1_src/shaders/alpha.cpp index 7e9ef6f..1d36b1d 100644 --- a/framegen/v3.1_src/shaders/alpha.cpp +++ b/framegen/v3.1_src/shaders/alpha.cpp @@ -1,10 +1,11 @@ +#include +#include + #include "v3_1/shaders/alpha.hpp" #include "common/utils.hpp" #include "core/commandbuffer.hpp" #include "core/image.hpp" -#include - #include #include #include diff --git a/framegen/v3.1_src/shaders/beta.cpp b/framegen/v3.1_src/shaders/beta.cpp index 34d8f69..b61a005 100644 --- a/framegen/v3.1_src/shaders/beta.cpp +++ b/framegen/v3.1_src/shaders/beta.cpp @@ -1,10 +1,11 @@ +#include +#include + #include "v3_1/shaders/beta.hpp" #include "common/utils.hpp" #include "core/commandbuffer.hpp" #include "core/image.hpp" -#include - #include #include #include diff --git a/framegen/v3.1_src/shaders/delta.cpp b/framegen/v3.1_src/shaders/delta.cpp index 0928428..bcafbf7 100644 --- a/framegen/v3.1_src/shaders/delta.cpp +++ b/framegen/v3.1_src/shaders/delta.cpp @@ -1,10 +1,11 @@ +#include +#include + #include "v3_1/shaders/delta.hpp" #include "common/utils.hpp" #include "core/commandbuffer.hpp" #include "core/image.hpp" -#include - #include #include #include diff --git a/framegen/v3.1_src/shaders/gamma.cpp b/framegen/v3.1_src/shaders/gamma.cpp index c4a64df..a5b9ff8 100644 --- a/framegen/v3.1_src/shaders/gamma.cpp +++ b/framegen/v3.1_src/shaders/gamma.cpp @@ -1,10 +1,11 @@ +#include +#include + #include "v3_1/shaders/gamma.hpp" #include "common/utils.hpp" #include "core/commandbuffer.hpp" #include "core/image.hpp" -#include - #include #include #include diff --git a/framegen/v3.1_src/shaders/generate.cpp b/framegen/v3.1_src/shaders/generate.cpp index 77aa441..44af35a 100644 --- a/framegen/v3.1_src/shaders/generate.cpp +++ b/framegen/v3.1_src/shaders/generate.cpp @@ -1,10 +1,11 @@ +#include +#include + #include "v3_1/shaders/generate.hpp" #include "common/utils.hpp" #include "core/commandbuffer.hpp" #include "core/image.hpp" -#include - #include #include #include diff --git a/framegen/v3.1_src/shaders/mipmaps.cpp b/framegen/v3.1_src/shaders/mipmaps.cpp index f4d0f74..ca7605b 100644 --- a/framegen/v3.1_src/shaders/mipmaps.cpp +++ b/framegen/v3.1_src/shaders/mipmaps.cpp @@ -1,10 +1,11 @@ +#include +#include + #include "v3_1/shaders/mipmaps.hpp" #include "common/utils.hpp" #include "core/image.hpp" #include "core/commandbuffer.hpp" -#include - #include #include #include diff --git a/framegen/v3.1p_src/context.cpp b/framegen/v3.1p_src/context.cpp index 00d07a3..6702b5b 100644 --- a/framegen/v3.1p_src/context.cpp +++ b/framegen/v3.1p_src/context.cpp @@ -1,9 +1,10 @@ +#include +#include + #include "v3_1p/context.hpp" #include "common/utils.hpp" #include "common/exception.hpp" -#include - #include #include #include diff --git a/framegen/v3.1p_src/lsfg.cpp b/framegen/v3.1p_src/lsfg.cpp index e0d1b69..a22609d 100644 --- a/framegen/v3.1p_src/lsfg.cpp +++ b/framegen/v3.1p_src/lsfg.cpp @@ -1,3 +1,6 @@ +#include +#include + #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 - #include #include #include diff --git a/framegen/v3.1p_src/shaders/alpha.cpp b/framegen/v3.1p_src/shaders/alpha.cpp index c2d4dcd..cd04df7 100644 --- a/framegen/v3.1p_src/shaders/alpha.cpp +++ b/framegen/v3.1p_src/shaders/alpha.cpp @@ -1,10 +1,11 @@ +#include +#include + #include "v3_1p/shaders/alpha.hpp" #include "common/utils.hpp" #include "core/commandbuffer.hpp" #include "core/image.hpp" -#include - #include #include #include diff --git a/framegen/v3.1p_src/shaders/beta.cpp b/framegen/v3.1p_src/shaders/beta.cpp index 76bb751..f8451ae 100644 --- a/framegen/v3.1p_src/shaders/beta.cpp +++ b/framegen/v3.1p_src/shaders/beta.cpp @@ -1,10 +1,11 @@ +#include +#include + #include "v3_1p/shaders/beta.hpp" #include "common/utils.hpp" #include "core/commandbuffer.hpp" #include "core/image.hpp" -#include - #include #include #include diff --git a/framegen/v3.1p_src/shaders/delta.cpp b/framegen/v3.1p_src/shaders/delta.cpp index 987a8cc..df06d38 100644 --- a/framegen/v3.1p_src/shaders/delta.cpp +++ b/framegen/v3.1p_src/shaders/delta.cpp @@ -1,10 +1,11 @@ +#include +#include + #include "v3_1p/shaders/delta.hpp" #include "common/utils.hpp" #include "core/commandbuffer.hpp" #include "core/image.hpp" -#include - #include #include #include diff --git a/framegen/v3.1p_src/shaders/gamma.cpp b/framegen/v3.1p_src/shaders/gamma.cpp index 08f8eab..ae87e79 100644 --- a/framegen/v3.1p_src/shaders/gamma.cpp +++ b/framegen/v3.1p_src/shaders/gamma.cpp @@ -1,10 +1,11 @@ +#include +#include + #include "v3_1p/shaders/gamma.hpp" #include "common/utils.hpp" #include "core/commandbuffer.hpp" #include "core/image.hpp" -#include - #include #include #include diff --git a/framegen/v3.1p_src/shaders/generate.cpp b/framegen/v3.1p_src/shaders/generate.cpp index 59447c8..5f511da 100644 --- a/framegen/v3.1p_src/shaders/generate.cpp +++ b/framegen/v3.1p_src/shaders/generate.cpp @@ -1,10 +1,11 @@ +#include +#include + #include "v3_1p/shaders/generate.hpp" #include "common/utils.hpp" #include "core/commandbuffer.hpp" #include "core/image.hpp" -#include - #include #include #include diff --git a/framegen/v3.1p_src/shaders/mipmaps.cpp b/framegen/v3.1p_src/shaders/mipmaps.cpp index ebf9503..531b34f 100644 --- a/framegen/v3.1p_src/shaders/mipmaps.cpp +++ b/framegen/v3.1p_src/shaders/mipmaps.cpp @@ -1,10 +1,11 @@ +#include +#include + #include "v3_1p/shaders/mipmaps.hpp" #include "common/utils.hpp" #include "core/image.hpp" #include "core/commandbuffer.hpp" -#include - #include #include #include diff --git a/thirdparty/volk b/thirdparty/volk new file mode 160000 index 0000000..be3dbd4 --- /dev/null +++ b/thirdparty/volk @@ -0,0 +1 @@ +Subproject commit be3dbd49bf77052665e96b6c7484af855e7e5f67