Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 119-graphicspipeline-refactoring
  • 129-projekte-und-assets-auslagern
  • 132-denoising-module
  • 143-ar-vr-support-via-openxr
  • 43-multi-threading
  • 91-compute-first-network
  • 95-arm64-raspberry-pi-4-support
  • develop
  • master
  • optimizations
  • 0.1.0
  • 0.2.0
12 results

Target

Select target project
  • vulkan2021/vkcv-framework
1 result
Select Git revision
  • 119-graphicspipeline-refactoring
  • 129-projekte-und-assets-auslagern
  • 132-denoising-module
  • 143-ar-vr-support-via-openxr
  • 43-multi-threading
  • 91-compute-first-network
  • 95-arm64-raspberry-pi-4-support
  • develop
  • master
  • optimizations
  • 0.1.0
  • 0.2.0
12 results
Show changes
Commits on Source (320)
Showing
with 412 additions and 38 deletions
Alexander Gauggel
Artur Wasmut
Josch Morgenstern
Katharina Krämer
Lars Hoerttrich
Leonie Franken
Mara Vogt
Mark O. Mints
Sebastian Gaida
Simeon Hermann
Susanne Dötsch
Tobias Frisch
Trevor Hollmann
Vanessa Karolek
cmake_minimum_required(VERSION 3.16)
project(vkcv)
# cmake options
option(BUILD_MODULES "Enables building VkCV as shared libraries" ON)
option(BUILD_PROJECTS "Enables building the VkCV projects" ON)
option(BUILD_DOXYGEN_DOCS "Enables building the VkCV doxygen documentation" OFF)
option(BUILD_SHARED "Enables building VkCV as shared libraries" OFF)
if (BUILD_PROJECTS)
set(BUILD_MODULES ${BUILD_PROJECTS})
endif()
message(STATUS "Options:")
message(" - BUILD_MODULES: ${BUILD_MODULES}")
message(" - BUILD_PROJECTS: ${BUILD_PROJECTS}")
message(" - BUILD_DOXYGEN_DOCS: ${BUILD_DOXYGEN_DOCS}")
message(" - BUILD_SHARED: ${BUILD_SHARED}")
if (BUILD_SHARED)
set(vkcv_build_attribute SHARED)
else()
set(vkcv_build_attribute STATIC)
endif()
# settings c++ standard for the framework
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# checking build type and setting up a variable
......@@ -11,8 +33,8 @@ if (CMAKE_BUILD_TYPE)
set(vkcv_build_${_vkcv_build_type} 1)
endif()
message("-- Language: [ C++ " ${CMAKE_CXX_STANDARD} " ]")
message("-- Compiler: [ " ${CMAKE_CXX_COMPILER_ID} " " ${CMAKE_CXX_COMPILER_VERSION} " ]")
message(STATUS "Language: [ C++ " ${CMAKE_CXX_STANDARD} " ]")
message(STATUS "Compiler: [ " ${CMAKE_CXX_COMPILER_ID} " " ${CMAKE_CXX_COMPILER_VERSION} " ]")
if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0.0"))
message(FATAL_ERROR "Upgrade your compiler! GCC 9.0+ is required!")
......@@ -42,26 +64,43 @@ if (vkcv_build_debug)
endif()
endif()
if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.0.0"))
list(APPEND vkcv_definitions __NO_SEMAPHORES__)
endif()
# configure everything to use the required dependencies
include(${vkcv_config}/Libraries.cmake)
# set macro to enable vulkan debug labels
list(APPEND vkcv_definitions VULKAN_DEBUG_LABELS)
# set the compile definitions aka preprocessor variables
add_compile_definitions(${vkcv_definitions})
# add modules as targets
add_subdirectory(modules)
# check if the framework is used from a parent scope
get_directory_property(vkcv_parent_scope PARENT_DIRECTORY)
if (BUILD_MODULES)
message(STATUS "Modules: ON")
# add modules as targets
add_subdirectory(modules)
else()
message(STATUS "Modules: OFF")
endif()
# add source files for compilation
include(${vkcv_config}/Sources.cmake)
message("-- Libraries: [ ${vkcv_libraries} ]")
message("-- Flags: [ ${vkcv_flags} ]")
message(STATUS "Framework:")
message(" - Libraries: [ ${vkcv_libraries} ]")
message(" - Flags: [ ${vkcv_flags} ]")
# set the compiler flags for the framework
set(CMAKE_CXX_FLAGS ${vkcv_flags})
# create VkCV framework as static library using all source files
add_library(vkcv STATIC ${vkcv_sources})
# create VkCV framework as library using all source files
add_library(vkcv ${vkcv_build_attribute} ${vkcv_sources})
if(MSVC)
#enable multicore compilation on visual studio
......@@ -73,20 +112,40 @@ endif()
# add include directories from dependencies as system includes
target_include_directories(vkcv SYSTEM BEFORE PRIVATE ${vkcv_includes})
message(STATUS ${vkcv_includes})
# add the own include directory for public headers
target_include_directories(vkcv BEFORE PUBLIC ${vkcv_include})
message(STATUS ${vkcv_include})
# link the framework using all required libraries
target_link_libraries(vkcv ${vkcv_libraries})
message(STATUS ${vkcv_libraries})
# add sub-projects/examples as targets
add_subdirectory(projects)
if (BUILD_PROJECTS)
message(STATUS "Projects: ON")
# add sub-projects/examples as targets
add_subdirectory(projects)
else()
message(STATUS "Projects: OFF")
endif()
if (NOT WIN32)
if (BUILD_DOXYGEN_DOCS)
message(STATUS "Doxygen: ON")
# add doxygen as target if installed
include(${vkcv_config}/ext/Doxygen.cmake)
else()
message(STATUS "Doxygen: OFF")
endif()
if (vkcv_parent_scope)
list(APPEND vkcv_includes ${vkcv_include})
list(APPEND vkcv_libraries vkcv)
if (BUILD_MODULES)
list(APPEND vkcv_includes ${vkcv_modules_includes})
list(APPEND vkcv_libraries ${vkcv_modules_libraries})
endif()
set(vkcv_includes ${vkcv_includes} PARENT_SCOPE)
set(vkcv_libraries ${vkcv_libraries} PARENT_SCOPE)
endif()
\ No newline at end of file
MIT License
Copyright (c) 2021 Universität Koblenz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
......@@ -16,6 +16,35 @@ More information about Git LFS [here](https://git-lfs.github.com/).
Git submodules are used for libraries.
To download the submodules either clone using `git clone --recurse-submodules` or after `git clone` use `git submodule init` and `git submodule update`.
Detailed build process:
- [How to build on Windows](doc/BUILD_WINDOWS.md)
- [How to build on macOS](doc/BUILD_MACOS.md)
- [How to build on Linux](doc/BUILD_LINUX.md)
### Dependencies (required):
Most dependencies will be used via submodules but for example Vulkan needs to be installed correctly depending on your platform. So please setup your environment properly.
| Name of dependency | Used as submodule |
|-----------------------------------|---|
| [Vulkan](https://www.vulkan.org/) | ❌ |
| [GLFW](https://www.glfw.org/) | ✅ |
| [SPIRV-CROSS](https://github.com/KhronosGroup/SPIRV-Cross) | ✅ |
| [VulkanMemoryAllocator-Hpp](https://github.com/malte-v/VulkanMemoryAllocator-Hpp) | ✅ |
### Modules (optional):
The following modules will be provided in this repository and they will automatically be builded together with the framework if used. You can configure/adjust the build using CMake if necessary.
- [Asset-Loader](modules/asset_loader/README.md)
- [Camera](modules/asset_loader/README.md)
- [GUI](modules/gui/README.md)
- [Material](modules/material/README.md)
- [Meshlet](modules/meshlet/README.md)
- [Scene](modules/scene/README.md)
- [Shader-Compiler](modules/shader_compiler/README.md)
- [Upscaling](modules/upscaling/README.md)
## Documentation
The documentation for the develop-branch can be found here:
......
# check if Doxygen is installed
find_package(Doxygen)
find_package(Doxygen QUIET)
if (DOXYGEN_FOUND)
# note the option ALL which allows to build the docs together with the application
......
# How to build on Linux
## How to build with GCC on Archlinux by the way
1. Install required and useful tools to develop:
```
sudo pacman -S cmake gcc vulkan-icd-loader vulkan-headers vulkan-validation-layers vulkan-tools
```
2. Install the matching Vulkan drivers for your system:
```
# For discrete Nvidia GPUs:
sudo pacman -S nvidia
# For integrated or discrete Radeon GPUs:
sudo pacman -S vulkan-radeon
# For integrated or discrete Intel GPUs:
sudo pacman -S vulkan-intel
```
3. Clone the repository and run the following commands:
```
mkdir debug
cd debug
cmake -DCMAKE_C_COMPILER="/usr/bin/gcc" -DCMAKE_CXX_COMPILER="/usr/bin/g++" -DCMAKE_BUILD_TYPE=Debug ..
cmake --build .
```
## How to build with Clang on Archlinux by the way
Just follow the steps of "How to build with GCC on Archlinux by the way" but replace `gcc` with `clang` and `g++` with `clang++`.
# How to build on macOS
## How to build with Clang on macOS
1. Install Homebrew
2. Install required tools to compile:
```
brew install cmake llvm libomp
```
3. Download and install latest [vulkansdk-macos-*.dmg](https://vulkan.lunarg.com/doc/sdk/1.2.189.0/mac/getting_started.html) to ~/VulkanSDK
4. Clone the repository and run the following commands:
```
mkdir debug
cd debug
export LDFLAGS="-L/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
cmake -DCMAKE_C_COMPILER="/usr/local/opt/llvm/bin/clang" -DCMAKE_CXX_COMPILER="/usr/local/opt/llvm/bin/clang++" -DCMAKE_BUILD_TYPE=Debug ..
cmake --build .
```
\ No newline at end of file
# How to build on Windows
## How to build with MSVC on Windows
1. Download and install [VulkanSDK](https://vulkan.lunarg.com/sdk/home#windows)
2. Download and install [VisualStudio](https://visualstudio.microsoft.com/vs/features/cplusplus/) for MSVC
3. (optional) Download and install [CLion](https://www.jetbrains.com/clion/) as IDE to develop
4. Create and configure a project with the framework and build it
## How to build with GCC on Windows
1. Install [MSYS2](https://www.msys2.org/)
2. Run "MSYS2 MSYS" from Start menu
3. Enter the following commands into MSYS2 console:
```
pacman -Syu
pacman -Su
pacman -S --needed base-devel mingw-w64-x86_64-toolchain
pacman -S cmake
```
4. Add to Path:
```
C:\msys64\usr\bin
C:\msys64\usr\local\bin
C:\msys64\mingw64\bin
C:\msys64\mingw32\bin
```
5. Clone the repository and run the following commands:
```
mkdir debug
cd debug
cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=C:\msys64\mingw64\bin\x86_64-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\msys64\mingw64\bin\x86_64-w64-mingw32-g++.exe .. -G "Unix Makefiles"
cmake --build .
```
\ No newline at end of file
......@@ -16,7 +16,7 @@ namespace vkcv {
friend class Core;
public:
// explicit destruction of default constructor
Buffer<T>() = delete;
Buffer() = delete;
[[nodiscard]]
const BufferHandle& getHandle() const {
......@@ -39,7 +39,7 @@ namespace vkcv {
}
[[nodiscard]]
const vk::Buffer getVulkanHandle() const {
vk::Buffer getVulkanHandle() const {
return m_manager->getBuffer(m_handle);
}
......@@ -67,7 +67,7 @@ namespace vkcv {
const size_t m_count;
const BufferMemoryType m_memoryType;
Buffer<T>(BufferManager* manager, BufferHandle handle, BufferType type, size_t count, BufferMemoryType memoryType) :
Buffer(BufferManager* manager, BufferHandle handle, BufferType type, size_t count, BufferMemoryType memoryType) :
m_manager(manager),
m_handle(handle),
m_type(type),
......
......@@ -13,7 +13,8 @@ namespace vkcv
VERTEX,
UNIFORM,
STORAGE,
STAGING
STAGING,
INDIRECT
};
enum class BufferMemoryType {
......
......@@ -331,6 +331,18 @@ namespace vkcv
const std::vector<ImageHandle> &renderTargets,
const WindowHandle &windowHandle);
void recordIndexedIndirectDrawcallsToCmdStream(
const CommandStreamHandle cmdStreamHandle,
const PassHandle renderpassHandle,
const GraphicsPipelineHandle &pipelineHandle,
const PushConstants &pushConstantData,
const vkcv::DescriptorSetHandle &compiledDescriptorSet,
const vkcv::Mesh &compiledMesh,
const std::vector<ImageHandle> &renderTargets,
const vkcv::Buffer<vk::DrawIndexedIndirectCommand> &indirectBuffer,
const uint32_t drawCount,
const WindowHandle &windowHandle);
void recordMeshShaderDrawcalls(
const CommandStreamHandle& cmdStreamHandle,
const PassHandle& renderpassHandle,
......@@ -339,6 +351,33 @@ namespace vkcv
const std::vector<MeshShaderDrawcall>& drawcalls,
const std::vector<ImageHandle>& renderTargets,
const WindowHandle& windowHandle);
/**
* Records the rtx ray generation to the @p cmdStreamHandle.
* Currently only supports @p closestHit, @p rayGen and @c miss shaderstages @c.
* @param cmdStreamHandle The command stream handle which receives relevant commands for drawing.
* @param rtxPipeline The raytracing pipeline from the RTXModule.
* @param rtxPipelineLayout The raytracing pipeline layout from the RTXModule.
* @param rgenRegion The shader binding table region for ray generation shaders.
* @param rmissRegion The shader binding table region for ray miss shaders.
* @param rchitRegion The shader binding table region for ray closest hit shaders.
* @param rcallRegion The shader binding table region for callable shaders.
* @param descriptorSetUsages The descriptor set usages.
* @param pushConstants The push constants.
* @param windowHandle The window handle defining in which window to render.
*/
void recordRayGenerationToCmdStream(
CommandStreamHandle cmdStreamHandle,
vk::Pipeline rtxPipeline,
vk::PipelineLayout rtxPipelineLayout,
vk::StridedDeviceAddressRegionKHR rgenRegion,
vk::StridedDeviceAddressRegionKHR rmissRegion,
vk::StridedDeviceAddressRegionKHR rchitRegion,
vk::StridedDeviceAddressRegionKHR rcallRegion,
const std::vector<DescriptorSetUsage>& descriptorSetUsages,
const PushConstants& pushConstants,
const WindowHandle windowHandle);
void recordComputeDispatchToCmdStream(
CommandStreamHandle cmdStream,
......
......@@ -19,7 +19,8 @@ namespace vkcv
IMAGE_SAMPLED,
IMAGE_STORAGE,
UNIFORM_BUFFER_DYNAMIC,
STORAGE_BUFFER_DYNAMIC
STORAGE_BUFFER_DYNAMIC,
ACCELERATION_STRUCTURE_KHR
};
/**
......@@ -44,6 +45,8 @@ namespace vkcv
return vk::DescriptorType::eSampledImage;
case DescriptorType::IMAGE_STORAGE:
return vk::DescriptorType::eStorageImage;
case DescriptorType::ACCELERATION_STRUCTURE_KHR:
return vk::DescriptorType::eAccelerationStructureKHR;
default:
return vk::DescriptorType::eMutableVALVE;
}
......@@ -58,17 +61,11 @@ namespace vkcv
*/
struct DescriptorBinding
{
DescriptorBinding(
uint32_t bindingID,
DescriptorType descriptorType,
uint32_t descriptorCount,
ShaderStages shaderStages
) noexcept;
uint32_t bindingID;
DescriptorType descriptorType;
uint32_t descriptorCount;
ShaderStages shaderStages;
bool variableCount;
bool operator ==(const DescriptorBinding &other) const;
};
......
......@@ -4,12 +4,13 @@
namespace vkcv {
struct SampledImageDescriptorWrite {
inline SampledImageDescriptorWrite(uint32_t binding, ImageHandle image, uint32_t mipLevel = 0, bool useGeneralLayout = false)
: binding(binding), image(image), mipLevel(mipLevel), useGeneralLayout(useGeneralLayout) {};
inline SampledImageDescriptorWrite(uint32_t binding, ImageHandle image, uint32_t mipLevel = 0, bool useGeneralLayout = false, uint32_t arrayIndex = 0)
: binding(binding), image(image), mipLevel(mipLevel), useGeneralLayout(useGeneralLayout), arrayIndex(arrayIndex) {};
uint32_t binding;
ImageHandle image;
uint32_t mipLevel;
bool useGeneralLayout;
uint32_t arrayIndex;
};
struct StorageImageDescriptorWrite {
......@@ -37,11 +38,20 @@ namespace vkcv {
SamplerHandle sampler;
};
/**
* @brief Only used for RTX. Used to bind the Acceleration Structure.
*/
struct AccelerationDescriptorWrite {
inline AccelerationDescriptorWrite(uint32_t binding) : binding(binding) {};
uint32_t binding;
};
struct DescriptorWrites {
std::vector<SampledImageDescriptorWrite> sampledImageWrites;
std::vector<StorageImageDescriptorWrite> storageImageWrites;
std::vector<BufferDescriptorWrite> uniformBufferWrites;
std::vector<BufferDescriptorWrite> storageBufferWrites;
std::vector<SamplerDescriptorWrite> samplerWrites;
std::vector<AccelerationDescriptorWrite> accelerationWrites;
};
}
\ No newline at end of file
......@@ -3,6 +3,7 @@
#include <vkcv/Handles.hpp>
#include <vkcv/DescriptorConfig.hpp>
#include <vkcv/PushConstants.hpp>
#include "Buffer.hpp"
namespace vkcv {
struct VertexBufferBinding {
......@@ -50,6 +51,8 @@ namespace vkcv {
};
vk::IndexType getIndexType(IndexBitCount indexByteCount);
struct DrawcallInfo {
inline DrawcallInfo(const Mesh& mesh, const std::vector<DescriptorSetUsage>& descriptorSets, const uint32_t instanceCount = 1)
: mesh(mesh), descriptorSets(descriptorSets), instanceCount(instanceCount){}
......@@ -66,6 +69,15 @@ namespace vkcv {
const PushConstants &pushConstants,
const size_t drawcallIndex);
void recordIndirectDrawcall(
const DrawcallInfo &drawcall,
vk::CommandBuffer cmdBuffer,
const vkcv::Buffer<vk::DrawIndexedIndirectCommand> &drawBuffer,
const uint32_t drawCount,
vk::PipelineLayout pipelineLayout,
const PushConstants &pushConstants,
const size_t drawcallIndex);
void InitMeshShaderDrawFunctions(vk::Device device);
struct MeshShaderDrawcall {
......
......@@ -3,7 +3,11 @@
#include <functional>
#ifndef __MINGW32__
#ifdef __NO_SEMAPHORES__
#include <mutex>
#else
#include <semaphore>
#endif
#endif
#include <vector>
......@@ -34,7 +38,11 @@ namespace vkcv {
uint32_t m_id_counter;
#ifndef __MINGW32__
#ifdef __NO_SEMAPHORES__
std::mutex m_mutex;
#else
std::binary_semaphore m_semaphore;
#endif
#endif
public:
......@@ -84,7 +92,11 @@ namespace vkcv {
*/
void lock() {
#ifndef __MINGW32__
#ifdef __NO_SEMAPHORES__
m_mutex.lock();
#else
m_semaphore.acquire();
#endif
#endif
}
......@@ -93,15 +105,27 @@ namespace vkcv {
*/
void unlock() {
#ifndef __MINGW32__
#ifdef __NO_SEMAPHORES__
m_mutex.unlock();
#else
m_semaphore.release();
#endif
#endif
}
explicit event(bool locked = false) {
if (locked) {
lock();
}
}
explicit event(bool locked = false)
#ifndef __MINGW32__
#ifndef __NO_SEMAPHORES__
: m_semaphore(locked? 1 : 0)
#endif
#endif
{
#ifndef __MINGW32__
#ifdef __NO_SEMAPHORES__
if (locked) m_mutex.lock();
#endif
#endif
}
event(const event &other) = delete;
......
......@@ -79,6 +79,42 @@ namespace vkcv {
[[nodiscard]]
bool checkSupport(const vk::PhysicalDeviceMeshShaderFeaturesNV& features, bool required) const;
/**
* @brief Currently used for RTX. Checks support of the @p vk::PhysicalDeviceVulkan12Features.
* @param features The features.
* @param required True, if the @p features are required, else false.
* @return @p True, if the @p features are supported, else @p false.
*/
[[nodiscard]]
bool checkSupport(const vk::PhysicalDeviceVulkan12Features& features, bool required) const;
/**
* @brief Currently used for RTX. Checks support of the @p vk::PhysicalDeviceVulkan11Features.
* @param features The features.
* @param required True, if the @p features are required, else false.
* @return @p True, if the @p features are supported, else @p false.
*/
[[nodiscard]]
bool checkSupport(const vk::PhysicalDeviceVulkan11Features& features, bool required) const;
/**
* @brief Only used for RTX. Checks support of the @p vk::PhysicalDeviceAccelerationStructureFeaturesKHR.
* @param features The features.
* @param required True, if the @p features are required, else false.
* @return @p True, if the @p features are supported, else @p false.
*/
[[nodiscard]]
bool checkSupport(const vk::PhysicalDeviceAccelerationStructureFeaturesKHR& features, bool required) const;
/**
* @brief Only used for RTX. Checks support of the @p vk::PhysicalDeviceRayTracingPipelineFeaturesKHR.
* @param features The features.
* @param required True, if the @p features are required, else false.
* @return @p True, if the @p features are supported, else @p false.
*/
[[nodiscard]]
bool checkSupport(const vk::PhysicalDeviceRayTracingPipelineFeaturesKHR& features, bool required) const;
vk::BaseOutStructure* findFeatureStructure(vk::StructureType type) const;
public:
......
......@@ -12,7 +12,13 @@ namespace vkcv {
FRAGMENT = static_cast<VkShaderStageFlags>(vk::ShaderStageFlagBits::eFragment),
COMPUTE = static_cast<VkShaderStageFlags>(vk::ShaderStageFlagBits::eCompute),
TASK = static_cast<VkShaderStageFlags>(vk::ShaderStageFlagBits::eTaskNV),
MESH = static_cast<VkShaderStageFlags>(vk::ShaderStageFlagBits::eMeshNV)
MESH = static_cast<VkShaderStageFlags>(vk::ShaderStageFlagBits::eMeshNV),
RAY_GEN = static_cast<VkShaderStageFlags>(vk::ShaderStageFlagBits::eRaygenKHR), // RTX
RAY_ANY_HIT = static_cast<VkShaderStageFlags>(vk::ShaderStageFlagBits::eAnyHitKHR), // RTX
RAY_CLOSEST_HIT = static_cast<VkShaderStageFlags>(vk::ShaderStageFlagBits::eClosestHitKHR), // RTX
RAY_MISS = static_cast<VkShaderStageFlags>(vk::ShaderStageFlagBits::eMissKHR), // RTX
RAY_INTERSECTION = static_cast<VkShaderStageFlags>(vk::ShaderStageFlagBits::eIntersectionKHR), // RTX
RAY_CALLABLE = static_cast<VkShaderStageFlags>(vk::ShaderStageFlagBits::eCallableKHR) // RTX
};
using ShaderStages = vk::Flags<ShaderStage>;
......
set(vkcv_modules_includes)
set(vkcv_modules_libraries)
# Add new modules here:
add_subdirectory(asset_loader)
add_subdirectory(camera)
......@@ -9,3 +12,12 @@ add_subdirectory(scene)
add_subdirectory(shader_compiler)
add_subdirectory(testing)
add_subdirectory(upscaling)
message(STATUS "Modules:")
message(" - Includes: [ ${vkcv_modules_includes} ]")
message(" - Libraries: [ ${vkcv_modules_libraries} ]")
if (vkcv_parent_scope)
set(vkcv_modules_includes ${vkcv_modules_includes} PARENT_SCOPE)
set(vkcv_modules_libraries ${vkcv_modules_libraries} PARENT_SCOPE)
endif()
......@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16)
project(vkcv_asset_loader)
# setting c++ standard for the module
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(vkcv_asset_loader_source ${PROJECT_SOURCE_DIR}/src)
......@@ -15,7 +15,7 @@ set(vkcv_asset_loader_sources
)
# adding source files to the module
add_library(vkcv_asset_loader STATIC ${vkcv_asset_loader_sources})
add_library(vkcv_asset_loader ${vkcv_build_attribute} ${vkcv_asset_loader_sources})
# Setup some path variables to load libraries
set(vkcv_asset_loader_lib lib)
......@@ -40,3 +40,11 @@ target_include_directories(vkcv_asset_loader SYSTEM BEFORE PRIVATE ${vkcv_asset_
target_include_directories(vkcv_asset_loader BEFORE PUBLIC ${vkcv_asset_loader_include})
target_compile_definitions(vkcv_asset_loader PUBLIC ${vkcv_asset_loader_definitions})
if (vkcv_parent_scope)
list(APPEND vkcv_modules_includes ${vkcv_asset_loader_include})
list(APPEND vkcv_modules_libraries vkcv_asset_loader)
set(vkcv_modules_includes ${vkcv_modules_includes} PARENT_SCOPE)
set(vkcv_modules_libraries ${vkcv_modules_libraries} PARENT_SCOPE)
endif()
# Asset-Loader
A VkCV module to load basic assets like models, materials and images
## Build
### Dependencies (required):
| Name of dependency | Used as submodule |
|----------------------------------------------------|---|
| [fx-gltf](https://github.com/jessey-git/fx-gltf) | ✅ |
| [nlohmann::json](https://github.com/nlohmann/json) | ✅ |
| [stb](https://github.com/nothings/stb) | ✅ |
## Docs
Here is a [link](https://vkcv.de/develop/group__vkcv__asset.html) to this module.