Skip to content

Refactor rendergraph #533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 205 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
205 commits
Select commit Hold shift + click to select a range
f9d0dc7
[*] Remove unused msaa target file
IAmNotHanni May 12, 2023
85fb116
[sampler] Add wrapper for samplers
IAmNotHanni May 12, 2023
2d92705
[pipeline] Add wrapper for graphics pipelines
IAmNotHanni May 12, 2023
f140dfe
[pipeline-layout] Add wrapper for pipeline layouts
IAmNotHanni May 13, 2023
07aa64c
[make-info] Add more functions
IAmNotHanni May 13, 2023
568de1d
[gpu-texture] Use sampler wrapper (squash me)
IAmNotHanni May 17, 2023
00737f1
[render-graph] Use wrappers for pipelines and pipeline layouts (squas…
IAmNotHanni May 17, 2023
f66742e
[buffer] Add buffer wrapper
IAmNotHanni May 17, 2023
6ebdd69
[*] Use new buffer wrapper
IAmNotHanni May 17, 2023
ae04933
[*] Rewrite image wrapper
IAmNotHanni May 19, 2023
7020dd8
[render-graph] Use buffer wrapper
IAmNotHanni May 19, 2023
d4b2559
[render-graph] Simplify use of image wrapper
IAmNotHanni May 19, 2023
a2cf9d0
[render-graph] Move update of dynamic buffers into separate method
IAmNotHanni May 20, 2023
ada2e11
[image|render-graph] Improve image wrapper further
IAmNotHanni May 20, 2023
c47f810
[pipeline-builder|render-graph] Use graphics pipeline builder
IAmNotHanni May 20, 2023
59178a9
[render-graph|render-pass] Add wrapper for renderpasses
IAmNotHanni May 21, 2023
5f5ba9c
[*] Introduce update mechanism to ImGui
IAmNotHanni May 24, 2023
91dbcaa
[*] Remove renderer base class
IAmNotHanni May 24, 2023
5692271
[*] Add template for push constant ranges
IAmNotHanni May 24, 2023
226acf5
[render-graph] Remove build_pipeline_layout method
IAmNotHanni May 24, 2023
5cebeef
[*] Allow chaining rendergraph methods
IAmNotHanni May 24, 2023
f074710
[*] Move pipeline setup to stage wrapper
IAmNotHanni May 25, 2023
ac90edc
[*] Restructure renderer
IAmNotHanni Jun 1, 2023
5375033
[application|render-graph] Set texture format directly in constructor
IAmNotHanni Jun 1, 2023
fc61ec0
[render-graph] Make physical stage a physical resource
IAmNotHanni Jun 1, 2023
0242200
[render-graph] Simplify dynamic cast methods
IAmNotHanni Jun 1, 2023
844e450
[render-graph] Remove unused method
IAmNotHanni Jun 1, 2023
b8a1baa
[buffer|imgui] Improve ImGUI wrapper and update every frame
IAmNotHanni Jun 1, 2023
d4570da
[application|device] Move wait_idle to destructor of device wrapper
IAmNotHanni Jun 4, 2023
1a475e7
[application] Make depth buffer a member
IAmNotHanni Jun 4, 2023
ee8c1a8
[imgui|render-graph] Automate push constant range handling
IAmNotHanni Jun 4, 2023
cf9ec0c
[device] Query physical device properties in constructor
IAmNotHanni Jun 4, 2023
7ba29ee
[descriptors] Add new descriptor wrapper code
IAmNotHanni Jun 9, 2023
db25473
[*] Automate descriptor management and buffer updates
IAmNotHanni Jun 10, 2023
5c98148
[pipelines] Move pipeline related wrappers to subfolder
IAmNotHanni Jun 10, 2023
a5ad65d
[rendergraph] Put rendergraph compilation into smaller methods
IAmNotHanni Jun 10, 2023
87a021f
[render-graph] Improve formatting of console output
IAmNotHanni Jun 10, 2023
3fbf3b6
[render-graph] Small improvements
IAmNotHanni Jun 10, 2023
f6be7ac
[*] Cleanup
IAmNotHanni Jun 10, 2023
817f83a
[*] Small cleanup
IAmNotHanni Jun 10, 2023
512975b
[render-graph] Fix descriptor set updates
IAmNotHanni Jun 10, 2023
2baa257
[render-graph] Small cleanup
IAmNotHanni Jun 11, 2023
5aa0433
[descriptor] Fix descriptor pool management
IAmNotHanni Jun 11, 2023
a9d24c5
[application|render-graph] Omitting shader stage when specifying read…
IAmNotHanni Jun 11, 2023
d7226ba
[application] Small improvement to buffer updates
IAmNotHanni Jun 16, 2023
7728222
[descriptors] Improve overall descriptor management
IAmNotHanni Jun 16, 2023
20f9b6f
[rendergraph] Add more const
IAmNotHanni Jun 16, 2023
64fd3b4
[*] Rework descriptor management
IAmNotHanni Jun 17, 2023
33f8524
[rendergraph] Fix descriptors for combined image samplers
IAmNotHanni Jun 17, 2023
971f7c9
[*] Backup of work
IAmNotHanni Jun 18, 2023
9f38440
[*] Backup of work
IAmNotHanni Jun 18, 2023
7f16360
[instance] Switch to using Vulkan 1.3
IAmNotHanni Jun 19, 2023
a9c3b8e
[image|render-graph] Add another constructor for image wrapper
IAmNotHanni Jun 20, 2023
dffa1e8
[*] Switch to VK_EXT_debug_utils
IAmNotHanni Jun 20, 2023
12d23ac
[application|instance] Remove incorrect manual use of RenderDoc insta…
IAmNotHanni Jun 20, 2023
2f8f053
[doc] Correct use of RenderDoc in this project
IAmNotHanni Jun 20, 2023
197d1b8
[application] Remove option for disabling debug markers because they …
IAmNotHanni Jun 20, 2023
23e0957
[*] Use VK_EXT_debug_utils
IAmNotHanni Aug 2, 2023
64a9fec
[*] Move setup of debug messenger callback to instance wrapper
IAmNotHanni Aug 2, 2023
69c31d3
[*] Cleanup use of VK_EXT_debug_utils
IAmNotHanni Aug 2, 2023
a9818e7
[*] Fix debug utils
IAmNotHanni Aug 2, 2023
d1a7439
[device] Delete move constructor of device wrapper
IAmNotHanni Aug 2, 2023
53be5bd
[*] Remove misplaced methods in device wrapper
IAmNotHanni Aug 2, 2023
4039951
[*] Use debug utils naming system
IAmNotHanni Aug 2, 2023
1b979b6
[commad-buffer] Small cleanup
IAmNotHanni Aug 3, 2023
a283da7
[instance] Small cleanup
IAmNotHanni Aug 3, 2023
aae3d14
[*] Small cleanup of debug utils
IAmNotHanni Aug 3, 2023
bf30179
[swapchain] Allow vsync to be turned off again
IAmNotHanni Aug 3, 2023
6a526bf
[device] Add method for finding max sample count
IAmNotHanni Aug 3, 2023
e94d128
[*] Prepare for dynamic rendering
IAmNotHanni Aug 3, 2023
423b554
WIP
IAmNotHanni Aug 4, 2023
ab4c498
WIP
IAmNotHanni Aug 11, 2023
72530b3
[*] Use dynamic rendering
IAmNotHanni Oct 22, 2023
0cdf6eb
[*] WIP
IAmNotHanni Oct 23, 2023
92de322
[*] WIP
IAmNotHanni Oct 23, 2023
8b87f66
[*] WIP
IAmNotHanni Nov 3, 2023
d91c5e8
[*] WIP
IAmNotHanni Nov 3, 2023
160d7bf
[*] Backup of work
IAmNotHanni Nov 19, 2023
24ca21c
[*] WIP
IAmNotHanni Nov 19, 2023
9bd37ce
[*] WIP
IAmNotHanni Nov 19, 2023
d888c5b
[*] WIP
IAmNotHanni Nov 22, 2023
8258c7b
[*] WIP (broken)
IAmNotHanni Apr 10, 2024
f249425
[*] Improve set_debug_name
IAmNotHanni Apr 10, 2024
9a92d2e
[*] WIP
IAmNotHanni Apr 11, 2024
d9f98d6
[*] WIP
IAmNotHanni Apr 11, 2024
39e7e9c
[*] WIP
IAmNotHanni Apr 11, 2024
4097b45
[*] WIP
IAmNotHanni Apr 11, 2024
e71a1e7
[*] WIP
IAmNotHanni Apr 11, 2024
44a81e6
[*] WIP
IAmNotHanni Apr 11, 2024
c418427
[*] WIP
IAmNotHanni Apr 11, 2024
0cff923
[*] WIP
IAmNotHanni Apr 11, 2024
a663272
[*] WIP
IAmNotHanni Apr 11, 2024
a47e478
[*] WIP
IAmNotHanni Apr 12, 2024
c0c27ac
[WIP] Work in progress
IAmNotHanni Jun 24, 2024
7198888
[WIP] Work in progress
IAmNotHanni Jun 24, 2024
3ebc562
[WIP] Work in progress
IAmNotHanni Jun 24, 2024
a4bbfc6
[WIP] Work in progress
IAmNotHanni Jun 24, 2024
638e2e1
[WIP] Work in progress
IAmNotHanni Jun 26, 2024
85de555
[WIP] Work in progress
IAmNotHanni Jun 26, 2024
4ee9e44
[WIP] Work in progress
IAmNotHanni Jun 26, 2024
afc43c0
[WIP] Work in progress
IAmNotHanni Jun 27, 2024
bd8ad96
[WIP] Work in progress
IAmNotHanni Jun 27, 2024
0468c40
[WIP] Work in progress
IAmNotHanni Jun 30, 2024
2ac69f0
[WIP] Work in progress
IAmNotHanni Jun 30, 2024
e0600f5
[WIP] Work in progress
IAmNotHanni Jun 30, 2024
36a7691
[WIP] Work in progress
IAmNotHanni Jun 30, 2024
fa45441
[WIP] Work in progress
IAmNotHanni Jul 1, 2024
8365d87
[WIP] Work in progress
IAmNotHanni Jul 2, 2024
386a949
[WIP] Work in progress
IAmNotHanni Jul 2, 2024
aee8d7f
[WIP] Work in progress
IAmNotHanni Jul 2, 2024
2ec2397
[WIP] Work in progress
IAmNotHanni Jul 2, 2024
79f9de6
[WIP] Work in progress
IAmNotHanni Jul 2, 2024
8c0356f
[WIP] Work in progress
IAmNotHanni Jul 2, 2024
c557006
[WIP] Work in progress
IAmNotHanni Jul 2, 2024
8dd6bf9
[WIP] Work in progress
IAmNotHanni Jul 3, 2024
9bc5f7b
[WIP] Work in progress
IAmNotHanni Jul 3, 2024
0580be9
[WIP] Work in progress
IAmNotHanni Jul 3, 2024
e71abd9
[WIP] Work in progress
IAmNotHanni Jul 9, 2024
7cf57c5
[WIP] Work in progress
IAmNotHanni Jul 9, 2024
718219c
[WIP] Work in progress
IAmNotHanni Jul 9, 2024
dca0128
[WIP] Work in progress
IAmNotHanni Jul 9, 2024
b90e67f
[WIP] Work in progress
IAmNotHanni Jul 9, 2024
ec78f20
[WIP] Work in progress
IAmNotHanni Jul 9, 2024
106e5c6
[WIP] Work in progress
IAmNotHanni Jul 9, 2024
bce5a05
[WIP] Work in progress
IAmNotHanni Jul 11, 2024
b164185
[WIP] Work in progress
IAmNotHanni Jul 12, 2024
e7b9d15
[WIP] Work in progress
IAmNotHanni Jul 12, 2024
e0096b5
[WIP] Work in progress
IAmNotHanni Jul 12, 2024
7c38a6f
[WIP] Work in progress
IAmNotHanni Jul 12, 2024
7613930
[WIP] Work in progress
IAmNotHanni Jul 12, 2024
8832357
[WIP] Work in progress
IAmNotHanni Jul 12, 2024
669c13e
[WIP] Work in progress
IAmNotHanni Jul 13, 2024
838523f
[WIP] Work in progress
IAmNotHanni Jul 13, 2024
62acd17
[*] Cleanup
IAmNotHanni Jul 14, 2024
c8facc6
[*] Cleanup
IAmNotHanni Jul 14, 2024
b544ad5
[WIP] Work in progress
IAmNotHanni Jul 16, 2024
aa96b41
[WIP] Work in progress
IAmNotHanni Jul 16, 2024
9f7245b
[WIP] Work in progress
IAmNotHanni Jul 16, 2024
159e0d0
[WIP] Work in progress
IAmNotHanni Jul 16, 2024
24ae683
[WIP] Work in progress
IAmNotHanni Jul 16, 2024
a3c9543
[WIP] Work in progress
IAmNotHanni Jul 16, 2024
f48bcba
[WIP] Work in progress
IAmNotHanni Jul 16, 2024
46fea99
[WIP] Work in progress
IAmNotHanni Jul 16, 2024
34fa113
[WIP] Work in progress
IAmNotHanni Jul 16, 2024
b7333bc
[WIP] Work in progress
IAmNotHanni Jul 17, 2024
8036f89
[WIP] Work in progress
IAmNotHanni Jul 17, 2024
0de1bb2
[WIP] Work in progress
IAmNotHanni Jul 17, 2024
3ebe3b9
[WIP] Work in progress
IAmNotHanni Jul 17, 2024
cda30a3
[WIP] Work in progress
IAmNotHanni Jul 17, 2024
1882b8c
[WIP] Work in progress
IAmNotHanni Jul 17, 2024
fffd0c6
[WIP] Work in progress
IAmNotHanni Jul 17, 2024
a522e17
[WIP] Work in progress
IAmNotHanni Jul 17, 2024
e6a656b
[WIP] Work in progress
IAmNotHanni Jul 18, 2024
25fdabf
[WIP] Work in progress
IAmNotHanni Jul 18, 2024
0db8fa3
[WIP] Work in progress
IAmNotHanni Jul 19, 2024
d9f7fc6
[WIP] Work in progress
IAmNotHanni Jul 20, 2024
1eece3e
[WIP] Work in progress
IAmNotHanni Jul 20, 2024
d08b426
[WIP] Work in progress
IAmNotHanni Jul 20, 2024
e9370d3
[WIP] Work in progress
IAmNotHanni Jul 20, 2024
3c9153a
[WIP] Work in progress
IAmNotHanni Jul 20, 2024
0d13451
[WIP] Work in progress
IAmNotHanni Jul 20, 2024
6ec3597
[WIP] Work in progress
IAmNotHanni Jul 20, 2024
12d9f98
[WIP] Work in progress
IAmNotHanni Jul 21, 2024
998af5f
[WIP] Work in progress
IAmNotHanni Jul 21, 2024
29c34c5
[WIP] Work in progress
IAmNotHanni Jul 21, 2024
20d3b1d
[WIP] Work in progress
IAmNotHanni Jul 21, 2024
8b1c844
[WIP] Work in progress
IAmNotHanni Jul 21, 2024
92acbd1
[WIP] Work in progress
IAmNotHanni Jul 21, 2024
2e90e92
[WIP] Work in progress
IAmNotHanni Jul 21, 2024
c83a871
[WIP] Work in progress
IAmNotHanni Jul 21, 2024
8134cc2
[WIP] Work in progress
IAmNotHanni Jul 22, 2024
691d277
[WIP] Work in progress
IAmNotHanni Jul 22, 2024
9392044
[WIP] Work in progress
IAmNotHanni Jul 23, 2024
c9cc646
[WIP] Work in progress
IAmNotHanni Jul 23, 2024
2611084
[WIP] Work in progress
IAmNotHanni Jul 23, 2024
9ef0b51
[WIP] Work in progress
IAmNotHanni Jul 23, 2024
9849f5f
[WIP] Work in progress
IAmNotHanni Jul 24, 2024
5933fb9
[WIP] Work in progress
IAmNotHanni Jul 24, 2024
315473b
›[WIP] Work in progress
IAmNotHanni Aug 1, 2024
5b9abfb
[WIP] work in progress
IAmNotHanni Mar 7, 2025
998cc51
[WIP] work in progress
IAmNotHanni Mar 9, 2025
4e82d8d
[WIP] Work in progress
IAmNotHanni Mar 9, 2025
58af398
[WIP] Work in progress
IAmNotHanni Mar 10, 2025
a420391
[WIP] Work in progress
IAmNotHanni Mar 10, 2025
3b00b36
[WIP] Work in progress
IAmNotHanni Mar 11, 2025
930cd2d
[WIP] Work in progress
IAmNotHanni Mar 11, 2025
8f873b9
[WIP] Work in progress
IAmNotHanni Mar 11, 2025
e8316de
[WIP] Work in progress
IAmNotHanni Mar 11, 2025
d78c47d
[WIP] Work in progress
IAmNotHanni Mar 12, 2025
71c352e
[WIP] Work in progress
IAmNotHanni Mar 13, 2025
728b930
[WIP] Work in progress
IAmNotHanni Mar 14, 2025
0b2560e
[WIP] Work in progress
IAmNotHanni Mar 15, 2025
15c03f4
[WIP] Work in progress
IAmNotHanni Mar 15, 2025
136ab9f
[WIP] Work in progress
IAmNotHanni Mar 30, 2025
8b8e614
WIP
IAmNotHanni Apr 22, 2025
06f5c27
WIP
IAmNotHanni Apr 23, 2025
6f8c6a7
WIP
IAmNotHanni Apr 24, 2025
785e0dd
[WIP] Work in progress
IAmNotHanni Apr 25, 2025
eba05de
[WIP] Work in progress
IAmNotHanni Apr 25, 2025
8c7a67f
[WIP] Work in progress
IAmNotHanni Apr 26, 2025
a08187c
[WIP] Work in progress
IAmNotHanni May 1, 2025
ab4c395
[WIP] Work in progress
IAmNotHanni May 3, 2025
d8c365c
[*] Implement a Vulkan pipeline cache
IAmNotHanni May 4, 2025
c96fcc1
[WIP] Work in progress
IAmNotHanni May 7, 2025
9d5faa2
WIP
IAmNotHanni May 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ BasedOnStyle: LLVM
AccessModifierOffset: -4
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
BinPackParameters: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakTemplateDeclarations: Yes
ColumnLimit: 120
Expand Down
14 changes: 6 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 4.0)
project(inexor-vulkan-renderer CXX)

