Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/cg-tuwien/Auto-Vk-To…
Browse files Browse the repository at this point in the history
…olkit into dynamic_rendering_docs
  • Loading branch information
MatejSakmary committed Apr 26, 2024
2 parents 40d71e3 + b10bb8c commit da1bd3e
Show file tree
Hide file tree
Showing 138 changed files with 4,886 additions and 12,655 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/cross-platform-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
#}
- {
name: "linux: gcc",
cc: "gcc-10",
cxx: "g++-10"
cc: "gcc-13",
cxx: "g++-13"
}
# note: if a specific vulkan version (e.g. 1.1.x, or < 1.2.135) needs testing, you can add it here:
# (not that ubuntu-latest (20.04) only supports >= v1.2.148 via apt)
Expand All @@ -56,13 +56,18 @@ jobs:
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-${{ matrix.vulkan-sdk }}-focal.list https://packages.lunarg.com/vulkan/${{ matrix.vulkan-sdk }}/lunarg-vulkan-${{ matrix.vulkan-sdk }}-focal.list
fi
# For GCC-13
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/ppa
# Update package lists
sudo apt-get update -qq
# Install dependencies
sudo apt-get install -y \
vulkan-sdk \
libassimp-dev \
xorg-dev
xorg-dev \
g++-13 \
gcc-13
# clang does not yet (<= 12) support "Down with typename" (P0634R3), which is used in libstdc++ >= 11 in the ranges-header
if [ "${{ matrix.config.cc }}" = "clang" ]; then
Expand Down Expand Up @@ -97,7 +102,7 @@ jobs:
run: cmake --build .

windows:
name: ${{ matrix.config.name }}, VulkanSDK ${{ matrix.vulkan-sdk }}
name: ${{ matrix.config.name }}, windows-2019, VulkanSDK ${{ matrix.vulkan-sdk }}
runs-on: windows-2019
env:
vulkan_sdk: "$GITHUB_WORKSPACE/vulkan_sdk/"
Expand All @@ -110,8 +115,8 @@ jobs:
cc: "cl",
cxx: "cl"
}
# note: if a specific vulkan version (e.g. 1.1.x, or < 1.2.135) needs testing, you can add it here:
vulkan-sdk: ["latest", "1.2.176.1"]
# note: if a specific vulkan version needs testing, you can add it here:
vulkan-sdk: ["latest", "1.3.216.0"]

