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

Target

Select target project
  • vulkan2021/vkcv-framework
1 result
Select Git revision
Show changes
Commits on Source (8)
Showing
with 59 additions and 17 deletions
...@@ -43,3 +43,6 @@ ...@@ -43,3 +43,6 @@
[submodule "modules/upscaling/lib/FidelityFX-FSR2"] [submodule "modules/upscaling/lib/FidelityFX-FSR2"]
path = modules/upscaling/lib/FidelityFX-FSR2 path = modules/upscaling/lib/FidelityFX-FSR2
url = https://github.com/TheJackiMonster/FidelityFX-FSR2.git url = https://github.com/TheJackiMonster/FidelityFX-FSR2.git
[submodule "lib/VulkanMemoryAllocator"]
path = lib/VulkanMemoryAllocator
url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
...@@ -8,6 +8,7 @@ option(BUILD_CLANG_FORMAT "Enables formatting the source code" OFF) ...@@ -8,6 +8,7 @@ option(BUILD_CLANG_FORMAT "Enables formatting the source code" OFF)
option(BUILD_DOXYGEN_DOCS "Enables building the VkCV doxygen documentation" OFF) option(BUILD_DOXYGEN_DOCS "Enables building the VkCV doxygen documentation" OFF)
option(BUILD_SHARED "Enables building VkCV as shared libraries" OFF) option(BUILD_SHARED "Enables building VkCV as shared libraries" OFF)
option(BUILD_VMA_VULKAN_VERSION "Enforce a specific Vulkan version for VMA" OFF) option(BUILD_VMA_VULKAN_VERSION "Enforce a specific Vulkan version for VMA" OFF)
option(BUILD_VALIDATION_FORCED "Enforce validation layers being built-in" OFF)
# uncomment the following line if cmake will refuse to build projects # uncomment the following line if cmake will refuse to build projects
#set(BUILD_PROJECTS ON) #set(BUILD_PROJECTS ON)
...@@ -79,6 +80,10 @@ if (vkcv_build_debug) ...@@ -79,6 +80,10 @@ if (vkcv_build_debug)
else() else()
set(vkcv_flags ${vkcv_flags} " -W4") set(vkcv_flags ${vkcv_flags} " -W4")
endif() endif()
list(APPEND vkcv_definitions VULKAN_VALIDATION_LAYERS)
elseif (BUILD_VALIDATION_FORCED)
list(APPEND vkcv_definitions VULKAN_VALIDATION_LAYERS)
endif() endif()
if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.0.0")) if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.0.0"))
......
...@@ -10,11 +10,12 @@ if(NOT WIN32) ...@@ -10,11 +10,12 @@ if(NOT WIN32)
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
list(APPEND vkcv_flags -Xpreprocessor) list(APPEND vkcv_flags -Xpreprocessor)
else()
# optimization for loading times
list(APPEND vkcv_flags -fopenmp)
endif() endif()
# optimization for loading times
list(APPEND vkcv_flags -pthread) list(APPEND vkcv_flags -pthread)
list(APPEND vkcv_flags -fopenmp)
endif() endif()
# add custom functions to check for git submodules # add custom functions to check for git submodules
......
...@@ -15,6 +15,18 @@ if (BUILD_VMA_VULKAN_VERSION) ...@@ -15,6 +15,18 @@ if (BUILD_VMA_VULKAN_VERSION)
math(EXPR VMA_VULKAN_VERSION "1000000 * ${VMA_VULKAN_MAJOR_VERSION} + 1000 * ${VMA_VULKAN_MINOR_VERSION} + ${VMA_VULKAN_PATCH_VERSION}" OUTPUT_FORMAT DECIMAL) math(EXPR VMA_VULKAN_VERSION "1000000 * ${VMA_VULKAN_MAJOR_VERSION} + 1000 * ${VMA_VULKAN_MINOR_VERSION} + ${VMA_VULKAN_PATCH_VERSION}" OUTPUT_FORMAT DECIMAL)
endif() endif()
use_git_submodule("${vkcv_lib_path}/VulkanMemoryAllocator" vma_status)
if (${vma_status})
if (EXISTS "${vkcv_lib_path}/VulkanMemoryAllocator/include")
set(VMA_H_PATH "${vkcv_lib_path}/VulkanMemoryAllocator/include" CACHE INTERNAL "")
else()
set(VMA_H_PATH "${vkcv_lib_path}/VulkanMemoryAllocator" CACHE INTERNAL "")
endif()
list(APPEND vkcv_includes ${VMA_H_PATH})
endif()
use_git_submodule("${vkcv_lib_path}/VulkanMemoryAllocator-Hpp" vma_hpp_status) use_git_submodule("${vkcv_lib_path}/VulkanMemoryAllocator-Hpp" vma_hpp_status)
if (${vma_hpp_status}) if (${vma_hpp_status})
......
...@@ -2,9 +2,14 @@ cmake_minimum_required(VERSION 3.9) ...@@ -2,9 +2,14 @@ cmake_minimum_required(VERSION 3.9)
project(VulkanMemoryAllocator) project(VulkanMemoryAllocator)
# settings c++ standard for the vma
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Vulkan REQUIRED) find_package(Vulkan REQUIRED)
option(VMA_VULKAN_VERSION "Enforced Vulkan version" OFF) option(VMA_VULKAN_VERSION "Enforced Vulkan version" OFF)
option(VMA_H_PATH "Location of C headers" "")
option(VMA_HPP_PATH "Location of C++ headers" "") option(VMA_HPP_PATH "Location of C++ headers" "")
option(VMA_VULKAN_H_PATH "Location of Vulkan C headers" "") option(VMA_VULKAN_H_PATH "Location of Vulkan C headers" "")
...@@ -41,12 +46,11 @@ set_target_properties( ...@@ -41,12 +46,11 @@ set_target_properties(
VulkanMemoryAllocator PROPERTIES VulkanMemoryAllocator PROPERTIES
CXX_EXTENSIONS OFF CXX_EXTENSIONS OFF
# Use C++14 CXX_STANDARD ${CMAKE_CXX_STANDARD}
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON CXX_STANDARD_REQUIRED ON
) )
target_include_directories(VulkanMemoryAllocator SYSTEM BEFORE PRIVATE ${VMA_VULKAN_H_PATH} ${VMA_VULKAN_HPP_PATH}) target_include_directories(VulkanMemoryAllocator SYSTEM BEFORE PRIVATE ${VMA_VULKAN_H_PATH} ${VMA_VULKAN_HPP_PATH} ${VMA_H_PATH})
target_include_directories(VulkanMemoryAllocator PUBLIC ${VMA_HPP_PATH}) target_include_directories(VulkanMemoryAllocator PUBLIC ${VMA_HPP_PATH})
# Only link to Vulkan if static linking is used # Only link to Vulkan if static linking is used
......
#ifndef NDEBUG #ifndef NDEBUG
#ifndef _DEBUG
#define _DEBUG #define _DEBUG
#endif #endif
#endif
#ifndef _MSVC_LANG #ifndef _MSVC_LANG
#ifdef __MINGW32__ #ifdef __MINGW32__
......
...@@ -24,7 +24,7 @@ namespace vkcv { ...@@ -24,7 +24,7 @@ namespace vkcv {
*/ */
explicit Downsampler(Core &core); explicit Downsampler(Core &core);
~Downsampler() = default; virtual ~Downsampler() = default;
/** /**
* @brief Record the commands of the given downsampler instance to * @brief Record the commands of the given downsampler instance to
......
...@@ -137,7 +137,7 @@ namespace vkcv { ...@@ -137,7 +137,7 @@ namespace vkcv {
template <typename T> template <typename T>
PushConstants pushConstants(const T &value) { PushConstants pushConstants(const T &value) {
auto pc = pushConstants<T>(); auto pc = pushConstants<T>();
pc.template appendDrawcall(value); pc.template appendDrawcall<T>(value);
return pc; return pc;
} }
...@@ -146,7 +146,7 @@ namespace vkcv { ...@@ -146,7 +146,7 @@ namespace vkcv {
auto pc = pushConstants<T>(); auto pc = pushConstants<T>();
for (const T &value : values) { for (const T &value : values) {
if (!(pc.template appendDrawcall(value))) { if (!(pc.template appendDrawcall<T>(value))) {
break; break;
} }
} }
......
Subproject commit 6a67891418a3f08be63f92726e049dc788e46f5b Subproject commit f09ba2777714871bddb70d049878af34b94fa54d
Subproject commit ae1b0c36df0943795cd621a37e7f7bfd00ac958a Subproject commit ef609a2f77dd1756e672712f264e76b64acdba61
Subproject commit c351692490513cdb0e5a2c925aaf7ea4a9b672f4
Subproject commit 2e6f3f6c13933c84b55d01c4c0cbc2e7385ac8c1 Subproject commit e00a0b1ab8bba230e8c701423540ff3828aea2d5
Subproject commit 4cb36872a5fe448c205d0b46f0e8c8b57530cfe0 Subproject commit dd8a678a66f1967372e5a5e3deac41ebf65ee127
Subproject commit 4f8fba14066156b73f1189a2b8bd568bde5284c5 Subproject commit bc889afb4c5bf1c0d8ee29ef35eaaf4c8bef8a5d
Subproject commit af1a5bc352164740c1cc1354942b1c6b72eacb8a Subproject commit 8b5f1f37b5b75829fc72d38e7b5d4bcbf8a26d55
...@@ -72,6 +72,7 @@ namespace vkcv::camera { ...@@ -72,6 +72,7 @@ namespace vkcv::camera {
* @brief Gets the view matrix of the camera * @brief Gets the view matrix of the camera
* @return The view matrix of the camera * @return The view matrix of the camera
*/ */
[[nodiscard]]
const glm::mat4& getView() const; const glm::mat4& getView() const;
/** /**
...@@ -86,12 +87,14 @@ namespace vkcv::camera { ...@@ -86,12 +87,14 @@ namespace vkcv::camera {
* @brief Gets the current projection of the camera * @brief Gets the current projection of the camera
* @return The current projection matrix * @return The current projection matrix
*/ */
[[nodiscard]]
const glm::mat4& getProjection() const; const glm::mat4& getProjection() const;
/** /**
* @brief Gets the model-view-projection matrix of the camera with y-axis-correction applied * @brief Gets the model-view-projection matrix of the camera with y-axis-correction applied
* @return The model-view-projection matrix * @return The model-view-projection matrix
*/ */
[[nodiscard]]
glm::mat4 getMVP() const; glm::mat4 getMVP() const;
/** /**
...@@ -105,6 +108,7 @@ namespace vkcv::camera { ...@@ -105,6 +108,7 @@ namespace vkcv::camera {
* @brief Gets the current field of view of the camera in radians * @brief Gets the current field of view of the camera in radians
* @return[in] The current field of view in radians * @return[in] The current field of view in radians
*/ */
[[nodiscard]]
float getFov() const; float getFov() const;
/** /**
...@@ -117,6 +121,7 @@ namespace vkcv::camera { ...@@ -117,6 +121,7 @@ namespace vkcv::camera {
* @brief Gets the current aspect ratio of the camera * @brief Gets the current aspect ratio of the camera
* @return The current aspect ratio of the camera * @return The current aspect ratio of the camera
*/ */
[[nodiscard]]
float getRatio() const; float getRatio() const;
/** /**
...@@ -136,6 +141,7 @@ namespace vkcv::camera { ...@@ -136,6 +141,7 @@ namespace vkcv::camera {
* @brief Gets the current front vector of the camera in world space * @brief Gets the current front vector of the camera in world space
* @return The current front vector of the camera * @return The current front vector of the camera
*/ */
[[nodiscard]]
glm::vec3 getFront() const; glm::vec3 getFront() const;
/** /**
...@@ -148,6 +154,7 @@ namespace vkcv::camera { ...@@ -148,6 +154,7 @@ namespace vkcv::camera {
* @brief Gets the current position of the camera in world space * @brief Gets the current position of the camera in world space
* @return The current position of the camera in world space * @return The current position of the camera in world space
*/ */
[[nodiscard]]
const glm::vec3& getPosition() const; const glm::vec3& getPosition() const;
/** /**
...@@ -160,6 +167,7 @@ namespace vkcv::camera { ...@@ -160,6 +167,7 @@ namespace vkcv::camera {
* @brief Gets the center point. * @brief Gets the center point.
* @return The center point. * @return The center point.
*/ */
[[nodiscard]]
const glm::vec3& getCenter() const; const glm::vec3& getCenter() const;
/** /**
...@@ -186,6 +194,7 @@ namespace vkcv::camera { ...@@ -186,6 +194,7 @@ namespace vkcv::camera {
* @brief Gets the pitch value of the camera in degrees. * @brief Gets the pitch value of the camera in degrees.
* @return The pitch value in degrees. * @return The pitch value in degrees.
*/ */
[[nodiscard]]
float getPitch() const; float getPitch() const;
/** /**
...@@ -198,6 +207,7 @@ namespace vkcv::camera { ...@@ -198,6 +207,7 @@ namespace vkcv::camera {
* @brief Gets the yaw value of the camera in degrees. * @brief Gets the yaw value of the camera in degrees.
* @return The yaw value in degrees. * @return The yaw value in degrees.
*/ */
[[nodiscard]]
float getYaw() const; float getYaw() const;
/** /**
...@@ -210,6 +220,7 @@ namespace vkcv::camera { ...@@ -210,6 +220,7 @@ namespace vkcv::camera {
* @brief Gets the up vector. * @brief Gets the up vector.
* @return The up vector. * @return The up vector.
*/ */
[[nodiscard]]
const glm::vec3& getUp() const; const glm::vec3& getUp() const;
/** /**
...@@ -217,6 +228,7 @@ namespace vkcv::camera { ...@@ -217,6 +228,7 @@ namespace vkcv::camera {
* @param[in] up The new up vector. * @param[in] up The new up vector.
*/ */
void setUp(const glm::vec3 &up); void setUp(const glm::vec3 &up);
}; };
/** @} */ /** @} */
......
Subproject commit 6ad79aae3eb5bf809c30bf1168171e9e55857e45 Subproject commit cc98465e3508535ba8c7f6208df934c156a018dc
#include "vkcv/geometry/Cylinder.hpp" #include "vkcv/geometry/Cylinder.hpp"
#include <numbers>
namespace vkcv::geometry { namespace vkcv::geometry {
Cylinder::Cylinder(const glm::vec3 &position, float height, float radius) Cylinder::Cylinder(const glm::vec3 &position, float height, float radius)
......
Subproject commit eda7792b151d138e15df951578253b821ceed5a3 Subproject commit 08752b372e5ebeb39adec59387590dac9d9e68f7
Subproject commit 48fd6c82b3fefb38e59dd799d8b12fddddf8e63c Subproject commit 5755de46b07e4374c05fb1081f65f7ae1f8cca81