# Stop in source builds
Expand All @@ -23,17 +23,15 @@ message(STATUS "CXX Compiler executable: ${CMAKE_CXX_COMPILER}")
message(STATUS "Linker executable: ${CMAKE_LINKER}")
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")

# The marked constants in application.hpp will be replaced with the following values
set(INEXOR_ENGINE_NAME "Inexor Engine")
set(INEXOR_APP_NAME "Inexor Vulkan-renderer example")

set(INEXOR_ENGINE_VERSION_MAJOR 0)
set(INEXOR_ENGINE_VERSION_MINOR 1)
set(INEXOR_ENGINE_VERSION_PATCH 0)

set(INEXOR_APP_VERSION_MAJOR 0)
set(INEXOR_APP_VERSION_MINOR 1)
set(INEXOR_APP_VERSION_PATCH 0)
# The version of Vulkan API that is used
set(INEXOR_VULKAN_VERSION_MAJOR 1)
set(INEXOR_VULKAN_VERSION_MINOR 3)
set(INEXOR_VULKAN_VERSION_PATCH 0)

# Download dependencies through CMake
include (cmake/dependencies.cmake)
Expand All @@ -60,7 +58,7 @@ if(INEXOR_BUILD_DOC)
endif()

if(INEXOR_BUILD_EXAMPLE)
add_subdirectory(example)
add_subdirectory(example-app/src)
endif()