steps:
# IMPORTANT: apparently checkout@v3 pulls to ${{ github.event.repository.name }}/${{ github.event.repository.name }} instead of just ${{ github.event.repository.name }} on windows
Expand Down Expand Up @@ -144,6 +149,9 @@ jobs:
$env:CC="${{ matrix.config.cc }}"
$env:CXX="${{ matrix.config.cxx }}"
$env:Path += ";${{ env.vulkan_sdk }}\;${{ env.vulkan_sdk }}\Bin\"
$env:VULKAN_SDK="${{ env.vulkan_sdk }}"
$env:Vulkan_LIBRARY="${{ env.vulkan_sdk }}/Bin"
$env:Vulkan_INCLUDE_DIR="${{ env.vulkan_sdk }}/Include"
cmake `
-DCMAKE_BUILD_TYPE=$BUILD_TYPE `
-Davk_toolkit_BuildHelloWorld=ON `
Expand All @@ -155,7 +163,7 @@ jobs:
run: VULKAN_SDK=${{ env.vulkan_sdk }} cmake --build . --config $BUILD_TYPE

windows-latest:
name: ${{ matrix.config.name }}, VulkanSDK ${{ matrix.vulkan-sdk }}
name: ${{ matrix.config.name }}, windows-latest, VulkanSDK ${{ matrix.vulkan-sdk }}
runs-on: windows-latest
env:
vulkan_sdk: "$GITHUB_WORKSPACE/vulkan_sdk/"
Expand All @@ -168,8 +176,8 @@ jobs:
cc: "cl",
cxx: "cl"
}
# note: if a specific vulkan version (e.g. 1.1.x, or < 1.2.135) needs testing, you can add it here:
vulkan-sdk: ["latest", "1.2.176.1"]
# note: if a specific vulkan version needs testing, you can add it here:
vulkan-sdk: ["latest", "1.3.216.0"]

steps:
# IMPORTANT: apparently checkout@v3 pulls to ${{ github.event.repository.name }}/${{ github.event.repository.name }} instead of just ${{ github.event.repository.name }} on windows
Expand Down Expand Up @@ -201,6 +209,9 @@ jobs:
run: |
$env:CC="${{ matrix.config.cc }}"
$env:CXX="${{ matrix.config.cxx }}"
$env:VULKAN_SDK="${{ env.vulkan_sdk }}"
$env:Vulkan_LIBRARY="${{ env.vulkan_sdk }}/Bin"
$env:Vulkan_INCLUDE_DIR="${{ env.vulkan_sdk }}/Include"
$env:Path += ";${{ env.vulkan_sdk }}\;${{ env.vulkan_sdk }}\Bin\"
cmake `
-DCMAKE_BUILD_TYPE=$BUILD_TYPE `
Expand All @@ -210,4 +221,4 @@ jobs:
- name: Build
shell: bash
working-directory: ${{ runner.workspace }}/${{ github.event.repository.name }}/build
run: VULKAN_SDK=${{ env.vulkan_sdk }} cmake --build . --config $BUILD_TYPE
run: cmake --build . --config $BUILD_TYPE
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ option(avk_toolkit_CreateDependencySymlinks "Create symbolic links instead of co
option(avk_toolkit_BuildExamples "Build all examples for Auto-Vk-Toolkit." OFF)
option(avk_toolkit_BuildHelloWorld "Build example: hello_world." OFF)
option(avk_toolkit_BuildFramebuffer "Build example: framebuffer." OFF)
option(avk_toolkit_BuildDynamicRendering "Build example: dynamic_rendering." OFF)
option(avk_toolkit_BuildComputeImageProcessing "Build example: compute_image_processing." OFF)
option(avk_toolkit_BuildMultiInvokeeRendering "Build example: multi_invokee_rendering." OFF)
option(avk_toolkit_BuildModelLoader "Build example: model_loader." OFF)
Expand All @@ -57,6 +58,7 @@ option(avk_toolkit_BuildPresentFromCompute "Build example: present_from_compute.
if (avk_toolkit_BuildExamples)
set(avk_toolkit_BuildHelloWorld ON)
set(avk_toolkit_BuildFramebuffer ON)
set(avk_toolkit_BuildDynamicRendering ON)
set(avk_toolkit_BuildComputeImageProcessing ON)
set(avk_toolkit_BuildMultiInvokeeRendering ON)
set(avk_toolkit_BuildModelLoader ON)
Expand Down Expand Up @@ -226,6 +228,11 @@ if (avk_toolkit_BuildFramebuffer)
add_subdirectory(examples/framebuffer)
endif()

## dynamic_rendering
if (avk_toolkit_BuildDynamicRendering)
add_subdirectory(examples/dynamic_rendering)
endif()

## compute_image_processing
if (avk_toolkit_BuildComputeImageProcessing)
add_subdirectory(examples/compute_image_processing)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ A preconfigured project setup is provided for Visual Studio 2022 on Windows.
### Requirements
* Windows 10 or 11
* Visual Studio 2022 with a Windows 10 or 11 SDK installed (For detailed information about project setup and resource management please refer to [`visual_studio/README.md`](./visual_studio/README.md).)
* A [Vulkan SDK from LunarG](https://vulkan.lunarg.com/sdk/home), optimally Vulkan SDK 1.3.250.0 or newer.
* A [Vulkan 1.3 SDK from LunarG](https://vulkan.lunarg.com/sdk/home), optimally Vulkan SDK 1.3.250.0 or newer.

### Setup and build instructions
* Clone or download this repository
* Execute `git submodule update --init` to pull the [_Auto-Vk_](https://github.com/cg-tuwien/Auto-Vk) framework which is added as a submodule under `auto_vk`
* Download and install one of the latest [Vulkan SDKs for Windows](https://vulkan.lunarg.com/sdk/home#windows)! (At time of writing, the most recent version is 1.3.250.0.)
* Download and install one of the latest [Vulkan SDKs for Windows](https://vulkan.lunarg.com/sdk/home#windows)!
* Select the `Vulkan Memory Allocator header.` option so that the [Vulkan Memory Allocator](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator) (VMA) library is installed.
* _Note:_ VMA can be installed through the Vulkan installer or its maintenance tool (e.g., `maintenancetool.exe` on Windows) by selecting the `Vulkan Memory Allocator header.` option.
* Download and install [Visual Studio Community 2022](https://visualstudio.microsoft.com/vs/community/), or a newer version.
Expand Down
10 changes: 10 additions & 0 deletions assets/3rd_party/fonts/JetBrainsMono-2.304/AUTHORS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This is the official list of project authors for copyright purposes.
# This file is distinct from the CONTRIBUTORS.txt file.
# See the latter for an explanation.
#
# Names should be added to this file as:
# Name or Organization <email address>

JetBrains <>
Philipp Nurullin <[email protected]>
Konstantin Bulenkov <[email protected]>
93 changes: 93 additions & 0 deletions assets/3rd_party/fonts/JetBrainsMono-2.304/OFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion auto_vk_toolkit/include/animation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ namespace avk

size_t pos2 = pos1 + (pos1 < maxIndex ? 1 : 0);
while (pos2 + 1 < maxIndex && aCollection[pos2 + 1].mTime < aTime) {
LOG_WARNING(fmt::format("Now that's strange: keys[{}].mTime {} < {}, despite keys[{}].mTime {} <= {}", pos2 + 1, aCollection[pos2 + 1].mTime, aTime, pos1, aCollection[pos1].mTime, aTime));
LOG_WARNING(std::format("Now that's strange: keys[{}].mTime {} < {}, despite keys[{}].mTime {} <= {}", pos2 + 1, aCollection[pos2 + 1].mTime, aTime, pos1, aCollection[pos1].mTime, aTime));
++pos2;
}

Expand Down
4 changes: 1 addition & 3 deletions auto_vk_toolkit/include/auto_vk_toolkit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@

// ----------------------- externals -----------------------
#define FMT_HEADER_ONLY
#include <fmt/format.h>
#include <fmt/ostream.h>
#include <fmt/chrono.h>
#include <format>
#include <stb_image.h>

#include <assimp/Importer.hpp> // C++ importer interface
Expand Down
14 changes: 8 additions & 6 deletions auto_vk_toolkit/include/composition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ namespace avk
while (!sInputBufferCondVar.wait_for(lk, timeout, [thiz]{ return !thiz->mInputBufferSwapPending; })) {
cnt++;
totalWaitTime += timeout;
LOG_DEBUG(fmt::format("Condition variable waits for timed out. Total wait time in current frame is {}", totalWaitTime));
LOG_DEBUG(std::format("Condition variable waits for timed out. Total wait time in current frame is {}", totalWaitTime));
}
#else
sInputBufferCondVar.wait(lk, [thiz]{ return !thiz->mInputBufferSwapPending; });
Expand All @@ -180,7 +180,7 @@ namespace avk
//#ifdef _DEBUG
// if ((i+1) % 10000 == 0)
// {
// LOG_DEBUG(fmt::format("Warning: more than {} iterations in spin-lock", i+1));
// LOG_DEBUG(std::format("Warning: more than {} iterations in spin-lock", i+1));
// }
//#endif
#endif
Expand Down Expand Up @@ -297,9 +297,9 @@ namespace avk
mElementsToBeRemoved.erase(std::remove(std::begin(mElementsToBeRemoved), std::end(mElementsToBeRemoved), &pElement), std::end(mElementsToBeRemoved));
}
else {
LOG_DEBUG(fmt::format("Removing element with name[{}] and address[{}] issued from invokee's destructor",
LOG_DEBUG(std::format("Removing element with name[{}] and address[{}] issued from invokee's destructor",
pElement.name(),
fmt::ptr(&pElement)));
reinterpret_cast<intptr_t>(&pElement)));
}
}

Expand Down Expand Up @@ -347,7 +347,9 @@ namespace avk

#if !SINGLE_THREADED
// off it goes
std::thread renderThread(render_thread, this, std::move(aUpdateCallback), std::move(aRenderCallback));
std::thread renderThread(
render_thread<decltype(aUpdateCallback), decltype(aRenderCallback)>,
this, std::move(aUpdateCallback), std::move(aRenderCallback));
#endif

while (!mShouldStop)
Expand Down Expand Up @@ -418,7 +420,7 @@ namespace avk
context().end_composition(); // Performs a waitIdle

for (auto* w : mWindows) {
w->clean_up_command_buffers_for_frame(std::numeric_limits<window::frame_id_t>().max());
w->clean_up_resources_for_frame(std::numeric_limits<window::frame_id_t>().max());
w->remove_all_present_semaphore_dependencies_for_frame(std::numeric_limits<window::frame_id_t>().max());
}
mWindows.clear();
Expand Down
15 changes: 12 additions & 3 deletions auto_vk_toolkit/include/configure_and_compose.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "composition.hpp"
#include <vector>

namespace avk
{
Expand Down Expand Up @@ -43,21 +44,21 @@ namespace avk
template <typename... Args>
static void add_config(settings& s, vk::PhysicalDeviceFeatures& phdf, vk::PhysicalDeviceVulkan11Features& v11f, vk::PhysicalDeviceVulkan12Features& v12f, CONFIG_STRUCTS_DECLARATIONS, std::vector<invokee*>& e, std::vector<window*>& w, required_instance_extensions& aValue, Args&... args)
{
s.mRequiredInstanceExtensions = aValue;
s.mRequiredInstanceExtensions.mExtensions.insert(std::end(s.mRequiredInstanceExtensions.mExtensions), std::begin(aValue.mExtensions), std::end(aValue.mExtensions));
add_config(s, phdf, v11f, v12f, CONFIG_PARAMETERS_PASSED_ON, e, w, args...);
}

template <typename... Args>
static void add_config(settings& s, vk::PhysicalDeviceFeatures& phdf, vk::PhysicalDeviceVulkan11Features& v11f, vk::PhysicalDeviceVulkan12Features& v12f, CONFIG_STRUCTS_DECLARATIONS, std::vector<invokee*>& e, std::vector<window*>& w, required_device_extensions& aValue, Args&... args)
{
s.mRequiredDeviceExtensions = aValue;
s.mRequiredDeviceExtensions.mExtensions.insert(std::end(s.mRequiredDeviceExtensions.mExtensions), std::begin(aValue.mExtensions), std::end(aValue.mExtensions));
add_config(s, phdf, v11f, v12f, CONFIG_PARAMETERS_PASSED_ON, e, w, args...);
}

template <typename... Args>
static void add_config(settings& s, vk::PhysicalDeviceFeatures& phdf, vk::PhysicalDeviceVulkan11Features& v11f, vk::PhysicalDeviceVulkan12Features& v12f, CONFIG_STRUCTS_DECLARATIONS, std::vector<invokee*>& e, std::vector<window*>& w, optional_device_extensions& aValue, Args&... args)
{
s.mOptionalDeviceExtensions = aValue;
s.mOptionalDeviceExtensions.mExtensions.insert(std::end(s.mOptionalDeviceExtensions.mExtensions), std::begin(aValue.mExtensions), std::end(aValue.mExtensions));
add_config(s, phdf, v11f, v12f, CONFIG_PARAMETERS_PASSED_ON, e, w, args...);
}

Expand Down Expand Up @@ -163,6 +164,13 @@ namespace avk
}
#endif

template <typename... Args>
static void add_config(settings& s, vk::PhysicalDeviceFeatures& phdf, vk::PhysicalDeviceVulkan11Features& v11f, vk::PhysicalDeviceVulkan12Features& v12f, CONFIG_STRUCTS_DECLARATIONS, std::vector<invokee*>& e, std::vector<window*>& w, physical_device_features_pNext_chain_entry& aValue, Args&... args)
{
s.mPhysicalDeviceFeaturesPNextChainEntries.push_back(aValue);
add_config(s, phdf, v11f, v12f, CONFIG_PARAMETERS_PASSED_ON, e, w, args...);
}

/** >>>>>>>>>>>>>> Start the Gears <<<<<<<<<<<<<<<
*
* You may pass the following configuration parameters:
Expand All @@ -171,6 +179,7 @@ namespace avk
* - application_version& ... To declare the application version
* - required_instance_extensions& ... A struct to configure required instance extensions which must be supported by the Vulkan instance and shall be activated.
* - required_device_extensions& ... A struct to configure required device extensions which must be supported by the device.
* - physical_device_features_pNext_chain_entry ... A struct that contains a pNext pointer to a configuration struct which is to be added to the vk::PhysicalDeviceFeatures2 pNext chain.
* - window* ... A window that shall be usable during the runtime of start().
* - invokee& or invokee* ... Pointer or reference to an invokee which outlives the runtime of start().
* - std::function<void(validation_layers&) ... A function which can be used to modify the struct containing config for validation layers and validation layer features
Expand Down
Loading

0 comments on commit da1bd3e

Please sign in to comment.