if(INEXOR_BUILD_TESTS)
Expand Down
17 changes: 9 additions & 8 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ FetchContent_Declare(glfw

FetchContent_Declare(glm
GIT_REPOSITORY https://github.com/g-truc/glm.git
GIT_TAG 0.9.9.8
GIT_TAG 1.0.1
GIT_SHALLOW ON
GIT_PROGRESS ON)
GIT_PROGRESS ON
FIND_PACKAGE_ARGS 1.0.1)

FetchContent_Declare(gtest
GIT_REPOSITORY https://github.com/google/googletest
Expand Down Expand Up @@ -62,16 +63,16 @@ FetchContent_Declare(stb

FetchContent_Declare(tinygltf
GIT_REPOSITORY https://github.com/syoyo/tinygltf.git
GIT_TAG v2.8.6
GIT_TAG v2.9.5
GIT_PROGRESS ON
FIND_PACKAGE_ARGS 2.8.6)
FIND_PACKAGE_ARGS 2.9.5)

FetchContent_Declare(toml
GIT_REPOSITORY https://github.com/ToruNiina/toml11.git
GIT_TAG v3.7.1
GIT_TAG v4.4.0
GIT_SHALLOW ON
GIT_PROGRESS ON
FIND_PACKAGE_ARGS 3.7.1)
FIND_PACKAGE_ARGS 4.4.0)

FetchContent_Declare(vma
GIT_REPOSITORY https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
Expand All @@ -81,9 +82,9 @@ FetchContent_Declare(vma

FetchContent_Declare(volk
GIT_REPOSITORY https://github.com/zeux/volk
GIT_TAG 1.3.215
GIT_TAG 1.4.304
GIT_PROGRESS ON
FIND_PACKAGE_ARGS 1.3.215)
FIND_PACKAGE_ARGS 1.4.304)

FetchContent_Declare(Vulkan
GIT_REPOSITORY https://github.com/KhronosGroup/Vulkan-Headers
Expand Down
8 changes: 0 additions & 8 deletions documentation/source/development/debugging/cla.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ You can start vulkan-renderer with the following command line arguments:

.. warning:: You should never disable validation layers because they offer extensive error checks for debugging.

.. option:: --no-vk-debug-markers

Disables `Vulkan debug markers <https://www.saschawillems.de/blog/2016/05/28/tutorial-on-using-vulkans-vk_ext_debug_marker-with-renderdoc/>`__ (even if ``--renderdoc`` is specified).

.. option:: --renderdoc

Enables the `RenderDoc <https://renderdoc.org/>`__ debug layer.

.. option:: --vsync

.. warning:: Vsync is currently not implemented. The command line argument will be ignored.
Expand Down
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.
96 changes: 1 addition & 95 deletions documentation/source/development/debugging/renderdoc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,99 +2,5 @@ RenderDoc
=========

- `RenderDoc <https://renderdoc.org/>`__ is a free and open source graphics debugger for Vulkan API (and other APIs) developed by `Baldur Karlsson <https://github.com/baldurk>`__.
- It is a very powerful graphics debugging and visualization tool which makes debugging Vulkan application as easy as possible.
- Inexor has full RenderDoc integration. This includes `internal resource naming using Vulkan debug markers <https://www.saschawillems.de/blog/2016/05/28/tutorial-on-using-vulkans-vk_ext_debug_marker-with-renderdoc/>`__.
- The following tutorial shows how to debug Inexor using RenderDoc.
- It is a very powerful graphics debugging and visualization tool which simplifies debugging Vulkan application a lot.
- You can read up more details in `RenderDoc's documentation <https://renderdoc.org/docs/getting_started/quick_start.html>`__.

RenderDoc Tutorial for Windows
------------------------------

Step 1: Open Inexor in Visual Studio and add a breakpoint before Vulkan initialization
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- The best spot would be right after ``main()``:

.. image:: /development/debugging/images/renderdoc/VisualStudioBreakpoint.jpg
:width: 800
:alt: A breakpoint after the main function in Visual Studio debugger.

Step 2: Open RenderDoc.
^^^^^^^^^^^^^^^^^^^^^^^

.. image:: /development/debugging/images/renderdoc/RenderDoc_step_1.jpg
:width: 800
:alt: RenderDoc right after starting it.

Step 3: Start debugging inexor-vulkan-renderer and halt at the breakpoint
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. image:: /development/debugging/images/renderdoc/VisualStudioDebugging.jpg
:width: 800
:alt: Visual Studio interrupts the program because of a breakpoint.

Step 4: "Inject into process" inexor-vulkan-renderer.exe using RenderDoc
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. image:: /development/debugging/images/renderdoc/RenderDoc_step_2.jpg
:width: 800
:alt: "Inject into process" in RenderDoc's menu.

Step 5: Search for "inexor-vulkan-renderer.exe" and click "inject"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- You will see a warning Windows Firewall the first time you do this.
- This is because RenderDoc is reading memory from inexor-vulkan-renderer.
- Accept the Windows Firewall warning to allow RenderDoc to read memory.

.. image:: /development/debugging/images/renderdoc/RenderDoc_step_3.jpg
:width: 800
:alt: Injecting into inexor-vulkan-renderer.

Step 6: Continue debugging in Visual Studio
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- RenderDoc should now look like this.

.. image:: /development/debugging/images/renderdoc/RenderDoc_step_4.jpg
:width: 800
:alt: Injecting into inexor-vulkan-renderer.

- Press ``F5`` to continue program execution from the breakpoint.
- RenderDoc is now connected to inexor-vulkan-renderer:

.. image:: /development/debugging/images/renderdoc/RenderDoc_step_5.jpg
:width: 800
:alt: RenderDoc is connected inexor-vulkan-renderer.

- You can see RenderDoc's overlay in inexor-vulkan-renderer.exe:

.. image:: /development/debugging/images/renderdoc/RenderDoc_step_6.jpg
:width: 800
:alt: Taking a RenderDoc snapshot.

Step 7: Debug inexor-vulkan-renderer.exe as usual and press F12 to take RenderDoc snapshots
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- You can take multiple snapshots with either ``PRINT`` or ``F12`` key.

.. image:: /development/debugging/images/renderdoc/RenderDoc_step_7.jpg
:width: 800
:alt: Taking a RenderDoc snapshot.

- You can see the snapshots in RenderDoc right after you took them:

.. image:: /development/debugging/images/renderdoc/RenderDoc_step_8.jpg
:width: 800
:alt: Taking a RenderDoc snapshot.

Step 8: Open a snapshot to analyze the rendering of this frame
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Double click on a snapshot to open it:

.. image:: /development/debugging/images/renderdoc/RenderDoc_step_9.jpg
:width: 800
:alt: Taking a RenderDoc snapshot.

- Have fun inspecting!
2 changes: 1 addition & 1 deletion documentation/source/development/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Optional Software
Improve your build times with ninja.

`RenderDoc <https://renderdoc.org/>`__
Powerful open source graphics debugger. Inexor has full RenderDoc integration.
A very powerful open source graphics debugger.

`Doxygen <http://www.doxygen.nl/download.html>`__
Required for generating the documentation.
Expand Down
3 changes: 3 additions & 0 deletions documentation/source/development/reference/rendergraph.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Rendergraph
===========

132 changes: 132 additions & 0 deletions example-app/include/example_app.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
#pragma once

#include "inexor/vulkan-renderer/input/keyboard_mouse_data.hpp"
#include "inexor/vulkan-renderer/render-graph/render_graph.hpp"
#include "inexor/vulkan-renderer/render-modules/imgui_renderer.hpp"
#include "inexor/vulkan-renderer/render-modules/octree_renderer.hpp"
#include "inexor/vulkan-renderer/tools/camera.hpp"
#include "inexor/vulkan-renderer/tools/cla_parser.hpp"
#include "inexor/vulkan-renderer/world/cube.hpp"
#include "inexor/vulkan-renderer/wrapper/device.hpp"
#include "inexor/vulkan-renderer/wrapper/instance.hpp"
#include "inexor/vulkan-renderer/wrapper/pipelines/pipeline_cache.hpp"
#include "inexor/vulkan-renderer/wrapper/surface.hpp"
#include "inexor/vulkan-renderer/wrapper/swapchain.hpp"
#include "inexor/vulkan-renderer/wrapper/window.hpp"

#include <spdlog/spdlog.h>

#include <chrono>

namespace inexor::vulkan_renderer::example_app {

// Using declarations
using input::KeyboardMouseInputData;
using render_graph::Buffer;
using render_graph::BufferType;
using render_graph::RenderGraph;
using render_graph::TextureResource;
using render_graph::TextureUsage;
using render_modules::ImGuiRenderer;
using render_modules::OctreeRenderer;
using tools::Camera;
using tools::CameraMovement;
using tools::CameraType;
using tools::CommandLineArgumentParser;
using world::Cube;
using wrapper::Device;
using wrapper::Instance;
using wrapper::Surface;
using wrapper::Swapchain;
using wrapper::Window;
using wrapper::pipelines::PipelineCache;

/// The command line arguments will be parsed into these options
struct CommandLineOptions {
bool stop_on_validation_error{false};
bool vsync_enabled{true};
std::optional<std::uint32_t> preferred_gpu{std::nullopt};
// Add your option here...
};

/// An example app using Inexor vulkan-renderer engine
class ExampleApp {
private:
CommandLineOptions m_options;
std::unique_ptr<PipelineCache> m_pipeline_cache;
std::unique_ptr<Instance> m_instance;
std::unique_ptr<Window> m_window;
std::unique_ptr<Surface> m_surface;
std::unique_ptr<Device> m_device;
std::shared_ptr<Swapchain> m_swapchain;
std::shared_ptr<RenderGraph> m_rendergraph;

std::weak_ptr<TextureResource> m_back_buffer;
std::weak_ptr<TextureResource> m_depth_buffer;

std::vector<std::shared_ptr<Cube>> m_octrees;
std::unique_ptr<OctreeRenderer> m_octree_renderer;

std::unique_ptr<ImGuiRenderer> m_imgui_renderer;

float m_time_passed{0.0f};
std::shared_ptr<Camera> m_camera;
KeyboardMouseInputData m_input_data;

std::chrono::time_point<std::chrono::high_resolution_clock> m_duration{std::chrono::high_resolution_clock::now()};
std::chrono::time_point<std::chrono::high_resolution_clock> m_last_time{std::chrono::high_resolution_clock::now()};

void create_physical_device();
void create_window();
void initialize_spdlog();
void setup_octree_rendering();
void setup_render_graph();
void recreate_swapchain();
void render_frame();
void update_time();

/// Because GLFW is a C-style API, we can't use a pointer to non-static class methods as window or input callback.
/// A good explanation can be found on Stack Overflow:
/// https://stackoverflow.com/questions/7676971/pointing-to-a-function-that-is-a-class-member-glfw-setkeycallback
/// In order to fix this, we can pass a lambda to glfwSetKeyCallback, which calls our callbacks internally. There is
/// another problem: Inside of the lambda, we need to call the member function. In order to do so, we need to have
/// access to the this-pointer. Unfortunately, the this-pointer can't be captured in the lambda capture like
/// [this](){}, because the glfw would not accept the lambda then. To fix this problem, we store the this pointer
/// using glfwSetWindowUserPointer. Inside of these lambdas, we then cast the pointer to Application* again,
/// allowing us to finally use the callbacks.
void setup_window_input_callbacks();

/// A swap function for move assignment constructor and move assignment operator
/// @param other A reference to the other instance of ExampleApp to swap with
void swap(ExampleApp &other);

/// The callback for validation messages (VK_EXT_debug_utils)
/// @param severity The severity of the message (info, warning, error)
/// @param type The type of message (validation, performance)
/// @param data Additional data related to the message
/// @param user_data Additional user-defined data related to the message
/// @return This will always return ``VK_FALSE``, meaning the app will continue to run
static VkBool32 validation_layer_debug_messenger_callback(VkDebugUtilsMessageSeverityFlagBitsEXT severity,
VkDebugUtilsMessageTypeFlagsEXT type,
const VkDebugUtilsMessengerCallbackDataEXT *data,
void *user_data);

public:
/// Default constructor
/// @param argc The number of arguments passed to the main function
/// @param argv The arguments passed to the main function
ExampleApp(int argc, char *argv[]);

void cursor_position_callback(GLFWwindow *, double, double);
void keyboard_button_callback(GLFWwindow *, int, int, int, int);
void mouse_button_callback(GLFWwindow *, int, int, int);
void mouse_scroll_callback(GLFWwindow *, double, double);
void parse_command_line_arguments(int argc, char *argv[]);
void process_mouse_input();
void process_keyboard_input();
void run();
void update_imgui();
void check_octree_collisions();
};

} // namespace inexor::vulkan_renderer::example_app
21 changes: 21 additions & 0 deletions example-app/include/example_app_meta.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma once

#include <array>

#define MAKE_API_VERSION(major, minor, patch) \
((((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch)))

namespace inexor::vulkan_renderer::example_app {

/// The following data will be filled when CMake configures this file
constexpr const char *APP_NAME{"Example-app"};
constexpr std::uint32_t APP_VERSION{MAKE_API_VERSION(0, 1, 0)};
constexpr const char *APP_VERSION_STR{"0.1.0"};
constexpr const char* ENGINE_NAME{"Inexor Engine"};
constexpr std::uint32_t ENGINE_VERSION{MAKE_API_VERSION(0, 1, 0)};
constexpr std::uint32_t USED_VULKAN_API_VERSION{MAKE_API_VERSION(1, 3, 0)};
constexpr const char *ENGINE_VERSION_STR{"0.1.0"};
constexpr const char *BUILD_GIT = "c96fcc1";
constexpr const char *BUILD_TYPE = "Release";

} // namespace inexor::vulkan_renderer::example_app
21 changes: 21 additions & 0 deletions example-app/include/example_app_meta.hpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma once

#include <array>

#define MAKE_API_VERSION(major, minor, patch) \
((((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch)))

namespace inexor::vulkan_renderer::example_app {

/// The following data will be filled when CMake configures this file
constexpr const char *APP_NAME{"${INEXOR_EXAMPLE_APP_NAME}"};
constexpr std::uint32_t APP_VERSION{MAKE_API_VERSION(${INEXOR_EXAMPLE_APP_VERSION_MAJOR}, ${INEXOR_EXAMPLE_APP_VERSION_MINOR}, ${INEXOR_EXAMPLE_APP_VERSION_PATCH})};
constexpr const char *APP_VERSION_STR{"${INEXOR_EXAMPLE_APP_VERSION_MAJOR}.${INEXOR_EXAMPLE_APP_VERSION_MINOR}.${INEXOR_EXAMPLE_APP_VERSION_PATCH}"};
constexpr const char* ENGINE_NAME{"${INEXOR_ENGINE_NAME}"};
constexpr std::uint32_t ENGINE_VERSION{MAKE_API_VERSION(${INEXOR_ENGINE_VERSION_MAJOR}, ${INEXOR_ENGINE_VERSION_MINOR}, ${INEXOR_ENGINE_VERSION_PATCH})};
constexpr std::uint32_t USED_VULKAN_API_VERSION{MAKE_API_VERSION(${INEXOR_VULKAN_VERSION_MAJOR}, ${INEXOR_VULKAN_VERSION_MINOR}, ${INEXOR_VULKAN_VERSION_PATCH})};
constexpr const char *ENGINE_VERSION_STR{"${INEXOR_ENGINE_VERSION_MAJOR}.${INEXOR_ENGINE_VERSION_MINOR}.${INEXOR_ENGINE_VERSION_PATCH}"};
constexpr const char *BUILD_GIT = "${INEXOR_GIT_SHA}";
constexpr const char *BUILD_TYPE = "${CMAKE_BUILD_TYPE}";

} // namespace inexor::vulkan_renderer::example_app
Loading
Loading