Inexor Vulkan Renderer Release v0.1-alpha.3

Inexor Collective

Sep 29, 2021

CONTENTS

1 Documentation 3 1.1 Development...... 3 1.2 Source Code...... 57 1.3 How to contribute...... 162 1.4 Frequently asked questions...... 167 1.5 Changelog...... 172 1.6 Helpful Links...... 174 1.7 Source Code License...... 177 1.8 Contact us...... 177 1.9 Frequently asked questions...... 178

Index 185

i ii Inexor Vulkan Renderer, Release v0.1-alpha.3

Inexor is a MIT-licensed open-source project which develops a new 3D octree game engine by combining modern ++ with Vulkan API.

CONTENTS 1 Inexor Vulkan Renderer, Release v0.1-alpha.3

2 CONTENTS CHAPTER ONE

DOCUMENTATION

Quickstart: Building Instructions (Windows/)& Getting started

1.1 Development

1.1.1 Supported platforms

• Vulkan API is completely platform-agnostic, which allows it to run on various operating systems. • The required drivers for Vulkan are usually part of your graphic card’s drivers. • Update your graphics drivers as often as possible since new drivers with Vulkan updates are released frequently. • Driver updates contain new features, bug fixes, and performance improvements. • Check out Khronos website for more information.

Microsoft Windows

• We support x64 8, 8.1 and 10. • We have build instructions for Windows.

Linux

• We support every x64 Linux distribution for which Vulkan drivers exist. • We have specific build instructions for Gentoo and Ubuntu. • If you have found a way to set it up for other Linux distributions, please open a pull request and let us know! macOS and iOS

• We do not support macOS or iOS because it would require us to use MoltenVK to get Vulkan running on Mac OS. • Additionally, this would require some changes in the engines as not all of Inexor’s dependencies are available on macOS or iOS.

3 Inexor Vulkan Renderer, Release v0.1-alpha.3

Android

• We also do not support Android because this would require some changes in the engines as not all of Inexor’s dependencies are available on Android.

1.1.2 Getting started

Also see the building instructions (Windows/Linux).

Required Software

Git Git for cloning (downloading) the source code. Python with pip Required for generating the documentation and the C++ package manager. Conan C++ package manager to get the required libraries (dependencies). CMake The build generator which generates project files for various IDEs. Vulkan SDK Vulkan SDK contains the libraries and tools which are necessary to work with Vulkan API. Update your Vulkan SDK as often as possible, because new versions will be released frequently which contains new features and bug fixes. Make sure you add the glslangValidator in the Vulkan SDK’s bin folder to your path variable.

Optional Software

GitKraken Git GUI. A Git user interface with many features which is easy to use. GitHub Desktop An open source Git user interface which is easy to use. Ninja Build System Improve your build times with ninja. RenderDoc Powerful open source graphics debugger. Inexor has full RenderDoc integration. Doxygen Required for generating the documentation. Notepad++ Free and open source text editor. Atom.io Free and open source text editor. Visual Studio Code Free and open source text editor.

Does my graphics card support Vulkan?

• You can look up your graphics card in Sascha Willem’s Vulkan hardware database. • Every new graphics card which is coming out these days supports Vulkan API. • Vulkan is also supported on older graphics cards going back to HD 7000 series and Geforce 6 series.

4 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Update your graphics drivers!

• Update your graphics drivers as often as possible. • New drivers contain new features, bug fixes, and performance improvements.

1.1.3 Building -renderer

• Windows • Linux Also see Getting started. If you have any trouble please open a ticket or join our Discord server. This project uses out of source builds using either gcc, clang or Microsoft Visual Studio compiler. Generating the documentation will create two subfolders in doc which will be ignored by git. The following CMake targets and options are available:

Table 1: List of CMake build targets. build target description comment inexor-vulkan-renderer The main executable. inexor-vulkan-renderer-tests Tests the renderer using Google Test. There are no tests available yet. inexor-vulkan-renderer- Benchmarking of the renderer using Google Benchmark. There are no bench- benchmark marks available yet. inexor-vulkan-renderer- Builds the documentation with Sphinx. Enable target documentation creation with -DINEXOR_BUILD_DOC=ON. inexor-vulkan-renderer- Use sphinx’s linkcheck feature to search for broken links. documentation-linkcheck

Table 2: List of CMake options. option description default value INEXOR_BUILD_EXAMPLE Builds inexor-renderer-example. ON INEXOR_BUILD_TESTS Builds inexor-renderer-tests. OFF INEXOR_BUILD_BENCHMARKS Builds inexor-renderer-benchmarks. OFF INEXOR_CONAN_PROFILE To adjust the conan profile, use default -DINEXOR_CONAN_PROFILE=. INEXOR_USE_VMA_RECORDING Enables or disables Vulkan Memory Allocator’s recording OFF feature. INEXOR_BUILD_DOC Builds the documentation with Sphinx. OFF INEXOR_BUILD_DOCUMENTATION_USE_VENVGenerate and use a Python virtual environment for the doc- ON umentation dependencies.

1.1. Development 5 Inexor Vulkan Renderer, Release v0.1-alpha.3

Windows

Example: Create Visual Studio 2019 project map for Debug mode including docs, tests, and benchmarks: cmake -G "Visual Studio 16 2019" -A x64 -B./cmake-build-debug-vs/ -DCMAKE_BUILD_

˓→TYPE=Debug -DINEXOR_BUILD_DOC=ON -DINEXOR_BUILD_TESTS=ON -DINEXOR_BUILD_BENCHMARKS=ON .

˓→/

Example: Create Visual Studio 2019 project map for Release mode but without docs, tests, and benchmarks: cmake -G "Visual Studio 16 2019" -A x64 -B./cmake-build-release-vs/ -DCMAKE_BUILD_

˓→TYPE=Release ./

If you have Ninja build system installed, you can use it like this: # executing from project root assumed # Ninja generator and Debug type \> cmake -DINEXOR_CONAN_PROFILE=default -G Ninja -B./cmake-build-debug/ -DCMAKE_BUILD_

˓→TYPE=Debug ./ # Ninja generator and Release type \> cmake -G Ninja -B./cmake-build-release/ -DCMAKE_BUILD_TYPE=Release ./ # Create Visual Studio Solution \> cmake -G"Visual Studio 16 2019" -A x64 -B./cmake-build-debug-vs/ -DCMAKE_BUILD_

˓→TYPE=Debug ./ # Build all targets \> cmake --build ./cmake-build-debug/

Note: If you use CMake GUI add CMAKE_BUILD_TYPE with value Debug or Release. #228.

• Choose any IDE that CMake can generate a project map for. If in doubt use Visual Studio 2019. • Clone the source code. Free and good tools are GitHub Desktop or GitKraken Git GUI. • Open CMake and select the root folder which contains CMakeLists.txt (not just src folder!). • You can choose any location for the build folder. • Click “Configure” and select your IDE (in doubt Visual Studio 16 2019). Click “Finish”. • CMake will now set up dependencies automatically for you using conan package manager. This might take a while. If this fails, you really should open a ticket! • Click “Generate”. You can now open the Visual Studio project file in your build folder. • For debugging, please check that the root directory of the repository is set as working directory in Visual Studio. Usually, CMake should take care of this already. • You are now ready to start debugging! Our master branch must be stable at all cost.

6 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Linux

Install dependencies and tools:

1.1. Development 7 Inexor Vulkan Renderer, Release v0.1-alpha.3

Ubuntu Follow the Install the SDK-instructions on the vulkan- sdk page. Install the required packages:1 # apt install -y \ pkg-config \ libglm-dev \ libxcb-dri3-0 \ libxcb-present0 \ libpciaccess0 \ libpng-dev \ libxcb-keysyms1-dev \ libxcb-dri3-dev \ libx11-dev \ libmirclient-dev \ libwayland-dev \ libxrandr-dev \ libxcb-ewmh-dev # apt install -y \ cmake \ ninja-build \ clang-tidy \ vulkan-sdk \ python3 \ python3-pip $ pip3 install \ wheel \ setuptools \ conan

Gentoo # emerge \ dev-util/cmake \ dev-util/conan \ dev-util/vulkan-headers \ dev-util/vulkan-tools \ dev-vcs/git \ media-libs/vulkan-layers \ media-libs/vulkan-loader Install ninja build tool (optional): # emerge dev-util/ninja

Debian Follow the Install the SDK-instructions on the vulkan- sdk page. Install the required packages:? # apt install -y \ libvulkan-dev glslang-dev glslang-tools vulkan-tools vulkan-validationlayers-dev spirv-tools pkg-config \ libglm-dev \ libxcb-dri3-0 \ 8 libxcb-present0Chapter \ 1. Documentation libpciaccess0 \ libpng-dev \ libxcb-keysyms1-dev \ libxcb-dri3-dev \ libx11-dev \ libmirclient-dev \ libwayland-dev \ libxrandr-dev \ libxcb-ewmh-dev # apt install -y \ cmake \ ninja-build \ clang-tidy \ vulkan-sdk \ python3 \ python3-pip $ pip3 install \ wheel \ setuptools \ conan

Other Planned. We would love to see a pull request on this file if you get it running on other distributions. Inexor Vulkan Renderer, Release v0.1-alpha.3

Clone the repository: $ git clone https://github.com/inexorgame/vulkan-renderer $ cd vulkan-renderer

Configure cmake:

Note: Only pass -GNinja if the ninja build tool is installed.

$ cmake . \ -Bbuild \ -DCMAKE_BUILD_TYPE=Debug \ -GNinja

Build and run: If you have any trouble please open a ticket or join our Discord server. $ cmake --build build --target inexor-vulkan-renderer-example $ ./build/bin/inexor-vulkan-renderer-example

1.1.4 Debugging

Logfiles

Inexor uses spdlog for both console logging and logfiles.

1 Make sure that $PATH includes the directory which contains conan (normally $HOME/.local/bin). Bash includes this directory by default, zsh does not.

1.1. Development 9 Inexor Vulkan Renderer, Release v0.1-alpha.3

The log output which can be seen in the console will also be written to vulkan-renderer.log in the root directory. You can open and read this logfile with a text editor of your choice. We are using the following log entry format %Y-%m-%d %T.%f %^%l%$ %5t [%-10n] %v. • %Y is the year. • %m is the month (01 to 12). • %d is the day of month (01 to 31). • %T is ISO 8601 time format (HH:MM:SS). • %f is the microsecond part of the current second. • %^%l%$ is the color-coded log level. • %5t is the thread id formatted to a string of length 5. • [%-10n] is the name of the logger, limited to 10 characters. • %v is the log message. For more information, check out spdlog’s documentation about custom formatting. Use the following rules for logging: • Don’t use std::cout or printf or similar. Just use spdlog instead. • Place as many log messages to your code as possible. • End log messages with a . to show that the message is finished. • Use all log levels as you need it: spdlog::trace, spdlog::info, spdlog::debug, spdlog::error, spdlog::critical. • You can print variables with spdlog (see this reference) because it is based on fmt library.

10 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

• Use direct API calls like spdlog::debug("Example text here"); instead of creating your own logger name for now. We will come up with a strategy for logger hierarchy later.

Command Line Arguments

You can start vulkan-renderer with the following command line arguments: --gpu Specifies which GPU to use by array index, starting from 0.

Note: The engine checks if this index is valid. If the index is invalid, automatic GPU selection rules apply.

--no-separate-data-queue Disables the use of the special data transfer queue (forces use of the graphics queue).

Warning: Enabling this option could decrease the overall performance. Don’t enable this option unless you have to.

--no-stats Disables GPU info printing. --no-validation Disables Vulkan validation layers.

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

--no-vk-debug-markers Disables Vulkan debug markers (even if --renderdoc is specified). --renderdoc Enables the RenderDoc debug layer. --vsync

Warning: Vsync is currently not implemented. The command line argument will be ignored. Enables vertical synchronization (limits FPS to monitor refresh rate).

RenderDoc

• RenderDoc is a free and open source graphics debugger for Vulkan API (and other ) developed by Baldur Karlsson. • 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. • The following tutorial shows how to debug Inexor using RenderDoc. • You can read up more details in RenderDoc’s documentation.

1.1. Development 11 Inexor Vulkan Renderer, Release v0.1-alpha.3

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():

12 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Step 2: Open RenderDoc.

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

1.1. Development 13 Inexor Vulkan Renderer, Release v0.1-alpha.3

Step 4: “Inject into process” inexor-vulkan-renderer.exe using RenderDoc

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.

14 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Step 6: Continue debugging in Visual Studio

• RenderDoc should now look like this.

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

1.1. Development 15 Inexor Vulkan Renderer, Release v0.1-alpha.3

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

16 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

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.

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

1.1. Development 17 Inexor Vulkan Renderer, Release v0.1-alpha.3

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

• Double click on a snapshot to open it:

• Have fun inspecting!

18 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

VMA dumps

• For memory management, Inexor uses AMD’s Vulkan Memory Allocator library (VMA). • VMA can export an overview of the current GPU memory allocations into a JSON file which can be converted into an image using VMA’s VmaDumpVis. • This way we can see which memory pools exist, which memory blocks are allocated, and what they are used for. • The example image provided here might look very simple, but with increasing complexity of our engine this will turn out very helpful. • You can see an memory allocation overview image generated by VmaDumpVis. for a big AAA game here. This is a very simple example of such an image generated with VmaDumpVis:

Example: march 2020 texture memory corruption bug • In march 2020, a bug in Inexor’s early graphics memory management caused textures to corrupt on window resize. • VmaDumpVis helped to resolve the issue by proving the memory consumption increased after each resize, which means the texture memory was simply not freed when the swapchain was recreated. • This is an example of how VMA and VmaDumpVis make debugging graphics memory easier.

1.1. Development 19 Inexor Vulkan Renderer, Release v0.1-alpha.3

VMA replays

• For memory management, Inexor uses AMD’s Vulkan Memory Allocator library (VMA). • Inexor supports VMA’s internal resource naming system. • This means we can give every memory region a user-defined name. • The allocations and deallocations will be tracked in vma_replay.csv in the folder vma-replays. • The memory allocations can be replayed using VMA’s memory replay. An example dump (from the march 2020 texture corruption bug) looks like this: Note that some resources have already an internal name assigned to it, like Example vertex buffer 1. Vulkan Memory Allocator,Calls recording 1,8 Config,Begin VulkanApiVersion,1,0 PhysicalDevice,apiVersion,4198495 PhysicalDevice,driverVersion,1783087104 (continues on next page)

20 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

(continued from previous page) PhysicalDevice,vendorID,4318 PhysicalDevice,deviceID,4052 PhysicalDevice,deviceType,2 PhysicalDevice,deviceName,GeForce GTX 660M PhysicalDeviceLimits,maxMemoryAllocationCount,4096 PhysicalDeviceLimits,bufferImageGranularity,65536 PhysicalDeviceLimits,nonCoherentAtomSize,64 PhysicalDeviceMemory,HeapCount,2 PhysicalDeviceMemory,Heap,0,size,2075918336 PhysicalDeviceMemory,Heap,0,flags,1 PhysicalDeviceMemory,Heap,1,size,8265048064 PhysicalDeviceMemory,Heap,1,flags,0 PhysicalDeviceMemory,TypeCount,11 PhysicalDeviceMemory,Type,0,heapIndex,1 PhysicalDeviceMemory,Type,0,propertyFlags,0 PhysicalDeviceMemory,Type,1,heapIndex,1 PhysicalDeviceMemory,Type,1,propertyFlags,0 PhysicalDeviceMemory,Type,2,heapIndex,1 PhysicalDeviceMemory,Type,2,propertyFlags,0 PhysicalDeviceMemory,Type,3,heapIndex,1 PhysicalDeviceMemory,Type,3,propertyFlags,0 PhysicalDeviceMemory,Type,4,heapIndex,1 PhysicalDeviceMemory,Type,4,propertyFlags,0 PhysicalDeviceMemory,Type,5,heapIndex,1 PhysicalDeviceMemory,Type,5,propertyFlags,0 PhysicalDeviceMemory,Type,6,heapIndex,1 PhysicalDeviceMemory,Type,6,propertyFlags,0 PhysicalDeviceMemory,Type,7,heapIndex,0 PhysicalDeviceMemory,Type,7,propertyFlags,1 PhysicalDeviceMemory,Type,8,heapIndex,0 PhysicalDeviceMemory,Type,8,propertyFlags,1 PhysicalDeviceMemory,Type,9,heapIndex,1 PhysicalDeviceMemory,Type,9,propertyFlags,6 PhysicalDeviceMemory,Type,10,heapIndex,1 PhysicalDeviceMemory,Type,10,propertyFlags,14 Extension,VK_KHR_dedicated_allocation,0 Extension,VK_KHR_bind_memory2,0 Extension,VK_EXT_memory_budget,0 Extension,VK_AMD_device_coherent_memory,0 Macro,VMA_DEBUG_ALWAYS_DEDICATED_MEMORY,0 Macro,VMA_DEBUG_ALIGNMENT,1 Macro,VMA_DEBUG_MARGIN,16 Macro,VMA_DEBUG_INITIALIZE_ALLOCATIONS,1 Macro,VMA_DEBUG_DETECT_CORRUPTION,1 Macro,VMA_DEBUG_GLOBAL_MUTEX,0 Macro,VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY,1 Macro,VMA_SMALL_HEAP_MAX_SIZE,1073741824 Macro,VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE,268435456 Config,End 8644,0.002,0,vmaCreateAllocator 8644,0.134,0,vmaCreateImage,0,1,126,800,600,1,1,1,1,0,32,0,0,32,1,0,0,0,0000000000000000,

˓→0000000007F66FA0,Depth buffer image. (continues on next page)

1.1. Development 21 Inexor Vulkan Renderer, Release v0.1-alpha.3

(continued from previous page) 8644,0.302,0,vmaCreateBuffer,0,4194304,1,0,36,3,0,0,0,0000000000000000,0000000007F66FE8,

˓→example_texture_1 8644,0.304,0,vmaCreateImage,0,1,37,1024,1024,1,1,1,1,0,6,0,0,32,1,0,0,0,0000000000000000,

˓→0000000007F67030,example_texture_1 8644,0.388,0,vmaDestroyBuffer,0000000007F66FE8 8644,0.652,0,vmaCreateBuffer,0,192,16,0,36,3,0,0,0,0000000000000000,0000000007F66FE8,

˓→Uniform buffer #0 8644,0.663,0,vmaCreateBuffer,0,192,16,0,36,3,0,0,0,0000000000000000,0000000007F67078,

˓→Uniform buffer #1 8644,0.673,0,vmaCreateBuffer,0,192,16,0,36,3,0,0,0,0000000000000000,0000000007F670C0,

˓→Uniform buffer #2 8644,0.737,0,vmaCreateBuffer,0,128,1,0,36,2,0,0,0,0000000000000000,0000000007F67108,

˓→Example vertex buffer1 8644,0.752,0,vmaCreateBuffer,0,192,1,0,36,2,0,0,0,0000000000000000,0000000007F67150,

˓→Example vertex buffer1 8644,0.762,0,vmaCreateBuffer,0,128,130,0,36,2,0,0,0,0000000000000000,0000000007F67198,

˓→Example vertex buffer1 8644,0.767,0,vmaCreateBuffer,0,192,66,0,36,2,0,0,0,0000000000000000,0000000007F671E0,

˓→Example vertex buffer1 8644,0.817,0,vmaDestroyBuffer,0000000007F67108 8644,0.821,0,vmaDestroyBuffer,0000000007F67150 8644,0.842,0,vmaCreateBuffer,0,128,1,0,36,2,0,0,0,0000000000000000,0000000007F67150,

˓→Example vertex buffer2 8644,0.855,0,vmaCreateBuffer,0,192,1,0,36,2,0,0,0,0000000000000000,0000000007F67108,

˓→Example vertex buffer2 8644,0.866,0,vmaCreateBuffer,0,128,130,0,36,2,0,0,0,0000000000000000,0000000007F67228,

˓→Example vertex buffer2 8644,0.870,0,vmaCreateBuffer,0,192,66,0,36,2,0,0,0,0000000000000000,0000000007F67270,

˓→Example vertex buffer2 8644,0.920,0,vmaDestroyBuffer,0000000007F67150 8644,0.926,0,vmaDestroyBuffer,0000000007F67108 8644,1.113,0,vmaDestroyBuffer,0000000007F66FE8 8644,1.113,0,vmaDestroyBuffer,0000000007F67078 8644,1.113,0,vmaDestroyBuffer,0000000007F670C0 8644,1.195,0,vmaCreateImage,0,1,126,800,600,1,1,1,1,0,32,0,0,32,1,0,0,0,0000000000000000,

˓→0000000007F670C0,Depth buffer image. 8644,1.235,0,vmaCreateBuffer,0,192,16,0,36,3,0,0,0,0000000000000000,0000000007F67078,

˓→Uniform buffer #0 8644,1.246,0,vmaCreateBuffer,0,192,16,0,36,3,0,0,0,0000000000000000,0000000007F66FE8,

˓→Uniform buffer #1 8644,1.255,0,vmaCreateBuffer,0,192,16,0,36,3,0,0,0,0000000000000000,0000000007F67108,

˓→Uniform buffer #2 8644,2.432,0,vmaDestroyBuffer,0000000007F67078 8644,2.432,0,vmaDestroyBuffer,0000000007F66FE8 8644,2.432,0,vmaDestroyBuffer,0000000007F67108 8644,2.450,0,vmaDestroyImage,0000000007F67030 8644,2.469,0,vmaDestroyBuffer,0000000007F67198 8644,2.474,0,vmaDestroyBuffer,0000000007F671E0 8644,2.484,0,vmaDestroyBuffer,0000000007F67228 8644,2.489,0,vmaDestroyBuffer,0000000007F67270 8644,2.617,0,vmaDestroyAllocator

22 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

1.1.5 Engine design

Folder structure

• Use lowercase filenames • Don’t use spaces, use underscores.

Source code connector/ «project root» .clang-format «Clang Format configuration» .clang-tidy «Clang Tidy configuration» .git-blame-ignore-revs «git ignore revisions» .gitignore «git ignore» .readthedocs.yml «Read The Docs configuration» CHANGELOG.rst CMakeLists.txt CODE_OF_CONDUCT.md conanfile.py «Conan configuration» CONTRIBUTING.md LICENSE.md README.rst .github/ «GitHub templates and action configurations» assets/ models/ textures/ «textures» benchmarks/ cmake/ «CMake helpers» configuration/ documentation/ CMakeLists.txt «CMake file for the documentation» cmake/ «documentation cmake helpers» source/ «documentation source code» example/ «example application» include/ «header files» shaders/ src/ «source code» tests/ third_party/ «third party dependencies» vma-dumps/ vma-replays/

1.1. Development 23 Inexor Vulkan Renderer, Release v0.1-alpha.3

Application vulkan-renderer/ «application root» inexor-vulkan-renderer.exe «executable» ... assets/ shaders/ ...

Dependency management

• In general we try to keep the number of dependencies at a minimum. • We avoid to add dependencies directly to the project repository because they increase the size of the repository and we have to update them manually. • Instead, we prefer to use conan package manager which allows us to get most dependencies from conan center.

Conan package manager

• The list of currently used dependencies can be found in conanfile.py in the root folder of the repository. • You must have installed CMake and conan package manager in oder to download the dependencies automatically from conan center when running CMake. • For details please read building Instructions (Windows/Linux).

Dependency folder

• If we really need a dependency which is not yet available through conan center, we add it manually to the third_party folder.

Criteria for library selection

If we really need a new library, it should be selected based on the following considerations: • Are you sure we need this library? Can’t we solve the problem with C++ standard library or some other library we are already using? • The library must have an open source license which is accepted by us (see Licenses). • It must be in active development. • It must have a good documentation. • A sufficient number of participants must have contributed so we can be sure itisreviewed.

24 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Coding style

The easiest way to get the right format is to use the provided clang-format file in the root directory. Other styles which cannot be applied automatically are listed below: • Use #pragma once as include guards • Own headers are included with quotes • Includes are ordered as follows – Own headers – empty line – Third Party Libraries – empty line – System Libraries • Use C++17 namespace style namespace inexor::vulkan-renderer • No using • For default member initialization use brace instead of equal initialization • Prefer American English over British English • Use spaces to indent • Use Linux line ends (ln) in your commits • Use /// for multiline documentation instead of /**/

Naming convention

Open the .clang-tidy file and search for readability-identifier-naming to get the naming convention used by this project.

Error handling

• Use exceptions for error handling, as proposed by the C++ core guidelines. • More information about why to use exceptions can be found here.

Get methods

• Name: Don’t use prefix get_. Give the get method the same name as the resource it returns. • For complex types (std::vector, std::string), return a const reference. • Don’t const the return type for simple types (int, float), because this prevents move semantics to be applied. • For simple types (int, float), just copy the return value. • Mark get methods as [[nodiscard]] in the header file only. • Mark get methods as const, so they don’t change members. • Do not add documentation for get methods, since it is self-explanatory.

1.1. Development 25 Inexor Vulkan Renderer, Release v0.1-alpha.3

• Keep get methods directly in the header file. • Do not add inline since get methods in header files are always inlined. • The get method should not run any other code, like checking if the value is actually valid. Since we are using RAII, the value to return must be in a valid state anyways. • Use operator overloading sparingly. Prefer get methods instead. Examples:

[[nodiscard]] const glm::vec3& position() const { return m_position; }

[[nodiscard]] float aspect_ratio() const { return m_aspect_ratio; }

Removed clang-tidy checks

bugprone-narrowing-conversions Same as cppcoreguidelines-narrowing-conversions cppcoreguidelines-avoid-magic-numbers Alias of readability-magic-numbers cppcoreguidelines-c-copy-assignment-signature Alias of misc-unconventional-assign-operator cppcoreguidelines-non-private-member-variables-in-classes Alias of misc-non-private-member-variables-in-classes cppcoreguidelines-pro-bounds-array-to-pointer-decay Not suitable for this project. google-readability-todo We do not care about any TODO assignments or related issues. hicpp-explicit-conversions Alias of google-explicit-constructor hicpp-move-const-arg Alias of performance-move-const-arg hicpp-no-array-decay Alias of cppcoreguidelines-pro-bounds-array-to-pointer-decay hicpp-uppercase-literal-suffix Alias of readability-uppercase-literal-suffix llvm-header-guard #pragma once is used. modernize-use-trailing-return-type Trailing return types are not used. readability-magic-numbers Too many places where it would be useless to introduce a constexpr value. readability-uppercase-literal-suffix Just a style preference.

Code design

Literature

The following books inspired Inexor’s code design: • Bjarne Stroustrup: The C++ Programming Language (4th Edition) • Scott Meyers: Effective Modern C++ • Scott Meyers: Effective C++: 55 Specific Ways to Improve Your Programs and Designs, Third Edition • Scott Meyers: Effective STL

26 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

• Nicolai M. Josuttis: C++ Move Semantics - The Complete Guide • Nicolai M. Josuttis: C++ Templates - The Complete Guide, 2nd Edition • Bartłomiej Filipek C++ Lambda Story • Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides: Design Patterns: Elements of Reusable Object- Oriented Software • Robert C. Martin: Clean Code: A Handbook of Agile Software Craftsmanship • Robert C. Martin: The Clean Coder: A Code of Conduct for Professional • Robert C. Martin: Clean Architecture: A Craftsman’s Guide to Software Structure and Design, First Edition • Fedor G. Pikus: Hands-On Design Patterns with C++ • Rian Quinn: Advanced C++ Programming Cookbook

General considerations

• Organize the code in components. • Split declarations and definitions, if possible. • Make appropriate use of the standard library. • Avoid data redundancy in the engine. Do not keep memory copied unnecessarily. • Do not duplicate code. Find an appropriate abstraction which accounts for the scenario. • Try to keep dependencies between components at minimum because single components (e.g. classes) should be as recyclable as possible. • Use spdlog instead of printf or std::cout for console output. • Use assert to validate parameters or necessary resources during development (debug mode). • Document the code using doxygen comments. Code without documentation is almost useless. • Make sure the code is platform-independent. For now, we will support Windows and Linux but not Mac OS. • Use Vulkan memory allocator library for Vulkan-specific memory allocations like buffers. • Do not allocate memory manually. Use modern ++ features like smart pointers or STL containers instead. • Don’t use global variables. • Don’t use the singleton pattern as it makes thread safety and refactoring difficult. • Don’t use call-by-value for returning values from a function call. • Don’t use macros for code generation or as a replacement for enumerations.

1.1. Development 27 Inexor Vulkan Renderer, Release v0.1-alpha.3

C++ core guidelines

• The C++ code guidelines are a set of rules to use for modern C++ projects created by the C++ community. • In the following section, we will list up the entries which are of considerable interest for the Inexor project. • There will be some gaps in the number as we skipped some of the less importer ones. • Also the code guidelines have gaps by default (blank space for new rules).

Philosophy

• P.1: Express ideas directly in code • P.3: Express intent • P.4: Ideally, a program should be statically type safe • P.5: Prefer compile-time checking to run-time checking • P.8: Don’t leak any resources • P.9: Don’t waste time or space • P.10: Prefer immutable data to mutable data • P.11: Encapsulate messy constructs, rather than spreading through the code

Interfaces

• I.1: Make interfaces explicit • I.4: Make interfaces precisely and strongly typed • I.5: State preconditions (if any) • I.7: State postconditions • I.10: Use exceptions to signal a failure to perform a required task • I.11: Never transfer ownership by a raw pointer (T*) or reference (T&) • I.13: Do not pass an array as a single pointer • I.23: Keep the number of function arguments low • I.24: Avoid adjacent parameters of the same type when changing the argument order would change meaning

Functions and class methods

• F.1: “Package” meaningful operations as carefully named functions • F.2: A function should perform a single logical operation • F.4: If a function may have to be evaluated at compile time, declare it constexpr • F.7: For general use, take T* or T& arguments rather than smart pointers • F.15: Prefer simple and conventional ways of passing information • F.16: For “in” parameters, pass cheaply-copied types by value and others by reference to const • F.18: For “will-move-from” parameters, pass by X&& and std::move the parameter

28 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

• F.20: For “out” output values, prefer return values to output parameters • F.21: To return multiple “out” values, prefer returning a struct or tuple • F.26: Use a unique_ptr to transfer ownership where a pointer is needed • F.27: Use a shared_ptr to share ownership • F.43: Never (directly or indirectly) return a pointer or a reference to a local object • F.45: Don’t return a T&& • F.51: Where there is a choice, prefer default arguments over overloading • F.55: Don’t use va_arg arguments

Classes

• C.2: Use class if the class has an invariant; use struct if the data members can vary independently • C.3: Represent the distinction between an interface and an implementation using a class • C.4: Make a function a member only if it needs direct access to the representation of a class • C.7: Don’t define a class or enum and declare a variable of its type in the same statement • C.8: Use class rather than struct if any member is non-public • C.9: Minimize exposure of members

Enumerations

• Enum.1: Prefer enumerations over macros • Enum.2: Use enumerations to represent sets of related named constants • Enum.3: Prefer class enums over “plain” enums • Enum.6: Avoid unnamed enumerations • Enum.7: Specify the underlying type of an enumeration only when necessary

Resource management

• R.1: Manage resources automatically using resource handles and RAII (Resource Acquisition Is Initialization) • R.2: In interfaces, use raw pointers to denote individual objects (only) • R.3: A raw pointer (a T*) is non-owning • R.4: A raw reference (a T&) is non-owning • R.5: Prefer scoped objects, don’t heap-allocate unnecessarily • R.10: Avoid malloc() and free() • R.11: Avoid calling new and delete explicitly • R.12: Immediately give the result of an explicit resource allocation to a manager object • R.13: Perform at most one explicit resource allocation in a single expression statement

1.1. Development 29 Inexor Vulkan Renderer, Release v0.1-alpha.3

Classes

• C.30: Define a destructor if a class needs an explicit action at object destruction • C.31: All resources acquired by a class must be released by the class’s destructor • C.35: A base class destructor should be either public and virtual, or protected and non-virtual • C.36: A destructor must not fail • C.40: Define a constructor if a class has an invariant • C.41: A constructor should create a fully initialized object • C.42: If a constructor cannot construct a valid object, throw an exception • C.43: Ensure that a copyable (value type) class has a default constructor • C.44: Prefer default constructors to be simple and non-throwing • C.46: By default, declare single-argument constructors explicit • C.47: Define and initialize member variables in the order of member declaration • C.49: Prefer initialization to assignment in constructors • C.62: Make copy assignment safe for self-assignment • C.64: A move operation should move and leave its source in a valid state • C.65: Make move assignment safe for self-assignment • C.80: Use =default if you have to be explicit about using the default semantics • C.81: Use =delete when you want to disable default behavior (without wanting an alternative) • C.82: Don’t call virtual functions in constructors and destructors • C.90: Rely on constructors and assignment operators, not memset and memcpy • C.129: When designing a class hierarchy, distinguish between implementation inheritance and interface inheri- tance • C.131: Avoid trivial getters and setters • C.132: Don’t make a function virtual without reason • C.133: Avoid protected data

Follow rule of 0 and rule of 5

• C.20 If you can avoid defining default operations, do • C.21: If you define or =delete any copy, move, or destructor function, define or =delete themall

30 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Performance

• Per.1: Don’t optimize without reason • Per.2: Don’t optimize prematurely • Per.3: Don’t optimize something that’s not performance critical • Per.4: Don’t assume that complicated code is necessarily faster than simple code • Per.5: Don’t assume that low-level code is necessarily faster than high-level code • Per.6: Don’t make claims about performance without measurements • Per.11: Move computation from run time to compile time

Design patterns

• Check out Refactoring Guru to learn more about software design patterns. • Don’t use the singleton pattern as it makes thread safety and refactoring difficult. • Use the builder pattern for composition of complicated data structures. • An example of a builder pattern would be the descriptor builder.

Regressions

• If something used to work but it’s broken after a certain commit, it’s not just some random bug. • It’s probably an issue which was introduced by the code change which was submitted. • It’s important for us to keep working features in a stable state. • You can use git bisect for tracing of the commit which introduced the bug.

1.1.6 Continuous integration

• The master branch and the build system must stay stable at all time. • You can see the current status of the master branch in the build batch:

• Currently we are using GitHub Actions for building with gcc, clang and Microsoft Visual Studio on every push or pull request. • This Continuous Integration (CI) allows for automatic building and testing of our software. • We also have a webhook which directly dispatches the build status into our Discord. This allows us to spot and fix broken code easily. • Our CI setup is inspired by a blog entry by Adam Sawicki.

1.1. Development 31 Inexor Vulkan Renderer, Release v0.1-alpha.3

1.1.7 Clang format

• In order to have one unified code formatting style, we use clang-format. • Clang-format automatically formats source code according to a set of rules which a project needs to agree on. • Our current style can be found in the clang-format file file in the root folder ofthe repository. • We recommend to install plugins which auto format the code when the file is being saved. • Instructions for how to enable clang-format in Microsoft Visual Studio can be found here. • Other editors like Visual Studio Code, Atom.io, Notepad++ and Sublime Text support this as well. • Part of our Continuous Integration (CI) are automated clang-format checks using GitHub actions. • Our setup of clang-format with GitHub actions can be here. • A pull request will only be accepted if it follows those code formatting rules. Example of clang-format checking a pull request along with gcc/clang/msvc build:

32 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

1.1.8 Test automation

• Inexor will use Google Test for automated software testing in the future. • Because Google Test is available in conan center, we will be able to add this to our list of dependencies easily. • Running automatic tests using GitHub actions is not possible for Vulkan features since this requires a graphics card to be present. • There are some services which offer test automation for rendering, but they are not free. • The tests would have to run on the developer’s machine locally.

1.1.9 Benchmarking

• Inexor will use Google Benchmark in the future. • Google Benchmark is also available in conan center, just as Google Test. • Benchmarks can also not run in GitHub actions since testing Vulkan features would require a graphics card. • The tests will run locally on the developer’s machine along with the tests.

1.1.10 Static code analysis

We analyze our source code regularly using static code analysis. The following tools are used: • Clang-tidy. • Microsoft Visual Studio code analysis. • Valgrind, Callgrind and Cachegrind.

1.1.11 Reference

GPU selection mechanism

• Every graphics card is a gpu, but not every GPU is a (discrete) graphics card. • For example, some GPUs are integrated into the main processor. • If a certain GPU is not visible for Vulkan (vkEnumeratePhysicalDevices https://www.khronos.org/registry/ vulkan/specs/1.2-extensions/man/html/vkEnumeratePhysicalDevices.html), it does not support Vulkan. • If multiple GPUs are available on the system, the user can either specify which one should be used or let the engine select an appropriate GPU automatically. • The user can specify which GPU to prefer by using --gpu as command line argument. • The is the array index, starting from 0. • The engine will verify that is a valid value. • The engine will check if the GPU is suitable for the engine’s purposes. For example we might require GPUs to support geometry shaders in the future. • If no preferred gpu was specified by the user, the specified gpu index is invalid, or the gpu is unsuitable, automatic gpu selection rules apply.

1.1. Development 33 Inexor Vulkan Renderer, Release v0.1-alpha.3

Automatic GPU selection rules

• Automatic gpu selection is part of the so called settings decision maker. • The method which ultimately selects the gpu is decide_which_graphics_card_to_use in set- tings_decision_maker.cpp. • Note that we are using a C++17 feature which is called std::optional. • This means if no gpu could be found after all, std::nullopt will be returned. • The automated GPU selection mechanism will prefer the discrete GPU over the integrated GPU when exactly 2 GPUs are available.

Binary Format Specification

Comments start with //, everything after for the rest of the line is ignored. Spaces can be used to improve the readability, but are not required. Spaces are preferred over tabs. Variable or data type names are case sensitive.

Endianness

Available values are little and big. When defining the reserved data type name ENDIANNESS, all other data types who do not define an own endianness are interpreted as this. | ENDIANNESS : little // default value for all non defined

Data Types

Every data type name, can also be used as an variable name, they don’t interfere. Data types can be defined the following way | : - // description, whereas - is optional, if a default endianness is given. The size can be set by a variable too. | Bit :1- little // A bit, 0 or 1. | uByte :4- little // An unsigned . | uInt :8- little // unsigned integer

// or

| ENDIANNESS : little | Bit :1 // A bit, 0 or 1. | uInt :8 // unsigned integer

uInt : mySize=0 | myType : mySize // My special type.

34 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Struct Types

If you have compressed data, it can be easily described as a struct struct {. Members can be access with a dot. struct SpecSummary { > uByte(1): size // Size > uByte(1): spec_a // Specification A > uByte(1): spec_b // Specification B }

> SpecSummary(1): spec // specification summary

if (spec.size>0){ read_spec() }

Bit Reading & Variables

Each bit interpretation starts with >, whereas variable name and the reinterpreted type are optional. Variables are only valid in their declared scope. is a value, how often the data type is read, it will create a list with its content. If a reinterpreted type is given, it will be reinterpreted as if the amount of single was read by the reinterpretation type (> Bit (3) : uByte reinterprets 3 bits into one uByte). If the reinterpreted type is bigger, it will be filled with 0 regarding to the endianness, to not change the value (e.g. little endianness will fill from the left side). Same with cutting it off. >(): // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ optional

// examples

> uByte(7) // string identifier: "myimage" > uInt(1): image_size // image size in > Bit(3) uByte : red_color // red color

> Bit(3) uByte // possible but does not make any sense, as the reinterpreted type will␣

˓→not be used.

uInt : other_size= image_size // declare new variable other_size with content of image_

˓→size uInt : id=0 // declare a new variable of type uInt and content 0

1.1. Development 35 Inexor Vulkan Renderer, Release v0.1-alpha.3

Conditions

if, else if, else. Available comparisons are ==, !=, <, >, <=, >=. Which can be combined with && (and) and || (or). Brackets are not required around the condition, but can improve the readability. You cannot compare a list to a number. You have to reinterpret it beforehand or cast it. > Bit(2) uByte : roll_over // roll over simulation type uInt : roll_over_int= roll_over if (roll_over_int==0){ // roll over specification 0 > uInt(1) // roll over specifications } else if (uInt(roll_over)==1){ // roll over specification 1 > uInt(1) // roll over specifications > uInt(1) // more roll over specifications } else { // default roll over specification > uByte(1) // weight in kg > uInt(1) // roll over specifications }

A short version for else if chaining is switch, case. default will be used if no other case matches. There is no default fallthrough, to get this behaviour use fallthrough.A break inside a switch case will break out of it. > Bit(2) uByte : roll_over // roll over simulation type uInt : roll_over_int= roll_over switch (roll_over_int){ case 0: // roll over specification 0 > uInt(1) // roll over specifications case 1: // roll over specification 1 > uInt(1) // roll over specifications > uInt(1) // more roll over specifications default: // default roll over specification > uByte(1) // weight in kg > uInt(1) // roll over specifications }

Loops

There are three types of loops: for, range-based for and a while loop. Brackets are not required around the condition, but can improve the readability. You can break out of a loop with the break keyword. for (id; id<=3; id++){ // 0..2 // ... }

for (0..2: id){ // including both borders 0 and 2 // ... }

uInt : id=0 while (id<=3){ // ... id= id+1 } (continues on next page)

36 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

(continued from previous page)

uInt : id=0 while (true){ if (id==3){ break } // ... id= id+1 }

Functions

Functions can be used to reuse a specific block again. def () {} def get_cube(uInt : param) uInt, uByte{ > uInt(1): first > uByte(1): second return first, second } // get_cube

> uInt(1): rec_first > uByte(1): rec_second rec_first, rec_second= get_cube()

Keyboard and mouse input

Inexor engine uses glfw3 for window management and for keyboard and mouse input. Inexor does not use manual polling of keyboard and mouse input data, but uses callbacks instead. This way, we ensure we are not missing a key event. For more information check out glfw’s input guide. Inexor uses a wrapper class for keyboard and mouse input data, called KeyboardMouseInputData. This class offers an easy-to-use interface for setting and getting keyboard and mouse input. KeyboardMouseInputData is thread safe since pull request 401.

Note: Inexor redirects keyboard and mouse input events to class methods which handle it. Because glfw is a C-style API, it is not possible to use class methods directly as callbacks for keyboard and mouse input data. To fix this, we set the glfw window user pointer to the class instance which contains the input callback methods. Then, we use a lambda to set up the class method as callback. All setups are done in Application::setup_window_and_input_callbacks. For more information about this workaround, check out this Stackoverflow issue.

Note: It’s not possible handle glfw input data in a thread which is separate from the thread which created the corre- sponding window. For more information, check out this glfw forum .

1.1. Development 37 Inexor Vulkan Renderer, Release v0.1-alpha.3

Keyboard input

• We store the pressed keys as a std::array member in KeyboardMouseInputData • The maximum number of keys is defined by GLFW_KEY_LAST • If a key is pressed or released, we notify KeyboardMouseInputData by calling method press_key and release_key, respectively • Check if a key is currently pressed by calling method is_key_pressed • Check if a key was pressed once by calling method was_key_pressed_once

Mouse input

• We store the pressed mouse buttons as a std::array member in KeyboardMouseInputData • The maximum number of mouse buttons is defined by GLFW_MOUSE_BUTTON_LAST. • If a mouse button is pressed or released, we notify KeyboardMouseInputData by calling method press_mouse_button and release_mouse_button, respectively • To update the current cursor position, we call set_cursor_pos • To get the current cursor position, we call get_cursor_pos • The change in cursor position can be queried with calculate_cursor_position_delta • Check if a mouse button is pressed by calling method is_mouse_button_pressed • Check if a mouse button was pressed once by calling method was_mouse_button_pressed_once

Joysticks

Inexor does not support joysticks yet.

Octree File Format

The Inexor octree format describes the structure of the maps (and even models) created in Inexor.

Octree

The orange are coordinates of the corner, the pink of the block. The position of a block is always the (0, 0, 0) corner coordinates. Corner and Block Order If blocks or corners are ordered, they use this order.

38 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Table 3: Corner and Block Order ID Coordinate 0 (0, 0, 0) 1 (0, 0, 1) 2 (0, 1, 0) 3 (0, 1, 1) 4 (1, 0, 0) 5 (1, 0, 1) 6 (1, 1, 0) 7 (1, 1, 1)

Order of Faces The following order of faces is used:

Table 4: Order of Face ID Name Normal vector 0 left (-1, 0, 0) 1 right (1, 0, 0) 2 front (0, 1, 0) 3 back (0, -1, 0) 4 top (0, 0, 1) 5 bottom (0, 0, -1)

Order of Indices on Face The following corner indices are associated to the faces:

Table 5: Order of Indices on Face ID Indices 0 0, 1, 2, 3 1 4, 5, 6, 7 2 0, 1, 4, 5 3 2, 3, 6, 7 4 1, 3, 5, 7 5 0, 2, 4, 6

Edge Order • All edges are going into the positive direction of the axis. • The beginning of the edge is always the smaller corner id. • If you look at a face, the edges are always numbered with an offset of 3. • The edges are ordered counter-clockwise starting from the axis. • A negative ID indicates the reverse direction (-axis).

1.1. Development 39 Inexor Vulkan Renderer, Release v0.1-alpha.3

Table 6: Edge Order ID Corner ID Tuple 0 (0, 4) 1 (0, 2) 2 (0, 1) 3 (2, 6) 4 (1, 3) 5 (4, 5) 6 (3, 7) 7 (5, 7) 8 (6, 7) 9 (1, 5) 10 (4, 6) 11 (2, 3)

Indentation Every cube can be indented at each corner to all axis by 8 steps. In total there are 9 position/level on each axis. The following diagram shows the indentation levels of Corner 1 on the x-axis.

Neighbors

Table 7: Neighbor Order ID Relative Coordinates 0 (-1, -1, -1) 1 (-1, -1, 0) 2 (-1, -1, 1) 3 (-1, 0, -1) 4 (-1, 0, 0) 5 (-1, 0, 1) 6 (-1, 1, -1) 7 (-1, 1, 0) 8 (-1, 1, 1) 9 (0, -1, -1) 10 (0, -1, 0) 11 (0, -1, 1) 12 (0, 0, -1) 13 (0, 0, 1) 14 (0, 1, -1) 15 (0, 1, 0) 16 (0, 1, 1) 17 (1, -1, -1) 18 (1, -1, 0) 19 (1, -1, 1) 20 (1, 0, -1) 21 (1, 0, 0) 22 (1, 0, 1) 23 (1, 1, -1) 24 (1, 1, 0) 25 (1, 1, 1)

40 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Format Specification

Using this binary format syntax. Cube Types 0 - EMPTY The cube does not exist, nothing to render. 1 - SOLID One solid cube. 2 - NORMAL An indented cube, with at least one intended corner. 3 - OCTANT The octree is subdivided into 8 sub cubes.

Note: The Format numbers are just to difference between the formats and not to describe an versioning.

Sauerbraten

This part only shows, how Sauerbraten saves the octrees in general. It does not show the whole format. As Sauerbraten has one cube type more, the formats can only be compared to Inexors partially. | ENDIANNESS : little | bit :1 // A bit, 0 or 1. | uByte :8 // An unsigned byte.

def get_cube(){ > uByte(1): cube_type // cube type, actually only 3 bits are used, but only 4␣

˓→types (the first two bits, can be compared to our cubes) switch (cube_type){ case 0: // octant // nothing case 1: // empty // nothing case 2: // solid // nothing case 3: // normal for (0..11: corner_number){ > uByte(1) // edge indent } } } // get_cube get_cube()

1.1. Development 41 Inexor Vulkan Renderer, Release v0.1-alpha.3

Inexor I

File Extension: .nxoc - Inexor Octree | ENDIANNESS : little | bit :1 // A bit, 0 or 1. | uByte :8 // An unsigned byte. | uInt : 32 // An unsigned integer.

> uByte(13) // string identifier: "Inexor Octree" > uInt(1) // version def get_cube(){ > bit(2) uByte : cube_type // cube type

switch (cube_type){ case 0: // empty // nothing case 1: // fully // nothing case 2: // indented for (0..7: corner_number){ > bit(1): x_axis // is x axis indented if (x_axis==1){ // x axis is indented > bit(3) // indentation level as value + 1 } > bit(1): y_axis // is y axis indented if (y_axis==1){ // y axis is indented > bit(3) // indentation level as value + 1 } > bit(1): z_axis // is z axis indented if (z_axis==1){ // z axis is indented > bit(3) // indentation level as value + 1 } } case 3: // octants for (0..7: sub_cube){ get_cube() // recurse down } } } // get_cube get_cube()

The corner position at one axis is calculated relative from the corner starting as 0 + indentation level.

42 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Inexor II

File Extension: .nxoc - Inexor Octree | ENDIANNESS : little | bit :1 // A bit, 0 or 1. | uByte :8 // An unsigned byte. | uInt : 32 // An unsigned integer.

> uByte(13) // string identifier: "Inexor Octree" > uInt(1) // version

def get_cube(){ > bit(2) uByte : cube_type // cube type

switch (cube_type){ case 0: // empty // nothing case 1: // fully // nothing case 2: // indented for (0..11: edge_id){ > bit(2) uByte : indent // edge indentation switch (indent){ case 0: // not indented break case 1: // end corner is indented case 2: // start corner is indented > bit(3) // indentation offset, starting from the specified␣

˓→corner break case 3: // both sides indented > bit(5) // indentation level and offset, see below for more␣

˓→information } } case 3: // octants for (0..7: sub_cube){ get_cube() // recurse down } } } // get_cube get_cube()

Calculating edge indentation value The indentation along the edge axis between two corners presented by a unique value. The indentation level starts with 0 at the starting corner and goes to 8 at the ending corner. We are assuming that both ends of the edge are indented by at least one. (Start at 0, is actually already indented by one). Using 푖 as the indentation value, 푠 as the indentation start position and 표 as the offset between the start and end position. 푠2+푠 푖 = 8 * 푠 + 표 − 2 ; 푠, 표 ∈ [0, 6]; 푠 <= 표 Resulting into values from 0 to 27.

1.1. Development 43 Inexor Vulkan Renderer, Release v0.1-alpha.3

Inexor III

The third format takes advantage of the second format for the double-sided indentations, but makes sure that it is easy to read and write and not many bitwise operations have to be done. Also the cube type is presented by one byte, even if only the first two bits are used. File Extension: .nxoc - Inexor Octree | ENDIANNESS : little | bit :1 // A bit, 0 or 1. | uByte :8 // An unsigned byte. | uInt : 32 // An unsigned integer.

> uByte(13) // string identifier: "Inexor Octree" > uInt(1) // version

def get_cube(){ > uByte(1): cube_type // cube type, only the first two bits are used.

switch (cube_type){ case 0: // empty // nothing case 1: // fully // nothing case 2: // indented for (0..11: edge_id){ > bit(6) // indentation level and offset, see below for more information } case 3: // octants for (0..7: sub_cube){ get_cube() // recurse down } } } // get_cube get_cube()

Calculating edge indentation value The indentation along the edge axis between two corners presented by a unique value. The indentation level starts with 0 at the starting corner and goes to 8 at the ending corner. Using 푖 as the indentation value, 푠 as the indentation start position and 표 as the offset between the start and end position. 푠2+푠 푖 = 10 * 푠 + 표 − 2 ; 푠, 표 ∈ [0, 8]; 푠 <= 표 Resulting into values from 0 to 44.

44 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Multi octree collision detection

Octree collision detection allows us to find intersections between octree geometry and a ray, for example thecamera view ray. This is an essential part for the octree editor. Inexor engine allows to have multiple octrees with arbitrary position and relative size (no support for rotations yet), making collision detection significantly more complex than single octree traversal:

In the following screenshot, you can see three octrees of different types and different sizes. The octree in the lefthas8 sub-cubes (we call a cube which has 8 children Cube::Type::OCTANT in the engine, even if some of them are empty). The one octree in the midle has no children, it’s just one solid cube (we call it Cube::Type::SOLID). The one in the right has some empty and some solid sub-cubes in it (that’s also an Cube::Type::OCTANT). You can see that these cubes are not indented at all, because indentation is not taken into account yet for octree collision.1

1 The current implementation of octree-ray intersection only checks for intersections with completely filled cubes and does not take into account indentations of cubes, as this is not required for an octree editor. The bounding box of an octree is always unchanged, even if the octree geometry itself has indentations. Taking into account indentations will be required for physics calculations in the future, for example to check collisions between particles and octree.

1.1. Development 45 Inexor Vulkan Renderer, Release v0.1-alpha.3

How to find collisions between octree geometry and a ray in this scene now? For simplicity, we assume that theoctrees are not intersecting each other. Let’s assume we want to write an octree editor. We are obviously only interested in the intersection which is closest to the camera’s position: if there is another octree behind the current selection, we must move the camera to it, in order to be able to edit it:2

2 We could also make the layer which is blocking view invisible for a moment in the future.

46 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

We are also only interested in collisions which are in front of our camera view:

Let’s imagine we now have 푁 octrees, and we want to find all those which collide with the ray and we want toknow the one which is closest to the camera. Furthermore, since we want to write an octree editor, we want not only the

1.1. Development 47 Inexor Vulkan Renderer, Release v0.1-alpha.3

cube which is in selection, but we also want to know which one of the 6 faces of the cube is in selection. In addition, we want to know the coordinates or the intersection between camera ray and the plane of the selected face. We also need the closest corner on the selected face and the closest edge, just so we have all the data we could possibly need for implementing the editor. This leaves us the following questions: • How do we even determine if there are any collisions occuring at all? • How do we now find out which of the 푁 octrees is in selection? • How do we determine the octree which is closest to our camera’s position?

Finding the octree closest to the camera

Assuming we have 푁 octrees, the first thing we do is to iterate through every one ofthe 푁 octrees and to check for collision of the camera ray with the bounding sphere of the octree. This is a quick way to optimize the collision in the beginning and to save a lot of computation time. It is a common trick in computer graphics. If we would check for every possible collision without this step, the algorithm would be way too slow. So we need to iterate through the 푁 octrees we have and calculate the distance 푑 between the ray and the center of the octree’s bounding sphere. In our engine, the center of the octree is also the center of the bounding sphere. We are using glm::intersectRaySphere to check if a collision is happening. If the bounding sphere check was successful, we also check collision of the ray with the axis aligned bounding box (aabb). This check is more expensive but also more precise than the bounding sphere check. However it is only used if the bounding sphere check previously was successful to save performance.

Note: Simply iterating through all 푁 octrees is a naive approach. This only works for small number of octrees. Much better would be to use a hierarchical data structure like a bounding volume hierarchy, which groups objects which are close to each other into a unified bounding sphere. This hierarchical bounding sphere check is much faster than iterating through all 푁 octrees. There are libraries which could help implement this for Inexor in the future.

Note: Currently we use the entire octree as axis axis aligned bounding box (aabb). However, we could optimize this: We could fit the bounding box to only the filled cubes of that octree. For example if one half side of the octreeisempty, we could adjust the bounding box to the other half. If a camera ray now collides with the empty part of the octree, this could give us improved performance, as the bounding box is not hit. Otherwise the subcube iteration would be executed and come to the same conclusion: only empty subcubes are hit and therefore no collision takes place.

After this step, we have 0 to 푁 octrees which collide with the ray. The following screenshot shows the possible situations for 푁 = 2:

48 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

If we have 0 collisions, we can already stop collision detection here because there are no collisions occuring: if a camera ray intersects an octree, it must also intersect the bounding sphere. The reverse statement is not true: if a ray collides with a bounding sphere, that does not mean it collides with the octree. It could be a false positive:

1.1. Development 49 Inexor Vulkan Renderer, Release v0.1-alpha.3

We now need to find the octree which is closest the camera. Even if the camera is inside of an octree, therecould be multiple octrees which have bounding spheres that intersect the camera ray. The first thing which comes to our mind is sorting the octrees by distance to the camera: we could calculate the distance 푑 between camera’s position and bounding sphere’s center (= the octree’s center) for every one octree which intersects with the camera ray and order them by distance: √︀ 2 2 2 푑 = (푥1 − 푥2) + (푦1 − 푦2) + (푧1 − 푧2) The one with the lowest distance will be the one which is closest to the camera. This should be the octree we will perform any further detailed collision checks on. However, there are two things we can already optimize here.

The square of the distance

First, we do not need to sort the octrees by distance. Sorting would mean we need all of the data sorted by distance. We are only interested in the octree with the smallest distance though. Since we iterate through all of them, we check if the calculated distance 푑 between bounding sphere’s center and camera position is smaller than the stored value, and if that is the case, store it as the new closest octree.3 This is significantly faster than sorting all octrees. We also lose information about the distance to all the other octrees in selection, but that’s not important at the moment (at least for the octree editor that is irrelevant for now). As a second optimization, we should not calculate the distance 푑 between the bounding sphere’s center and the camera’s center, as we are not interested in the exact value of the distance. The reason we should avoid this is because distance calculation using glm::distance makes an expensive sqrt call, as it needs to calculate the distance like this: √︀ 2 2 2 푑 = (푥1 − 푥2) + (푦1 − 푦2) + (푧1 − 푧2) If we take this equation and square both sides, we obtain 푑2, the squared distance: 2 2 2 2 푑 = (푥1 − 푥2) + (푦1 − 푦2) + (푧1 − 푧2) This way, we perform no square root calculation. The squared distance 푑2 will serve as our value for determination of the closest octree. Think about it: if the distance 푑 is the value which allows us to find the closest octree, the square of the distance 푑2 will work as well. If you take 푁 octrees, each one having a distance 푑 to the camera’s position, the order will not change if we square the distance.

Note: For simplicity, we assume that the octrees have a variable position and size, but are not intersecting each other. If that is the case, the determination of the octree which is closest to the camera would be more complicated. For example if there would be two octrees, one being closer to the camera than the other, but the one further away has a bigger size, maybe resulting in faces which are closer to the camera than the other cube. We will implement support for this in the future.

Finding the leaf node

Now that we have found the octree which is closest to the camera, we need to find a leaf node in the octree which is being intersected. The most simple case would be if the octree’s root is of type Cube::Type::SOLID, as completely filled octrees are leaf nodes by definition:

3 To do so, we need to set the initial value of the distance to a maximum value. We use std::numeric_limits::max()

50 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

If the octree’s root is of type Cube::Type::OCTANT, we need to iterate through all 8 sub-cubes. This is described in the next section.

1.1. Development 51 Inexor Vulkan Renderer, Release v0.1-alpha.3

Please note that every octant has 8 sub-cubes, even if some (or even all) of them are of type Cube::Type::EMPTY.4

Note: Technically, the octree’s root could also be of type Cube::Type::EMPTY. In this case, there also no collision possible. However, such octrees will be skipped when iterating through all possible sub-cubes which could possibly collide with the ray.

Subcube iteration

So we found the octree which is closest to the camera, but it’s neither completely empty (Cube::Type::EMPTY) nor completely filledCube::Type::OCTANT ( ). We now simply iterate through all 8 sub-cubes and repeat the bounding sphere and axis aligned bounding box collision checks for every subcube. If a subcube is empty, no collision with it is possible and it will be excluded from detailed collision checks. We now need to find the sub-cube which is closest to the camera again. We therefore perform the same search by squared distance as we already did for the octree octrees. We simply calculate the squared distance from the center of the sub-cube to the camera and if the distance is lower than the one which is currently stored, we accept it as new closest sub-cube. Imagine a cube is an octant and it has 8 sub-cubes which are all not empty. If a ray goes through that cube, no more than 4 sub-cubes can be intersected. Therefore we abort the hit collection after 4 hits. Once we determined the sub-cube which is closest to the camera, we recursively perform this algorithm. The iteration depth can be limited in the engine. A common example of this is the grid size of the octree editor. So a leaf node is either found if the current subcube is of type Cube::Type::SOLID or if the iteration depth has been reached. Once a leaf cube was found, we proceed to calculate the selected face, as described in the following section.

Note: Every cube of type Cube::Type::OCTANT has 8 subcubes. Iterating through all subcubes from index 0 to 7 is a naive approach as well. Inexor should use a fast octree traversal algorithm in the future. For more information, check out this paper. Also check out the hero algorithm.

Determination of selected face

Now that we have found the selected cube, we need to determine on which one of the 6 faces (left, right, top, bottom, front, back) the collision takes place. We are only interested in the intersection which is facing the camera. That is also the intersection which is closer to the camera position. There is also a backside intersection from the outgoing ray, but we are not interested in this for now. There are several ways how to determine which face is in collision. We decided to use the following approach: first we filter out all sides of the cube which are not facing the camera. Inordertodo so, let’s take a look at the following equation which describes the angle 훼 of two vectors ⃗푎 and ⃗푎:

⃗푎·⃗푏 푐표푠(훼) = |푎|·|푏| If we define ⃗푎 as the normal vector on the face and ⃗푏 as the camera direction vector, we realize that the normal vector on the cube’s face is no longer facing the camera if the angle 훼 becomes greater than 90 degrees. We now think we should rearrange for the angle:

−1 (︁ ⃗푎·⃗푏 )︁ 훼 = 푐표푠 |푎|·|푏| However, we can simplify this: If the angle is slightly greater than 90 degrees, the value of 푐표푠(훼) becomes smaller than 0. If the angle is a little less than 90 degrees, 푐표푠(훼) becomes greater than 0. If we take a look at the right side of the equation we started with, we can see that the dot product of ⃗푎 and ⃗푏 is in the nominator while the product of the magnitudes is in the denominator. Since the magnitude of a vector is never negative, the product of two magnitudes

4 This has to do with the way the engine lays out memory for the octree data structure. The engine will allocate memory for the empty sub-cube because it’s faster to change the sub-cube’s data if it gets modified. However, empty sub-cubes will not result in additional vertex or index databeing generated.

52 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

will always be positive. We now see that the sign change is entirely dictated by the nominator. Furthermore, we already elaborated that it’s comparably expensive to calculate the square root. We can simplify all this to the following condition: the face on a cube is visible, if the dot product of the two vectors ⃗푎 and ⃗푏 is smaller than zero: 훼 < 0 for ⃗푎 ·⃗푏 < 0 This is quite nice, because the dot product of ⃗푎 and ⃗푏 is a cheap calculation. This is another very popular trick in computer graphics.5 We now simply iterate through all 6 faces of the cube, take the normal vector on that cube face and check if it’s facing the camera. We are only interested in the planes which are facing the camera.6 If you look at a cube, no more than 3 sides can be visible at the same time. This means we can stop after we found 3 cube sides which are facing the camera. It could be less than 3 sides though. Imagine you are right on top of a solid cube and your look down on it, only the top side is visible. If you look from a certain position, only 2 sides are visible.

Note: We could optimize this in the future by doing some coordinate checks of the camera and the octree. For example if the x and y coordinates are inside the square of the cube, we could only see top or bottom of the cube. However, since Inexor wants to account for arbitrary rotations around all 3 axis, this is more complex than for unrotated octrees. We think our current solution is sufficiently performant.

We now have 3 or less sides of the cube facing the camera. We calculate the intersection point between the ray and every plane which represents a cube face. In order to determine the real intersection, we come back to searching the lowest squared distance again. However, it is important to state that we can’t use the squared distance to the camera position in this case. We must calculate the squared distance between the intersection point on every plane and the center of the cube’s face which is associated to this plane. This way, we find the real intersection point and the selected corner: 5 In fact this is used during the rasterization step in rendering to discard all triangles which are not facing the camera. 6 For some reasons we might be interested in those sides of a cube which are not facing the camera in the future?

1.1. Development 53 Inexor Vulkan Renderer, Release v0.1-alpha.3

Calculation of closest corner

We now successfully determined the selected face and the intersection point. We already know the coordinates of every one of the 4 corners on that face. In order to determine the nearest corner, we come back to calculating the squared distance between the intersection point and every corner point. The corner with the lowest squared distance is the nearest.

54 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Calculation of closest edge

The determination of the closest edge works the same way as the determination of the closest corner: searching the lowest squared distance between intersection point and center of the four edges on the selected face. To find the edges which are associated to the selected size, the following array is used. The indices of edges are the same as in the octree documentation: using edge_on_face_index= std::array;

// These indices specify which 4 edges are associated with a given face of the bounding␣

˓→box. static constexpr std::array BBOX_EDGE_ON_FACE_INDICES{ edge_on_face_index{0,1,2,3}, // left edge_on_face_index{4,5,6,7}, // right edge_on_face_index{1,5,8, 11}, // front edge_on_face_index{3,7,9, 11}, // back edge_on_face_index{0,4, 10, 11}, // top edge_on_face_index{2,6,8,9} // bottom };

1.1. Development 55 Inexor Vulkan Renderer, Release v0.1-alpha.3

Closing remarks

With this algorithm, we have a good starting point writing an octree editor. However, we know that this is not the fastest solution possible. Nevertheless, it is a solution which is easy to understand, easy to improve and easy to optimize for sure. Furthermore, it will be easy to parallelize it. All the aspects which could be improved have been listed on this page.

1.1.12 GitHub Issue Labeling

The labels are written in two parts, separated by a colon. The first part is the label category, the second the name.

Table 8: Categories Abbreviation Name Description cat category main category feat feature specific feature prio priority priority org organization organization/ whats the state of this issue diff difficulty which skill is required to work on this plat platform platform specific issue

Some labels are mutual to each other like org:in progress and org:on hold. Also some labels should not be specified on closed issues like org:in progress.

Note: Github will use black as font color if the background is too light.

Preview Category Name Description Color cat benchmark testing code performance with automated benchmarking #C0E169 cat bug bug/error/mistake which limits the program #FF0000 cat dependency dependency management #BFD4F2 cat dev tools building/ compiling the program, cmake configuration and general development tools #78A600 cat documentation documentation #D1D100 cat enhancement enhancement/requested feature/update of existing features #0025FF cat performance performance #FF6868 cat refactor refactor/clean up/simplifications/etc. #FF8C00 cat review review #69D100 cat security security/ privacy issues #B60205 cat testing testing #C0E169 diff first issue good first issue to start contributing #FEF2C0 diff beginner beginner skills required #FEF2C0 diff intermediate intermediate skills required #FEF2C0 diff advanced advanced skills required #FEF2C0 diff expert expert skills required #FEF2C0 org discussion needs further discussion with others #DDDDDD org duplicate duplicate issue #DDDDDD org help wanted help wanted #DDDDDD org idea needs further elaboration before it is possible to continue #DDDDDD org in progress somebody is working on this #DDDDDD org invalid invalid issue #DDDDDD continues on next page

56 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Table 9 – continued from previous page Preview Category Name Description Color org on hold on hold, until ... #DDDDDD org planned planned/ prepared issue #DDDDDD org third party this issue depends on a third party project and is out of our hands #DDDDDD org triage labels have to be specified #D9534F org wontfix wont be fixed, ever #DDDDDD feat ci continuous integration #D4C5F9 feat concurrency multithreading, asynchronous events, concurrency #D4C5F9 feat render graph render graph #D4C5F9 feat gui graphical user interface #D4C5F9 feat input keybord/mouse input #D4C5F9 feat lightning light system #D4C5F9 feat logging logging system #D4C5F9 feat octree octree, cube computations #D4C5F9 feat rendering rendering #D4C5F9 feat settings settings #D4C5F9 feat shader shaders #D4C5F9 feat texture textures #D4C5F9 plat linux Linux specific issue #FFC683 plat MacOS specific issue #FFC683 plat windows Windows specific issue #FFC683 prio blocker this issue cannot be moved to a later milestone, also this label cannot be removed #B60205 prio high high priority #FF0000 prio low low priority #AD8D43

1.2 Source Code

1.2.1 Class Hierarchy

1.2.2 File Hierarchy

1.2.3 Full API

Namespaces

Namespace inexor

Contents

• Namespaces

1.2. Source Code 57 Inexor Vulkan Renderer, Release v0.1-alpha.3

Namespaces

• Namespace inexor::vulkan_renderer

Namespace inexor::vulkan_renderer

Contents

• Namespaces • Classes • Enums • Functions

Namespaces

• Namespace inexor::vulkan_renderer::directions • Namespace inexor::vulkan_renderer::input • Namespace inexor::vulkan_renderer::io • Namespace inexor::vulkan_renderer::tools • Namespace inexor::vulkan_renderer::vk_tools • Namespace inexor::vulkan_renderer::world • Namespace inexor::vulkan_renderer::wrapper

Classes

• Struct BezierInputPoint • Struct BezierOutputPoint • Struct ImGUIOverlay::PushConstBlock • Struct MSAATarget • Struct OctreeGpuVertex • Struct RenderGraphObject • Struct SwapchainSettings • Struct UniformBufferObject • Struct VulkanSettingsDecisionMaker • Class Application • Class BezierCurve • Class BufferResource • Class Camera

58 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

• Class FPSCounter • Class GraphicsStage • Class ImGUIOverlay • Class InexorException • Class PhysicalBackBuffer • Class PhysicalBuffer • Class PhysicalGraphicsStage • Class PhysicalImage • Class PhysicalResource • Class PhysicalStage • Class RenderGraph • Class RenderResource • Class RenderStage • Class TextureResource • Class TimeStep • Class VulkanException • Class VulkanRenderer

Enums

• Enum BufferUsage • Enum CameraMovement • Enum CameraType • Enum TextureUsage

Functions

• Function inexor::vulkan_renderer::operator==

Namespace inexor::vulkan_renderer::directions

Contents

• Variables

1.2. Source Code 59 Inexor Vulkan Renderer, Release v0.1-alpha.3

Variables

• Variable inexor::vulkan_renderer::directions::DEFAULT_FRONT • Variable inexor::vulkan_renderer::directions::DEFAULT_RIGHT • Variable inexor::vulkan_renderer::directions::DEFAULT_UP

Namespace inexor::vulkan_renderer::input

Contents

• Classes

Classes

• Class KeyboardMouseInputData

Namespace inexor::vulkan_renderer::io

Contents

• Classes

Classes

• Class ByteStream • Class ByteStreamReader • Class ByteStreamWriter • Class IoException • Class NXOCParser • Class OctreeParser

Namespace inexor::vulkan_renderer::tools

Contents

• Classes

60 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Classes

• Class CommandLineArgumentParser • Class CommandLineArgumentTemplate • Class CommandLineArgumentValue • Class File

Namespace inexor::vulkan_renderer::vk_tools

Contents

• Functions

Functions

• Template Function inexor::vulkan_renderer::vk_tools::as_string • Function inexor::vulkan_renderer::vk_tools::print_all_physical_devices • Function inexor::vulkan_renderer::vk_tools::print_device_extensions • Function inexor::vulkan_renderer::vk_tools::print_driver_vulkan_version • Function inexor::vulkan_renderer::vk_tools::print_instance_extensions • Function inexor::vulkan_renderer::vk_tools::print_instance_layers • Function inexor::vulkan_renderer::vk_tools::print_physical_device_features • Function inexor::vulkan_renderer::vk_tools::print_physical_device_info • Function inexor::vulkan_renderer::vk_tools::print_physical_device_limits • Function inexor::vulkan_renderer::vk_tools::print_physical_device_memory_properties • Function inexor::vulkan_renderer::vk_tools::print_physical_device_queue_families • Function inexor::vulkan_renderer::vk_tools::print_physical_device_sparse_properties • Function inexor::vulkan_renderer::vk_tools::print_presentation_modes • Function inexor::vulkan_renderer::vk_tools::print_supported_surface_formats • Function inexor::vulkan_renderer::vk_tools::print_surface_capabilities • Function inexor::vulkan_renderer::vk_tools::result_to_description

1.2. Source Code 61 Inexor Vulkan Renderer, Release v0.1-alpha.3

Namespace inexor::vulkan_renderer::world

Contents

• Classes • Functions • Typedefs

Classes

• Struct Cube::RotationAxis • Class Cube • Class Indentation • Template Class RayCubeCollision

Functions

• Function inexor::vulkan_renderer::world::create_random_world • Function inexor::vulkan_renderer::world::ray_box_collision • Function inexor::vulkan_renderer::world::ray_cube_collision_check

Typedefs

• Typedef inexor::vulkan_renderer::world::Polygon • Typedef inexor::vulkan_renderer::world::PolygonCache

Namespace inexor::vulkan_renderer::wrapper

Contents

• Classes • Functions

62 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Classes

• Class CommandBuffer • Class CommandPool • Class CpuTexture • Class DescriptorBuilder • Class Device • Class Fence • Class Framebuffer • Class GPUMemoryBuffer • Class GpuTexture • Class Image • Class Instance • Class OnceCommandBuffer • Class ResourceDescriptor • Class Semaphore • Class Shader • Class StagingBuffer • Class Swapchain • Class UniformBuffer • Class Window • Class WindowSurface

Functions

• Template Function inexor::vulkan_renderer::wrapper::make_info

Namespace std

Contents

• Classes

1.2. Source Code 63 Inexor Vulkan Renderer, Release v0.1-alpha.3

Classes

• Template Struct hash< inexor::vulkan_renderer::OctreeGpuVertex >

Classes and Structs

Struct BezierInputPoint

• Defined in file_inexor_vulkan-renderer_bezier_curve.hpp

Inheritance Relationships

Derived Type

• public inexor::vulkan_renderer::BezierOutputPoint (Struct BezierOutputPoint)

Struct Documentation struct inexor::vulkan_renderer::BezierInputPoint Those are the points that we pass into the bezier curve generator. Every bezier curve will be generated from a list of BezierInputPoint. Every input point can have a custom weight coefficient. Subclassed by inexor::vulkan_renderer::BezierOutputPoint

Public Members

glm::vec3 pos = {0.0f, 0.0f, 0.0f} float weight = {1.0f}

Struct BezierOutputPoint

• Defined in file_inexor_vulkan-renderer_bezier_curve.hpp

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::BezierInputPoint (Struct BezierInputPoint)

64 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Struct Documentation

struct inexor::vulkan_renderer::BezierOutputPoint : public inexor::vulkan_renderer::BezierInputPoint Those are the points which will be generated from the bezier curve generator. How many BezierOutputPoint points will be generated depends on the required precision. The higher the requested precision, the more points will be.

Public Members

glm::vec3 normal = {0.0f, 0.0f, 0.0f} glm::vec3 tangent = {0.0f, 0.0f, 0.0f}

Struct ImGUIOverlay::PushConstBlock

• Defined in file_inexor_vulkan-renderer_imgui.hpp

Nested Relationships

This struct is a nested type of Class ImGUIOverlay.

Struct Documentation

struct inexor::vulkan_renderer::ImGUIOverlay::PushConstBlock

Public Members

glm::vec2 scale glm::vec2 translate

Struct MSAATarget

• Defined in file_inexor_vulkan-renderer_msaa_target.hpp

Struct Documentation struct inexor::vulkan_renderer::MSAATarget

1.2. Source Code 65 Inexor Vulkan Renderer, Release v0.1-alpha.3

Public Members

std::unique_ptr m_color std::unique_ptr m_depth

Struct OctreeGpuVertex

• Defined in file_inexor_vulkan-renderer_octree_gpu_vertex.hpp

Struct Documentation struct inexor::vulkan_renderer::OctreeGpuVertex

Public Functions

inline OctreeGpuVertex(glm::vec3 position, glm::vec3 color)

Public Members

glm::vec3 position glm::vec3 color

Struct RenderGraphObject

• Defined in file_inexor_vulkan-renderer_render_graph.hpp

Inheritance Relationships

Derived Types

• public inexor::vulkan_renderer::PhysicalResource (Class PhysicalResource) • public inexor::vulkan_renderer::PhysicalStage (Class PhysicalStage) • public inexor::vulkan_renderer::RenderResource (Class RenderResource) • public inexor::vulkan_renderer::RenderStage (Class RenderStage)

66 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Struct Documentation

struct inexor::vulkan_renderer::RenderGraphObject Base class of all render graph objects (resources and stages).

Note: This is just for internal use.

Subclassed by inexor::vulkan_renderer::PhysicalResource, inexor::vulkan_renderer::PhysicalStage, in- exor::vulkan_renderer::RenderResource, inexor::vulkan_renderer::RenderStage

Public Functions

RenderGraphObject() = default

RenderGraphObject(const RenderGraphObject&) = delete

RenderGraphObject(RenderGraphObject&&) = delete

virtual ~RenderGraphObject() = default

RenderGraphObject &operator=(const RenderGraphObject&) = delete

RenderGraphObject &operator=(RenderGraphObject&&) = delete

template T *as() Casts this object to type T Returns The object as type T or nullptr if the cast failed template const T *as() const Casts this object to type T Returns The object as type T or nullptr if the cast failed

Struct SwapchainSettings

• Defined in file_inexor_vulkan-renderer_settings_decision_maker.hpp

1.2. Source Code 67 Inexor Vulkan Renderer, Release v0.1-alpha.3

Struct Documentation struct inexor::vulkan_renderer::SwapchainSettings A wrapper class for swapchain settings.

Public Members

VkExtent2D window_size VkExtent2D swapchain_size

Struct UniformBufferObject

• Defined in file_inexor_vulkan-renderer_standard_ubo.hpp

Struct Documentation struct inexor::vulkan_renderer::UniformBufferObject

Note: We can exactly match the definition in the shader using data types in GLM. The data in the matricesis binary compatible with the way the shader expects it, so we can later just memcpy a UniformBufferObject to a VkBuffer.

Public Members

glm::mat4 model glm::mat4 view glm::mat4 proj

Struct VulkanSettingsDecisionMaker

• Defined in file_inexor_vulkan-renderer_settings_decision_maker.hpp

Struct Documentation struct inexor::vulkan_renderer::VulkanSettingsDecisionMaker This class makes automatic decisions about setting up Vulkan. Examples:

• Which graphics card will be used if more than one is available? • Which surface color format should be used? • Which graphics card’s queue families should be used?

68 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

• Which presentation modes should be used?

Public Static Functions

static std::size_t rate_graphics_card(VkPhysicalDevice graphics_card) Rate a graphics card by its features.

Todo: Implement additional graphics card rating criteria if desired.

Note: The current implementation just sums up all available memory as a score.

Parameters graphics_card – The graphics card which will be rated. Returns The graphics card’s score which is greater or equal to 0.

static bool is_graphics_card_suitable(VkPhysicalDevice graphics_card, VkSurfaceKHR surface) Automatically decide if a graphics card is suitable for this application’s purposes. In order to be a suitable graphics card for Inexor’s purposes, it must fulfill the following criteria:

• It must support a swapchain. • It must support presentation. Todo: Add more checks to the validation mechanism if necessary, e.h. check for geometry shader support.

Warning: When implementing additional graphics card suitability criteria, do not return false for graphics cards which are not VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU!

Parameters graphics_card – The graphics card which will be checked for suitability. Returns true if the graphics card is suitable.

static VkPhysicalDeviceType graphics_card_type(VkPhysicalDevice graphics_card) Gets the VkPhysicalDeviceType of a graphics card. Parameters graphics_card – The graphics card. Returns The type of the graphics card. static std::optional graphics_card(VkInstance vulkan_instance, VkSurfaceKHR surface, std::optional preferred_gpu_index = std::nullopt) Automatically select the best graphics card considering all available ones. Please take a look at Inexor’s advanced device selection mechanism which is build into this method. If there is only one graphics card available, we don’t have a choice and must try that one. The user can manually specify which graphics card will be used with command line argument gpu . Please note that the graphics cards index starts with 0. Parameters • vulkan_instance – A pointer to the Vulkan instance handle.

1.2. Source Code 69 Inexor Vulkan Renderer, Release v0.1-alpha.3

• surface – The selected (window) surface. • preferred_graphics_card_index – The preferred graphics card (by array index). Returns A physical device which was chosen if a suitable one could be found, std::nullopt oth- erwise. static std::uint32_t swapchain_image_count(VkPhysicalDevice graphics_card, VkSurfaceKHR surface) Automatically decide how many images will be used in the swap chain. Parameters • graphics_card – The selected graphics card. • surface – The selected (window) surface. Returns The number of images that will be used in swap chain. static std::optional swapchain_surface_color_format(VkPhysicalDevice graphics_card, VkSurfaceKHR surface) Automatically decide which surface color to use in swapchain. Parameters • graphics_card – The selected graphics card. • surface – The selected (window) surface. Returns The surface format for swapchain if any could be determined, std::nullopt otherwise. static SwapchainSettings swapchain_extent(VkPhysicalDevice graphics_card, VkSurfaceKHR surface, std::uint32_t window_width, std::uint32_t window_height) Automatically decide which width and height to use as swapchain extent. Parameters • graphics_card – The selected graphics card. • surface – The selected (window) surface. • window_width – The width of the window. • window_height – The height of the window. static VkSurfaceTransformFlagsKHR image_transform(VkPhysicalDevice graphics_card, VkSurfaceKHR surface) Automatically find the image transform, relative to the presentation engine’s natural orientation, applied to the image content prior to presentation. Parameters • graphics_card – The selected graphics card. • surface – The selected (window) surface. Returns The image transform flags. static std::optional find_composite_alpha_format(VkPhysicalDevice se- lected_graphics_card, VkSurfaceKHR surface) Find a supported composite alpha format. Parameters

70 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

• graphics_card – The selected graphics card. • surface – The selected (window) surface. Returns The composite alpha flag bits. static std::optional decide_present_mode(VkPhysicalDevice graphics_card, VkSurfaceKHR surface, bool vsync = false) Automatically decide which presentation mode the presentation engine will be using.

Note: We can only use presentation modes that are available in the current system. The preferred presen- tation mode is VK_PRESENT_MODE_MAILBOX_KHR.

Warning: Just checking whether swap extension is supported is not enough because presentation support is a queue family property! A physical device may support swap chains, but that doesn’t mean that all its queue families also support it.

Parameters • graphics_card – The selected graphics card. • surface – The selected (window) surface. • vsync – True if vertical synchronization is desired, false otherwise. Returns The presentation mode which will be used by the presentation engine.

static std::optional find_graphics_queue_family(VkPhysicalDevice graphics_card) Decide which graphics queue family index to use in case it is not possible to use one for both graphics and presentation.

Warning: This function should only be used when it is not possible to use one queue family for both graphics and presentation!

Parameters graphics_card – The selected graphics card. Returns The index of the queue family which can be used for graphics.

static std::optional find_presentation_queue_family(VkPhysicalDevice graphics_card, VkSurfaceKHR surface) Decide which presentation queue family index to use in case it is not possible to use one for both graphics and presentation.

Warning: This function should only be used when it is not possible to use one queue family for both graphics and presentation!

Parameters • graphics_card – The selected graphics card. • surface – The selected (window) surface. Returns The index of the queue family which can be used for presentation.

1.2. Source Code 71 Inexor Vulkan Renderer, Release v0.1-alpha.3

static std::optional find_queue_family_for_both_graphics_and_presentation(VkPhysicalDevice graph- ics_card, Vk- Sur- faceKHR sur- face) Check if there is a queue family (index) which can be used for both graphics and presentation. Parameters • graphics_card – The selected graphics card. • surface – The selected (window) surface. Returns The queue family index which can be used for both graphics and presentation (if exis- tent), std::nullopt otherwise. static std::optional find_distinct_data_transfer_queue_family(VkPhysicalDevice graphics_card) Find a queue family which has VK_QUEUE_TRANSFER_BIT, but not VK_QUEUE_GRAPHICS_BIT.

Warning: It might be the case that there is no distinct queue family available on your system! This means that find_distinct_data_transfer_queue_family must be called to find any queue family whichhas VK_QUEUE_TRANSFER_BIT (besides other flags).

Parameters graphics_card – The selected graphics card. Returns The index of the queue family which can be used exclusively for data transfer.

static std::optional find_any_data_transfer_queue_family(VkPhysicalDevice graphics_card) Find a queue family which supports VK_QUEUE_TRANSFER_BIT.

Warning: You should try to find a distinct queue family first us- ing find_distinct_data_transfer_queue_family! Distinct queue families have VK_QUEUE_TRANSFER_BIT, but not VK_QUEUE_GRAPHICS_BIT. It is very likely that the queue family which can be found using this method has VK_QUEUE_GRAPHICS_BIT as well. This could result in suboptimal use of queues which could decrease performance.

Parameters graphics_card – The selected graphics card. Returns The index of the queue family which can be used for data transfer. Returns A queue family index which can be used for data transfer if any could be found, std::nullopt otherwise.

static std::optional find_depth_buffer_format(VkPhysicalDevice graphics_card, const std::vector &formats, VkImageTiling tiling, VkFormatFeatureFlags feature_flags) Find a suitable depth buffer format. Parameters

72 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

• graphics_card – The selected graphics card. • formats – The depth buffer formats to check for. • tiling – The desired depth buffer’s image tiling. • feature_flags – The desired depth buffer’s feature flags. Returns A VkFormat value if a suitable depth buffer format could be found, std::nullopt other- wise.

Struct Cube::RotationAxis

• Defined in file_inexor_vulkan-renderer_world_cube.hpp

Nested Relationships

This struct is a nested type of Class Cube.

Struct Documentation struct inexor::vulkan_renderer::world::Cube::RotationAxis IDs of the children and edges which will be swapped to receive the rotation. To achieve a 90 degree rotation the 0th index have to be swapped with the 1st and the 1st with the 2nd, etc.

Public Types

using ChildType = std::array, 2> using EdgeType = std::array, 3> using Type = std::pair

Public Static Attributes

static constexpr Type X = {{{{0, 1, 3, 2}, {4, 5, 7, 6}}}, {{{2, 4, 11, 1}, {5, 7, 8, 10}, {0, 9, 6, 3}}}} IDs of the children / edges which will be swapped to receive the rotation around X axis.

static constexpr Type Y = {{{{0, 4, 5, 1}, {2, 6, 7, 3}}}, {{{0, 5, 9, 2}, {3, 8, 6, 11}, {1, 10, 7, 4}}}} IDs of the children / edges which will be swapped to receive the rotation around Y axis.

static constexpr Type Z = {{{{0, 2, 6, 4}, {1, 3, 7, 5}}}, {{{1, 3, 10, 0}, {4, 6, 7, 9}, {2, 11, 8, 5}}}} IDs of the children / edges which will be swapped to receive the rotation around Z axis.

1.2. Source Code 73 Inexor Vulkan Renderer, Release v0.1-alpha.3

Template Struct hash< inexor::vulkan_renderer::OctreeGpuVertex >

• Defined in file_inexor_vulkan-renderer_octree_gpu_vertex.hpp

Struct Documentation template<> struct std::hash

Public Functions

inline std::size_t operator()(const inexor::vulkan_renderer::OctreeGpuVertex &vertex) const

Class Application

• Defined in file_inexor_vulkan-renderer_application.hpp

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::VulkanRenderer (Class VulkanRenderer)

Class Documentation class inexor::vulkan_renderer::Application : public inexor::vulkan_renderer::VulkanRenderer

Public Functions

Application(int argc, char **argv)

void key_callback(GLFWwindow *window, int key, int scancode, int action, int mods) Call glfwSetKeyCallback. Parameters • window – The window that received the event. • key – The keyboard key that was pressed or released. • scancode – The system-specific scancode of the key. • action – GLFW_PRESS, GLFW_RELEASE or GLFW_REPEAT. • mods – Bit field describing which modifier keys were held down. void cursor_position_callback(GLFWwindow *window, double x_pos, double y_pos) Call glfwSetCursorPosCallback.

74 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Parameters • window – The window that received the event. • x_pos – The new x-coordinate, in screen coordinates, of the cursor. • y_pos – The new y-coordinate, in screen coordinates, of the cursor. void mouse_button_callback(GLFWwindow *window, int button, int action, int mods) Call glfwSetMouseButtonCallback. Parameters • window – The window that received the event. • button – The mouse button that was pressed or released. • action – One of GLFW_PRESS or GLFW_RELEASE. • mods – Bit field describing which modifier keys were held down. void mouse_scroll_callback(GLFWwindow *window, double x_offset, double y_offset) Call camera’s process_mouse_scroll method. Parameters • window – The window that received the event. • x_offset – The change of x-offset of the mouse wheel. • y_offset – The change of y-offset of the mouse wheel. void run()

Private Functions

void load_toml_configuration_file(const std::string &file_name) Load the configuration of the renderer from a TOML configuration file. file_name The TOML configuration file.

Note: It was collectively decided not to use JSON for configuration files.

void load_textures()

void load_shaders()

void load_octree_geometry(bool initialize)

Parameters initialize – Initialize worlds with a fixed seed, which is useful for benchmarking and testing void setup_vulkan_debug_callback()

void setup_window_and_input_callbacks()

1.2. Source Code 75 Inexor Vulkan Renderer, Release v0.1-alpha.3

void update_imgui_overlay()

void check_application_specific_features()

void update_uniform_buffers()

void check_octree_collisions() Use the camera’s position and view direction vector to check for ray-octree collisions with all octrees. void process_mouse_input()

Private Members

std::vector m_vertex_shader_files std::vector m_fragment_shader_files std::vector m_texture_files std::vector m_gltf_model_files std::unique_ptr m_input_data bool m_enable_validation_layers = {true} std::vector> m_worlds Inexor engine supports a variable number of octrees.

bool m_stop_on_validation_message = {false}

Class BezierCurve

• Defined in file_inexor_vulkan-renderer_bezier_curve.hpp

Class Documentation class inexor::vulkan_renderer::BezierCurve This struct bundles describes everything about the bezier curve. It contains both the input points and the generated output points.

Public Functions

void add_input_point(const BezierInputPoint &input_point)

void add_input_point(const glm::vec3 &position, float weight = 1.0f)

void calculate_bezier_curve(std::uint32_t curve_segments)

76 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

std::vector output_points()

void clear_output()

void clear_input()

void clear()

inline bool is_curve_generated() const

Private Functions

BezierOutputPoint calculate_point_on_curve(float curve_precision)

Private Members

bool m_curve_generated = {false} float m_curve_precision = {0.0f} std::vector m_input_points std::vector m_output_points

Private Static Functions

static uint32_t binomial_coefficient(uint32_t n, uint32_t k)

static float bernstein_polynomial(uint32_t n, uint32_t k, float curve_precision, float coordinate_value)

Class BufferResource

• Defined in file_inexor_vulkan-renderer_render_graph.hpp

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::RenderResource (Class RenderResource)

1.2. Source Code 77 Inexor Vulkan Renderer, Release v0.1-alpha.3

Class Documentation class inexor::vulkan_renderer::BufferResource : public inexor::vulkan_renderer::RenderResource

Public Functions

inline BufferResource(std::string &&name, BufferUsage usage)

void add_vertex_attribute(VkFormat format, std::uint32_t offset) Specifies that element offset of this vertex buffer is of format format.

Note: Calling this function is only valid on buffers of type BufferUsage::VERTEX_BUFFER.

inline void set_element_size(std::size_t element_size) Specifies the element size of the buffer upfront if data is not to be uploaded immediately. Parameters element_size – The element size in bytes template void upload_data(const T *data, std::size_t count) Specifies the data that should be uploaded to this buffer at the start of thenextframe. Parameters • count – The number of elements (not bytes) to upload • data – A pointer to a contiguous block of memory that is at least count * sizeof(T) bytes long template void upload_data(const std::vector &data) Specifies the data that should be uploaded to this buffer at the start of thenextframe.

See upload_data(const T *data, std::size_t count)

Note: This is equivalent to doing upload_data(data.data(), data.size() * sizeof(T))

Private Members

friend RenderGraph const BufferUsage m_usage std::vector m_vertex_attributes const void *m_data = {nullptr} std::size_t m_data_size = {0} bool m_data_upload_needed = {false} std::size_t m_element_size = {0}

78 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Class Camera

• Defined in file_inexor_vulkan-renderer_camera.hpp

Class Documentation class inexor::vulkan_renderer::Camera

Warning: Not thread safe!

Public Functions

Camera(const glm::vec3 &position, float yaw, float pitch, float window_width, float window_height) Default constructor. Parameters • position – The camera’s position. • yaw – The camera’s yaw angle in degrees. • pitch – The camera’s pitch angle in degrees. • window_width – The width of the window. • window_height – The height of the window. void set_type(CameraType type) Set the camera type.

Note: We will implement more camera types in the future.

Parameters type – The camera type.

inline const CameraType &type() const

void set_movement_state(CameraMovement key, bool pressed) Notify the camera if a certain key is pressed or released. Parameters • key – The key which was pressed or released. • pressed – true if the key is pressed. void set_position(glm::vec3 position) Set the position of the camera. Parameters position – The position of the camera. inline const glm::vec3 &position() const

void set_aspect_ratio(float width, float height) Set the aspect ratio (window width divided by window height) of the camera view matrix.

1.2. Source Code 79 Inexor Vulkan Renderer, Release v0.1-alpha.3

Parameters • width – The width of the window. • height – The height of the window. inline float aspect_ratio() const

inline float fov() const

void set_movement_speed(float speed) Set the movement speed of the camera. Parameters speed – The movement speed of the camera. inline float movement_speed() const

void set_rotation_speed(float speed) Set the rotation speed of the camera. Parameters speed – The rotation speed of the camera. inline float rotation_speed() const

void rotate(float delta_yaw, float delta_pitch, float delta_roll =0.0f) Rotates the camera around x, y, and z axis. Parameters • delta_yaw – The yaw angle. • delta_pitch – The pitch angle. • delta_roll – The roll angle. void set_rotation(float yaw, float pitch, float roll) Set the camera’s rotation. Parameters • yaw – The yaw angle. • pitch – The pitch angle. • roll – The roll angle. inline const glm::vec3 &rotation() const

inline float yaw() const

inline float pitch() const

inline float roll() const

inline const glm::vec3 &front() const

inline const glm::vec3 &up() const

80 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

inline const glm::vec3 &right() const

void set_near_plane(float near_plane) Set the near plane distance of the camera. Parameters near_plane – The near plane distance. inline float near_plane() const

void set_far_plane(float far_plane) Set the far plane distance of the camera. Parameters far_plane – The far plane distance. inline float far_plane() const

void change_zoom(float offset) Change the zoom of the camera. Parameters offset – The mouse wheel offset change. void update(float delta_time) Update the camera (recalculate vectors and matrices). Parameters delta_time – The change in time since the last frame. inline const glm::mat4 &view_matrix()

inline const glm::mat4 &perspective_matrix()

Private Functions

void update_vectors()

void update_matrices()

bool is_moving() const

Private Members

CameraType m_type = {CameraType::LOOK_AT} The type of the camera. Currently only one type is implemented.

glm::vec3 m_position = {0.0f, 0.0f, 0.0f} The start position of the camera.

glm::vec3 m_front = {directions::DEFAULT_FRONT} The vector of direction in which the camera is looking.

1.2. Source Code 81 Inexor Vulkan Renderer, Release v0.1-alpha.3

glm::vec3 m_right = {directions::DEFAULT_RIGHT} The vector of direction which points to the right.

glm::vec3 m_up = {directions::DEFAULT_UP} The vector which indicates “upwards”.

glm::vec3 m_world_up = {directions::DEFAULT_UP} The world vector which indicates “upwards”.

glm::mat4 m_view_matrix = {} glm::mat4 m_perspective_matrix = {} float m_yaw = {0.0f} The camera’s yaw angle.

float m_roll = {0.0f} The camera’s roll angle.

float m_pitch = {0.0f} The camera’s pitch angle.

float m_pitch_min = {-89.0f} The camera’s minimum pitch angle. Looking straight downwards is the maximum pitch angle.

float m_pitch_max = {+89.0f} The camera’s maximum pitch angle. Looking straight upwards is the maximum pitch angle.

float m_fov = {90.0f} The camera’s field of view.

float m_fov_max = {90.0f} The camera’s maximum field of view.

float m_fov_min = {20.0f} The camera’s minimum field of view.

float m_zoom_step = {10.0f} The zoom step when zooming in or out.

float m_rotation_speed = {1.0f} The camera’s rotation speed.

float m_movement_speed = {2.0f} The camera’s movement speed.

float m_aspect_ratio = {1920.0f / 1080.0f} The camera’s aspect ratio (width divided by height).

float m_mouse_sensitivity = {0.005f} The sensitivity of the mouse.

82 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

float m_near_plane = {0.001f} The camera’s near plane.

float m_far_plane = {1000.0f} The camera’s far plane.

std::array m_keys = {false, false, false, false} The keys for the movement FORWARD, BACKWARD, LEFT, RIGHT.

bool m_update_needed = {true} Will be set to true if the matrices need to be recalculated.

Class FPSCounter

• Defined in file_inexor_vulkan-renderer_fps_counter.hpp

Class Documentation class inexor::vulkan_renderer::FPSCounter A class for counting frames per seconds.

Public Functions

std::optional update()

Private Members

std::uint32_t m_frames = {0} std::chrono::time_point m_last_time float m_fps_update_interval = {1.0f}

Class GraphicsStage

• Defined in file_inexor_vulkan-renderer_render_graph.hpp

1.2. Source Code 83 Inexor Vulkan Renderer, Release v0.1-alpha.3

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::RenderStage (Class RenderStage)

Class Documentation class inexor::vulkan_renderer::GraphicsStage : public inexor::vulkan_renderer::RenderStage

Public Functions

inline explicit GraphicsStage(std::string &&name)

GraphicsStage(const GraphicsStage&) = delete

GraphicsStage(GraphicsStage&&) = delete

~GraphicsStage() override = default

GraphicsStage &operator=(const GraphicsStage&) = delete

GraphicsStage &operator=(GraphicsStage&&) = delete

inline void set_clears_screen(bool clears_screen) Specifies that this stage should clear the screen before rendering. inline void set_depth_options(bool depth_test, bool depth_write) Specifies the depth options for this stage. Parameters • depth_test – Whether depth testing should be performed • depth_write – Whether depth writing should be performed inline void set_blend_attachment(VkPipelineColorBlendAttachmentState blend_attachment) Set the blend attachment for this stage. Parameters blend_attachment – The blend attachment void bind_buffer(const BufferResource *buffer, std::uint32_t binding) Specifies that buffer should map to binding in the shaders of this stage. void uses_shader(const wrapper::Shader &shader) Specifies that shader should be used during the pipeline of this stage.

Note: Binding two shaders of same type (e.g. two vertex shaders) is undefined behaviour.

84 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Private Members

friend RenderGraph bool m_clears_screen = {false} bool m_depth_test = {false} bool m_depth_write = {false} VkPipelineColorBlendAttachmentState m_blend_attachment = {} std::unordered_map m_buffer_bindings std::vector m_shaders

Class ImGUIOverlay

• Defined in file_inexor_vulkan-renderer_imgui.hpp

Nested Relationships

Nested Types

• Struct ImGUIOverlay::PushConstBlock

Class Documentation class inexor::vulkan_renderer::ImGUIOverlay

Public Functions

ImGUIOverlay(const wrapper::Device &device, const wrapper::Swapchain &swapchain, RenderGraph *render_graph, TextureResource *back_buffer) Construct a new ImGUI overlay. Parameters • device – A reference to the device wrapper • swapchain – A reference to the swapchain • render_graph – A pointer to the render graph • back_buffer – A pointer to the target of the ImGUI rendering ImGUIOverlay(const ImGUIOverlay&) = delete

ImGUIOverlay(ImGUIOverlay&&) = delete

~ImGUIOverlay()

1.2. Source Code 85 Inexor Vulkan Renderer, Release v0.1-alpha.3

ImGUIOverlay &operator=(const ImGUIOverlay&) = delete

ImGUIOverlay &operator=(ImGUIOverlay&&) = delete

void update()

inline float scale() const

Private Members

const wrapper::Device &m_device const wrapper::Swapchain &m_swapchain float m_scale = {1.0f} BufferResource *m_index_buffer = {nullptr} BufferResource *m_vertex_buffer = {nullptr} GraphicsStage *m_stage = {nullptr} std::unique_ptr m_imgui_texture std::unique_ptr m_vertex_shader std::unique_ptr m_fragment_shader std::unique_ptr m_descriptor std::vector m_index_data std::vector m_vertex_data struct inexor::vulkan_renderer::ImGUIOverlay::PushConstBlock m_push_const_block struct PushConstBlock

Public Members

glm::vec2 scale glm::vec2 translate

Class InexorException

• Defined in file_inexor_vulkan-renderer_exception.hpp

86 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Inheritance Relationships

Base Type

• public runtime_error

Derived Types

• public inexor::vulkan_renderer::io::IoException (Class IoException) • public inexor::vulkan_renderer::VulkanException (Class VulkanException)

Class Documentation class InexorException : public runtime_error A custom base class for exceptions. Subclassed by inexor::vulkan_renderer::io::IoException, inexor::vulkan_renderer::VulkanException

Class KeyboardMouseInputData

• Defined in file_inexor_vulkan-renderer_input_keyboard_mouse_data.hpp

Class Documentation class inexor::vulkan_renderer::input::KeyboardMouseInputData A wrapper for keyboard and mouse input data.

Public Functions

KeyboardMouseInputData() = default

KeyboardMouseInputData(const KeyboardMouseInputData&) = delete

KeyboardMouseInputData(KeyboardMouseInputData&&) = delete

~KeyboardMouseInputData() = default

KeyboardMouseInputData &operator=(const KeyboardMouseInputData&) = delete

KeyboardMouseInputData &operator=(KeyboardMouseInputData&&) = delete

void press_key(std::int32_t key) Change the key’s state to pressed. Parameters key – the key which was pressed and greater or equal to 0

1.2. Source Code 87 Inexor Vulkan Renderer, Release v0.1-alpha.3

void release_key(std::int32_t key) Change the key’s state to unpressed.

Note: key must be smaller than GLFW_KEY_LAST and greater or equal to 0

Parameters key – the key which was released

bool is_key_pressed(std::int32_t key) const Check if the given key is currently pressed.

Note: key must be smaller than GLFW_KEY_LAST and greater or equal to 0

Parameters key – the key index Returns true if the key is pressed

bool was_key_pressed_once(std::int32_t key) Checks if a key was pressed once.

Note: key must be smaller than GLFW_KEY_LAST and greater or equal to 0

Parameters key – The key index Returns true if the key was pressed

void press_mouse_button(std::int32_t button) Change the mouse button’s state to pressed.

Note: button must be smaller than GLFW_MOUSE_BUTTON_LAST and greater or equal to 0

Parameters button – the mouse button which was pressed

void release_mouse_button(std::int32_t button) Change the mouse button’s state to unpressed.

Note: button must be smaller than GLFW_MOUSE_BUTTON_LAST and greater or equal to 0

Parameters button – the mouse button which was released

bool is_mouse_button_pressed(std::int32_t button) const Check if the given mouse button is currently pressed.

Note: button must be smaller than GLFW_MOUSE_BUTTON_LAST and greater or equal to 0

Parameters button – the mouse button index

88 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Returns true if the mouse button is pressed

bool was_mouse_button_pressed_once(std::int32_t button) Checks if a mouse button was pressed once.

Note: button must be smaller than GLFW_MOUSE_BUTTON_LAST and greater or equal to 0

Parameters button – the mouse button index Returns true if the mouse button was pressed

void set_cursor_pos(double pos_x, double pos_y) Set the current cursor position. Parameters • pos_x – the current x-coordinate of the cursor • pos_y – the current y-coordinate of the cursor std::array get_cursor_pos() const

std::array calculate_cursor_position_delta() Calculate the change in x- and y-position of the cursor. Returns a std::array of size 2 which contains the change in x-position in index 0 and the change in y-position in index 1

Private Members

std::array m_previous_cursor_pos = {0, 0} std::array m_current_cursor_pos = {0, 0} std::array m_pressed_keys = {false} std::array m_pressed_mouse_buttons = {false} bool m_keyboard_updated = {false} bool m_mouse_buttons_updated = {false} mutable std::shared_mutex m_input_mutex

Class ByteStream

• Defined in file_inexor_vulkan-renderer_io_byte_stream.hpp

1.2. Source Code 89 Inexor Vulkan Renderer, Release v0.1-alpha.3

Inheritance Relationships

Derived Type

• public inexor::vulkan_renderer::io::ByteStreamWriter (Class ByteStreamWriter)

Class Documentation class inexor::vulkan_renderer::io::ByteStream Subclassed by inexor::vulkan_renderer::io::ByteStreamWriter

Public Functions

ByteStream() = default

explicit ByteStream(std::vector buffer)

explicit ByteStream(const std::filesystem::path &path) Read from file. std::size_t size() const

const std::vector &buffer() const

Protected Attributes

std::vector m_buffer

Protected Static Functions

static std::vector read_file(const std::filesystem::path &path) Read from file.

Class ByteStreamReader

• Defined in file_inexor_vulkan-renderer_io_byte_stream.hpp

90 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Class Documentation class inexor::vulkan_renderer::io::ByteStreamReader

Public Functions

explicit ByteStreamReader(const ByteStream &stream)

std::size_t remaining() const

void skip(std::size_t size) Skip ‘size’ bytes (std::uint8_t). template T read(const Args&...) Generic read method.

Private Functions

void check_end(std::size_t size) const

Private Members

const ByteStream &m_stream std::vector::const_iterator m_iter Stream iterator.

Class ByteStreamWriter

• Defined in file_inexor_vulkan-renderer_io_byte_stream.hpp

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::io::ByteStream (Class ByteStream)

1.2. Source Code 91 Inexor Vulkan Renderer, Release v0.1-alpha.3

Class Documentation

class inexor::vulkan_renderer::io::ByteStreamWriter : public inexor::vulkan_renderer::io::ByteStream

Public Functions

template void write(const T &value) Generic write method.

Class IoException

• Defined in file_inexor_vulkan-renderer_io_exception.hpp

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::InexorException (Class InexorException)

Class Documentation

class IoException : public inexor::vulkan_renderer::InexorException

Class NXOCParser

• Defined in file_inexor_vulkan-renderer_io_nxoc_parser.hpp

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::io::OctreeParser (Class OctreeParser)

Class Documentation class inexor::vulkan_renderer::io::NXOCParser : public inexor::vulkan_renderer::io::OctreeParser

92 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Public Functions

virtual ByteStream serialize(std::shared_ptr cube, std::uint32_t version) final Serialization of an octree. virtual std::shared_ptr deserialize(const ByteStream &stream) final Deserialization of an octree.

Private Functions

template ByteStream serialize_impl(std::shared_ptr cube) Specific version serialization. template std::shared_ptr deserialize_impl(const ByteStream &stream) Specific version deserialization.

Private Static Attributes

static constexpr std::uint32_t LATEST_VERSION = {0}

Class OctreeParser

• Defined in file_inexor_vulkan-renderer_io_octree_parser.hpp

Inheritance Relationships

Derived Type

• public inexor::vulkan_renderer::io::NXOCParser (Class NXOCParser)

Class Documentation class inexor::vulkan_renderer::io::OctreeParser Subclassed by inexor::vulkan_renderer::io::NXOCParser

Public Functions

virtual ByteStream serialize(std::shared_ptr cube, std::uint32_t version) = 0 Serialization of an octree. virtual std::shared_ptr deserialize(const ByteStream &stream) = 0 Deserialization of an octree.

1.2. Source Code 93 Inexor Vulkan Renderer, Release v0.1-alpha.3

Class PhysicalBackBuffer

• Defined in file_inexor_vulkan-renderer_render_graph.hpp

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::PhysicalResource (Class PhysicalResource)

Class Documentation class inexor::vulkan_renderer::PhysicalBackBuffer : public inexor::vulkan_renderer::PhysicalResource

Public Functions

inline PhysicalBackBuffer(VmaAllocator allocator, VkDevice device, const wrapper::Swapchain &swapchain)

PhysicalBackBuffer(const PhysicalBackBuffer&) = delete

PhysicalBackBuffer(PhysicalBackBuffer&&) = delete

~PhysicalBackBuffer() override = default

PhysicalBackBuffer &operator=(const PhysicalBackBuffer&) = delete

PhysicalBackBuffer &operator=(PhysicalBackBuffer&&) = delete

Private Members

friend RenderGraph const wrapper::Swapchain &m_swapchain

94 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Class PhysicalBuffer

• Defined in file_inexor_vulkan-renderer_render_graph.hpp

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::PhysicalResource (Class PhysicalResource)

Class Documentation class inexor::vulkan_renderer::PhysicalBuffer : public inexor::vulkan_renderer::PhysicalResource

Public Functions

inline PhysicalBuffer(VmaAllocator allocator, VkDevice device)

PhysicalBuffer(const PhysicalBuffer&) = delete

PhysicalBuffer(PhysicalBuffer&&) = delete

~PhysicalBuffer() override

PhysicalBuffer &operator=(const PhysicalBuffer&) = delete

PhysicalBuffer &operator=(PhysicalBuffer&&) = delete

Private Members

friend RenderGraph VmaAllocationInfo m_alloc_info = {} VkBuffer m_buffer = {VK_NULL_HANDLE}

1.2. Source Code 95 Inexor Vulkan Renderer, Release v0.1-alpha.3

Class PhysicalGraphicsStage

• Defined in file_inexor_vulkan-renderer_render_graph.hpp

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::PhysicalStage (Class PhysicalStage)

Class Documentation class inexor::vulkan_renderer::PhysicalGraphicsStage : public inexor::vulkan_renderer::PhysicalStage

Public Functions

inline explicit PhysicalGraphicsStage(const wrapper::Device &device)

PhysicalGraphicsStage(const PhysicalGraphicsStage&) = delete

PhysicalGraphicsStage(PhysicalGraphicsStage&&) = delete

~PhysicalGraphicsStage() override

PhysicalGraphicsStage &operator=(const PhysicalGraphicsStage&) = delete

PhysicalGraphicsStage &operator=(PhysicalGraphicsStage&&) = delete

Private Members

friend RenderGraph VkRenderPass m_render_pass = {VK_NULL_HANDLE} std::vector m_framebuffers

96 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Class PhysicalImage

• Defined in file_inexor_vulkan-renderer_render_graph.hpp

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::PhysicalResource (Class PhysicalResource)

Class Documentation class inexor::vulkan_renderer::PhysicalImage : public inexor::vulkan_renderer::PhysicalResource

Public Functions

inline PhysicalImage(VmaAllocator allocator, VkDevice device)

PhysicalImage(const PhysicalImage&) = delete

PhysicalImage(PhysicalImage&&) = delete

~PhysicalImage() override

PhysicalImage &operator=(const PhysicalImage&) = delete

PhysicalImage &operator=(PhysicalImage&&) = delete

Private Members

friend RenderGraph VkImage m_image = {VK_NULL_HANDLE} VkImageView m_image_view = {VK_NULL_HANDLE}

1.2. Source Code 97 Inexor Vulkan Renderer, Release v0.1-alpha.3

Class PhysicalResource

• Defined in file_inexor_vulkan-renderer_render_graph.hpp

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::RenderGraphObject (Struct RenderGraphObject)

Derived Types

• public inexor::vulkan_renderer::PhysicalBackBuffer (Class PhysicalBackBuffer) • public inexor::vulkan_renderer::PhysicalBuffer (Class PhysicalBuffer) • public inexor::vulkan_renderer::PhysicalImage (Class PhysicalImage)

Class Documentation class inexor::vulkan_renderer::PhysicalResource : public inexor::vulkan_renderer::RenderGraphObject Subclassed by inexor::vulkan_renderer::PhysicalBackBuffer, inexor::vulkan_renderer::PhysicalBuffer, in- exor::vulkan_renderer::PhysicalImage

Public Functions

PhysicalResource(const PhysicalResource&) = delete

PhysicalResource(PhysicalResource&&) = delete

~PhysicalResource() override = default

PhysicalResource &operator=(const PhysicalResource&) = delete

PhysicalResource &operator=(PhysicalResource&&) = delete

Protected Functions

inline PhysicalResource(VmaAllocator allocator, VkDevice device)

98 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Protected Attributes

const VmaAllocator m_allocator const VkDevice m_device VmaAllocation m_allocation = {VK_NULL_HANDLE}

Private Members

friend RenderGraph

Class PhysicalStage

• Defined in file_inexor_vulkan-renderer_render_graph.hpp

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::RenderGraphObject (Struct RenderGraphObject)

Derived Type

• public inexor::vulkan_renderer::PhysicalGraphicsStage (Class PhysicalGraphicsStage)

Class Documentation class inexor::vulkan_renderer::PhysicalStage : public inexor::vulkan_renderer::RenderGraphObject Subclassed by inexor::vulkan_renderer::PhysicalGraphicsStage

Public Functions

inline explicit PhysicalStage(const wrapper::Device &device)

PhysicalStage(const PhysicalStage&) = delete

PhysicalStage(PhysicalStage&&) = delete

~PhysicalStage() override

PhysicalStage &operator=(const PhysicalStage&) = delete

PhysicalStage &operator=(PhysicalStage&&) = delete

1.2. Source Code 99 Inexor Vulkan Renderer, Release v0.1-alpha.3

inline VkPipelineLayout pipeline_layout() const Retrieve the pipeline layout of this physical stage.

Protected Functions

inline VkDevice device() const

Private Members

friend RenderGraph std::vector m_command_buffers const wrapper::Device &m_device std::unique_ptr m_finished_semaphore VkPipeline m_pipeline = {VK_NULL_HANDLE} VkPipelineLayout m_pipeline_layout = {VK_NULL_HANDLE}

Class RenderGraph

• Defined in file_inexor_vulkan-renderer_render_graph.hpp

Class Documentation class inexor::vulkan_renderer::RenderGraph

Public Functions

inline RenderGraph(const wrapper::Device &device, VkCommandPool command_pool, const wrapper::Swapchain &swapchain)

template inline T *add(Args&&... args) Adds either a render resource or render stage to the render graph. Returns A mutable reference to the just-added resource or stage void compile(const RenderResource *target) Compiles the render graph resources/stages into physical vulkan objects. Parameters target – The target resource of the render graph (usually the back buffer) VkSemaphore render(std::uint32_t image_index, VkSemaphore wait_semaphore, VkQueue graphics_queue, VkFence signal_fence) Submits the command frame’s command buffers for drawing. Parameters • image_index – The current image index, retrieved from Swapchain::acquire_next_image

100 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

• wait_semaphore – The semaphore to wait on before rendering, typically some kind of “swapchain image available” semaphore • graphics_queue – The graphics queue to push rendering commands to • signal_fence – The fence to signal on completion of the whole frame

Private Functions

void build_buffer(const BufferResource&, PhysicalBuffer&) const

void build_image(const TextureResource&, PhysicalImage&, VmaAllocationCreateInfo*) const

void build_image_view(const TextureResource&, PhysicalImage&) const

void build_pipeline_layout(const RenderStage*, PhysicalStage&) const

void record_command_buffer(const RenderStage*, PhysicalStage&, std::uint32_t image_index) const

void build_render_pass(const GraphicsStage*, PhysicalGraphicsStage&) const

void build_graphics_pipeline(const GraphicsStage*, PhysicalGraphicsStage&) const

Private Members

const wrapper::Device &m_device VkCommandPool m_command_pool = {VK_NULL_HANDLE} const wrapper::Swapchain &m_swapchain std::shared_ptr m_log = {spdlog::default_logger()->clone("render-graph")} std::vector> m_buffer_resources std::vector> m_texture_resources std::vector> m_stages std::vector m_stage_stack

1.2. Source Code 101 Inexor Vulkan Renderer, Release v0.1-alpha.3

Class RenderResource

• Defined in file_inexor_vulkan-renderer_render_graph.hpp

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::RenderGraphObject (Struct RenderGraphObject)

Derived Types

• public inexor::vulkan_renderer::BufferResource (Class BufferResource) • public inexor::vulkan_renderer::TextureResource (Class TextureResource)

Class Documentation class inexor::vulkan_renderer::RenderResource : public inexor::vulkan_renderer::RenderGraphObject A single resource in the render graph.

Note: May become multiple physical (vulkan) resources during render graph compilation.

Subclassed by inexor::vulkan_renderer::BufferResource, inexor::vulkan_renderer::TextureResource

Public Functions

RenderResource(const RenderResource&) = delete

RenderResource(RenderResource&&) = delete

~RenderResource() override = default

RenderResource &operator=(const RenderResource&) = delete

RenderResource &operator=(RenderResource&&) = delete

102 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Protected Functions

inline explicit RenderResource(std::string name)

Private Members

friend RenderGraph const std::string m_name std::shared_ptr m_physical

Class RenderStage

• Defined in file_inexor_vulkan-renderer_render_graph.hpp

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::RenderGraphObject (Struct RenderGraphObject)

Derived Type

• public inexor::vulkan_renderer::GraphicsStage (Class GraphicsStage)

Class Documentation class inexor::vulkan_renderer::RenderStage : public inexor::vulkan_renderer::RenderGraphObject A single render stage in the render graph.

Note: Not to be confused with a vulkan render pass.

Subclassed by inexor::vulkan_renderer::GraphicsStage

1.2. Source Code 103 Inexor Vulkan Renderer, Release v0.1-alpha.3

Public Functions

RenderStage(const RenderStage&) = delete

RenderStage(RenderStage&&) = delete

~RenderStage() override = default

RenderStage &operator=(const RenderStage&) = delete

RenderStage &operator=(RenderStage&&) = delete

void writes_to(const RenderResource *resource) Specifies that this stage writes to resource. void reads_from(const RenderResource *resource) Specifies that this stage reads from resource. inline void add_descriptor_layout(VkDescriptorSetLayout layout) Binds a descriptor set layout to this render stage.

Note: This function will be removed in the near future, as we are aiming for users of the API to not have to deal with descriptors at all.

inline void add_push_constant_range(VkPushConstantRange range) Add a push constant range to this render stage. Parameters range – The push constant range inline void set_on_record(std::function on_record) Specifies a function that will be called during command buffer recording for thisstage. This function can be used to specify other vulkan commands during command buffer recording. The most common use for this is for draw commands.

Protected Functions

inline explicit RenderStage(std::string name)

Private Members

friend RenderGraph const std::string m_name std::unique_ptr m_physical std::vector m_writes std::vector m_reads

104 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

std::vector m_descriptor_layouts std::vector m_push_constant_ranges std::function< void(const PhysicalStage &, const wrapper::CommandBuffer &)> m_on_record = {[](auto &, auto &) {}}

Class TextureResource

• Defined in file_inexor_vulkan-renderer_render_graph.hpp

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::RenderResource (Class RenderResource)

Class Documentation class inexor::vulkan_renderer::TextureResource : public inexor::vulkan_renderer::RenderResource

Public Functions

inline TextureResource(std::string &&name, TextureUsage usage)

inline void set_format(VkFormat format) Specifies the format of this texture that is required when the physical texture ismade. For TextureUsage::BACK_BUFFER textures, using the swapchain image format is preferable in most cases. For TextureUsage::DEPTH_STENCIL_BUFFER textures, a VK_FORMAT_D* must be used.

Private Members

friend RenderGraph const TextureUsage m_usage VkFormat m_format = {VK_FORMAT_UNDEFINED}

1.2. Source Code 105 Inexor Vulkan Renderer, Release v0.1-alpha.3

Class TimeStep

• Defined in file_inexor_vulkan-renderer_time_step.hpp

Class Documentation class inexor::vulkan_renderer::TimeStep Responsible for calculating the amount of time which has passed between rendering two frames. Since every machine has slightly different speed, it is necessary to the timestep when animating something.

Todo: Implement time step for every thread?

Public Functions

TimeStep()

float time_step() Return a scaling factor which corresponds to the time which has passed since last render call and now. float time_step_since_initialisation() Return a scaling factor which corresponds to the time which has passed since initialisation and now.

Private Members

std::chrono::time_point m_last_time std::chrono::time_point m_initialisation_time

Class CommandLineArgumentParser

• Defined in file_inexor_vulkan-renderer_tools_cla_parser.hpp

Class Documentation class inexor::vulkan_renderer::tools::CommandLineArgumentParser A simple command line argument parser.

Todo: Support equals arguments and arguments with multiple values (e.g. gpus=1,2,3). Support short arguments, including stacking (e.g. -abc).

Note: Only supports arguments with zero or one values (e.g. vsync or gpu 1)

106 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Note: Only supports long arguments (e.g. )

Public Functions

void parse_args(int argc, char **argv) Parses the command line arguments. Parameters • argc – The number of arguments passed in the command line. • argv – An array of strings containing argc elements. template inline std::optional arg(const std::string &name) const Attempts to retrieve the argument name as type T. Parameters name – The whole name of the argument (e.g. renderdoc) Returns std::nullopt if argument name wasn’t specified by the user at all, true if the argu- ment was specified but doesn’t take any values and the first value of the argument lexically casted to type T. inline std::size_t parsed_arg_count() const Returns the number of parsed command line arguments.

Private Functions

std::optional make_arg_template(const std::string &argument_name) const

Private Members

const std::vector m_accepted_args{{"--gpu", true}, {"--no-separate-data-queue", false}, {"--no-stats", false}, {"--no-validation", false}, {"--no-vk-debug-markers", false}, {"--renderdoc", false}, {"--vsync", false}, {"--stop-on-validation-message", false}} std::unordered_map m_parsed_arguments

Class CommandLineArgumentTemplate

• Defined in file_inexor_vulkan-renderer_tools_cla_parser.hpp

1.2. Source Code 107 Inexor Vulkan Renderer, Release v0.1-alpha.3

Class Documentation class inexor::vulkan_renderer::tools::CommandLineArgumentTemplate Template class for creating arguments.

Public Functions

inline CommandLineArgumentTemplate(std::string argument, bool takes_args)

Note: Only arguments that take zero or one values are supported.

Parameters • argument – The argument to be passed on the command line (e.g. vsync). • takes_args – True if this argument can take values (e.g. gpu 1), false otherwise.

inline const std::string &argument() const

inline bool takes_values() const

Private Members

const std::string m_argument const bool m_takes_values = {false}

Class CommandLineArgumentValue

• Defined in file_inexor_vulkan-renderer_tools_cla_parser.hpp

Class Documentation class inexor::vulkan_renderer::tools::CommandLineArgumentValue

Public Functions

inline explicit CommandLineArgumentValue(std::string value)

template T as() const

108 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Private Members

const std::string m_value

Class File

• Defined in file_inexor_vulkan-renderer_tools_file.hpp

Class Documentation class inexor::vulkan_renderer::tools::File A class for loading files into memory.

Todo: Refactor into an RAII wrapper.

Public Functions

File() = default

inline std::size_t file_size() const

inline const std::vector &file_data() const

bool load_file(const std::string &file_name) Load the entire file into memory. Parameters file_name – The name of the file. Returns true if file was loaded successfully.

Private Members

std::vector m_file_data The file data.

std::size_t m_file_size = {0} The size of the file.

1.2. Source Code 109 Inexor Vulkan Renderer, Release v0.1-alpha.3

Class VulkanException

• Defined in file_inexor_vulkan-renderer_exception.hpp

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::InexorException (Class InexorException)

Class Documentation

class inexor::vulkan_renderer::VulkanException : public inexor::vulkan_renderer::InexorException InexorException for Vulkan specific things.

Public Functions

VulkanException(std::string message, VkResult result)

Parameters • message – The exception message. • result – The VkResult value of the Vulkan API call which failed.

Class VulkanRenderer

• Defined in file_inexor_vulkan-renderer_renderer.hpp

Inheritance Relationships

Derived Type

• public inexor::vulkan_renderer::Application (Class Application)

Class Documentation class inexor::vulkan_renderer::VulkanRenderer Subclassed by inexor::vulkan_renderer::Application

110 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Public Functions

VulkanRenderer() = default

VulkanRenderer(const VulkanRenderer&) = delete

VulkanRenderer(VulkanRenderer&&) = delete

~VulkanRenderer()

VulkanRenderer &operator=(const VulkanRenderer&) = delete

VulkanRenderer &operator=(VulkanRenderer&&) = delete

void calculate_memory_budget() Run Vulkan memory allocator’s memory statistics.

Public Members

bool m_window_resized = {false} float m_time_passed = {0.0f} Necessary for taking into account the relative speed of the system’s CPU.

TimeStep m_stopwatch

Protected Functions

void setup_render_graph()

void generate_octree_indices()

void recreate_swapchain()

void render_frame()

Protected Attributes

std::shared_ptr m_settings_decision_maker{std::make_shared()} std::vector m_shader_stages VkDebugReportCallbackEXT m_debug_report_callback = {VK_NULL_HANDLE} bool m_debug_report_callback_initialised = {false}

1.2. Source Code 111 Inexor Vulkan Renderer, Release v0.1-alpha.3

TimeStep m_time_step std::uint32_t m_window_width = {0} std::uint32_t m_window_height = {0} wrapper::Window::Mode m_window_mode = {wrapper::Window::Mode::WINDOWED} std::string m_window_title FPSCounter m_fps_counter bool m_vsync_enabled = {false} std::unique_ptr m_camera std::unique_ptr m_window std::unique_ptr m_instance std::unique_ptr m_device std::unique_ptr m_surface std::unique_ptr m_swapchain std::unique_ptr m_command_pool std::unique_ptr m_imgui_overlay std::unique_ptr m_frame_finished_fence std::unique_ptr m_image_available_semaphore std::unique_ptr m_render_graph std::vector m_shaders std::vector m_textures std::vector m_uniform_buffers std::vector m_descriptors std::vector m_octree_vertices std::vector m_octree_indices TextureResource *m_back_buffer = {nullptr} BufferResource *m_index_buffer = {nullptr} BufferResource *m_vertex_buffer = {nullptr}

Class Cube

• Defined in file_inexor_vulkan-renderer_world_cube.hpp

112 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Nested Relationships

Nested Types

• Struct Cube::RotationAxis

Inheritance Relationships

Base Type

• public std::enable_shared_from_this< Cube >

Class Documentation class inexor::vulkan_renderer::world::Cube : public std::enable_shared_from_this

Public Types

enum Type Cube Type. Values:

enumerator EMPTY enumerator SOLID enumerator NORMAL enumerator OCTANT enum NeighborAxis Values:

enumerator X enumerator Y enumerator Z enum NeighborDirection Values:

enumerator POSITIVE enumerator NEGATIVE

1.2. Source Code 113 Inexor Vulkan Renderer, Release v0.1-alpha.3

Public Functions

Cube() = default Create an empty cube. Cube(float size, const glm::vec3 &position) Create an empty cube. Cube(std::weak_ptr parent, std::uint8_t index, float size, const glm::vec3 &position) Create an empty cube. Cube(const Cube &rhs) = delete Use clone() to create an independent copy of a cube. Cube(Cube &&rhs) noexcept

~Cube() = default

Cube &operator=(Cube rhs)

Cube &operator=(Cube&&) = delete

std::shared_ptr operator[](std::size_t idx) Get child. std::shared_ptr operator[](std::size_t idx) const Get child. std::shared_ptr clone() const Clone a cube, which has no relations to the current one or its children. It will be a root cube. bool is_root() const noexcept Is the current cube root. std::size_t grid_level() const noexcept At which child level this cube is. root cube = 0 std::size_t count_geometry_cubes() const noexcept Count the number of Type::SOLID and Type::NORMAL cubes. inline glm::vec3 center() const noexcept

inline glm::vec3 position() const noexcept

inline std::array bounding_box() const

inline float size() const noexcept

void set_type(Type new_type) Set a new type. Type type() const noexcept Get type. const std::array, Cube::SUB_CUBES> &children() const Get children.

114 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

std::array indentations() const noexcept Get indentations. void set_indent(std::uint8_t edge_id, Indentation indentation) Set an indent by the edge id. void indent(std::uint8_t edge_id, bool positive_direction, std::uint8_t steps) Indent a specific edge by steps. Parameters positive_direction – Indent in positive axis direction. void rotate(const RotationAxis::Type &axis, int rotations) Rotate the cube 90° clockwise around the given axis. Repeats with the given rotations. Parameters • axis – Only one index should be one. • rotations – Value does not need to be adjusted beforehand. (e.g. mod 4) void update_polygon_cache() const TODO: in special cases some polygons have no surface, if completely surrounded by others

Warning: Will update the cache even if it is considered as valid.

void invalidate_polygon_cache() const Invalidate polygon cache. std::vector polygons(bool update_invalid = false) const Recursive way to collect all the caches. Parameters update_invalid – If true it will update invalid polygon caches. std::shared_ptr neighbor(NeighborAxis axis, NeighborDirection direction) Get the (face) neighbor of this cube. Get the (face) neighbor of this cube by using a similar implementation to Samets “OT_GTEQ_FACE_NEIGHBOR(P,I)”. See Samet, H. (1989) Neighbor finding in Images Represented by Octrees. Computer Vision, Graphics, and Image Processing. 46 (3), 367-386.

Parameters • axis – The axis on which to get the neighboring cube • direction – Whether to get the cube which is above or below this cube on the selected axis Returns Same-sized neighbor if existent, else larger neighbor if exists, otherwise (i.e. when no neighbor exists) nullptr.

1.2. Source Code 115 Inexor Vulkan Renderer, Release v0.1-alpha.3

Public Static Attributes

static constexpr std::size_t SUB_CUBES = {8} Maximum of sub cubes (children)

static constexpr std::size_t EDGES = {12} Cube edges.

Private Functions

friend void ::swap(Cube &lhs, Cube &rhs) noexcept

void remove_children() Removes all children recursive. std::shared_ptr root() noexcept Get the root to this cube. std::array vertices() const noexcept Get the vertices of this cube. Use only on geometry cubes. template void rotate(const RotationAxis::Type &axis) Optimized implementations of 90°, 180° and 270° rotations.

Private Members

Type m_type = {Type::EMPTY} float m_size = {32} glm::vec3 m_position = {0.0f, 0.0f, 0.0f} std::weak_ptr m_parent = {} Root cube is empty.

std::uint8_t m_index_in_parent = {} Index of this in m_parent.m_children; undefined behavior if root.

std::array m_indentations Indentations, should only be used if it is a geometry cube.

std::array, Cube::SUB_CUBES> m_children mutable PolygonCache m_polygon_cache Only geometry cube (Type::SOLID and Type::Normal) have a polygon cache.

mutable bool m_polygon_cache_valid = {false}

116 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Friends

friend class io::NXOCParser

struct RotationAxis IDs of the children and edges which will be swapped to receive the rotation. To achieve a 90 degree rotation the 0th index have to be swapped with the 1st and the 1st with the 2nd, etc.

Public Types

using ChildType = std::array, 2> using EdgeType = std::array, 3> using Type = std::pair

Public Static Attributes

static constexpr Type X = {{{{0, 1, 3, 2}, {4, 5, 7, 6}}}, {{{2, 4, 11, 1}, {5, 7, 8, 10}, {0, 9, 6, 3}}}} IDs of the children / edges which will be swapped to receive the rotation around X axis.

static constexpr Type Y = {{{{0, 4, 5, 1}, {2, 6, 7, 3}}}, {{{0, 5, 9, 2}, {3, 8, 6, 11}, {1, 10, 7, 4}}}} IDs of the children / edges which will be swapped to receive the rotation around Y axis.

static constexpr Type Z = {{{{0, 2, 6, 4}, {1, 3, 7, 5}}}, {{{1, 3, 10, 0}, {4, 6, 7, 9}, {2, 11, 8, 5}}}} IDs of the children / edges which will be swapped to receive the rotation around Z axis.

Class Indentation

• Defined in file_inexor_vulkan-renderer_world_indentation.hpp

Class Documentation class inexor::vulkan_renderer::world::Indentation

Public Functions

Indentation() = default

Indentation(std::uint8_t start, std::uint8_t end) noexcept

explicit Indentation(std::uint8_t uid) noexcept

bool operator==(const Indentation &rhs) const

1.2. Source Code 117 Inexor Vulkan Renderer, Release v0.1-alpha.3

bool operator!=(const Indentation &rhs) const

void set_start(std::uint8_t position) noexcept Set absolute value of start. void set_end(std::uint8_t position) noexcept Set absolute value of end. std::uint8_t start_abs() const noexcept Absolute value of start. std::uint8_t end_abs() const noexcept Absolute value of end. std::uint8_t start() const noexcept Positive indent, relative from start’s point. std::uint8_t end() const noexcept Positive indent, relative from end’s point. std::uint8_t offset() const noexcept Difference between start and end. void indent_start(std::uint8_t steps) noexcept Positive steps into the direction of end. void indent_end(std::uint8_t steps) noexcept Positive steps into the direction of start. void mirror() noexcept Mirror the indentation, such that the distance from 0 to start and distance from end to max switches. std::uint8_t uid() const

Public Static Attributes

static constexpr std::uint8_t MAX = {8}

Private Members

std::uint8_t m_start = {0} std::uint8_t m_end = {Indentation::MAX}

Template Class RayCubeCollision

• Defined in file_inexor_vulkan-renderer_world_collision.hpp

118 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Class Documentation template class inexor::vulkan_renderer::world::RayCubeCollision A wrapper for collisions between a ray and octree geometry. This class is used for octree collision, but it can be used for every cube-like data structure.

tparam T A template type which offers a size() and center() method.

Public Functions

RayCubeCollision(const T &cube, glm::vec3 ray_pos, glm::vec3 ray_dir) Calculate point of intersection, selected face, nearest corner on that face, and nearest edge on that face. Parameters • cube – The cube to check for collision. • ray_pos – The start point of the ray. • ray_dir – The direction of the ray. RayCubeCollision(const RayCubeCollision&) = delete

RayCubeCollision(RayCubeCollision &&other) noexcept

~RayCubeCollision() = default

RayCubeCollision &operator=(const RayCubeCollision&) = delete

RayCubeCollision &operator=(RayCubeCollision&&) = delete

inline const T &cube() const noexcept

inline const glm::vec3 &intersection() const noexcept

inline const glm::vec3 &face() const noexcept

inline const glm::vec3 &corner() const noexcept

inline const glm::vec3 &edge() const noexcept

1.2. Source Code 119 Inexor Vulkan Renderer, Release v0.1-alpha.3

Private Members

const T &m_cube glm::vec3 m_intersection glm::vec3 m_selected_face glm::vec3 m_nearest_corner glm::vec3 m_nearest_edge

Class CommandBuffer

• Defined in file_inexor_vulkan-renderer_wrapper_command_buffer.hpp

Class Documentation class inexor::vulkan_renderer::wrapper::CommandBuffer RAII wrapper class for VkCommandBuffer.

Todo: Make trivially copyable (this class doesn’t really “own” the command buffer, more just an OOP wrapper).

Public Functions

CommandBuffer(const wrapper::Device &device, VkCommandPool command_pool, std::string name) Default constructor. Parameters • device – The const reference to the device RAII wrapper class. • command_pool – The command pool from which the command buffer will be allocated. • name – The internal debug marker name of the command buffer. This must not be an empty string. CommandBuffer(const CommandBuffer&) = delete

CommandBuffer(CommandBuffer&&) noexcept

~CommandBuffer() = default

CommandBuffer &operator=(const CommandBuffer&) = delete

CommandBuffer &operator=(CommandBuffer&&) = delete

120 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

void begin(VkCommandBufferUsageFlags flags =0) const Call vkBeginCommandBuffer.

Note: Sometimes it’s useful to pass VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT to specify that a command buffer can be resubmitted to a queue while it is in the pending state, andrecorded into multiple primary command buffers. Otherwise, synchronization must be done using a VkFence.

Parameters flags – The command buffer usage flags, 0 by default.

void bind_descriptor(const ResourceDescriptor &descriptor, VkPipelineLayout layout) const Call vkCmdBindDescriptorSets. Parameters • descriptor – The const reference to the resource descriptor RAII wrapper instance. • layout – The pipeline layout which will be used to bind the resource descriptor. void push_constants(VkPipelineLayout layout, VkShaderStageFlags stage, std::uint32_t size, void *data) const Update push constant data. Parameters • layout – The pipeline layout • stage – The shader stage that will be accepting the push constants • size – The size of the push constant data in bytes • data – A pointer to the push constant data void end() const Call vkEndCommandBuffer. void begin_render_pass(const VkRenderPassBeginInfo &render_pass_bi) const Call vkCmdBeginRenderPass. Parameters render_pass_bi – The const reference to the VkRenderPassBeginInfo which is used. void bind_graphics_pipeline(VkPipeline pipeline) const Call vkCmdBindPipeline. Parameters pipeline – The graphics pipeline to bind. void bind_index_buffer(VkBuffer buffer) const Call vkCmdBindIndexBuffer.

Todo: Don’t hardcode 16 for index bit width here.

Parameters buffer – The index buffer to bind.

void bind_vertex_buffers(const std::vector &buffers) const Call vkCmdBindVertexBuffers.

1.2. Source Code 121 Inexor Vulkan Renderer, Release v0.1-alpha.3

Todo: Expose more parameters from vkCmdBindVertexBuffers as method arguments.

Parameters buffers – A std::vector of vertex buffers to bind.

void draw(std::size_t vertex_count) const Call vkCmdDraw. Parameters vertex_count – The number of vertices to draw. void draw_indexed(std::size_t index_count) const Call vkCmdDrawIndexed. Parameters index_count – The number of indices to draw. void end_render_pass() const Call vkCmdEndRenderPass. inline VkCommandBuffer get() const

inline const VkCommandBuffer *ptr() const

Private Members

VkCommandBuffer m_command_buffer = {VK_NULL_HANDLE} const wrapper::Device &m_device std::string m_name

Class CommandPool

• Defined in file_inexor_vulkan-renderer_wrapper_command_pool.hpp

Class Documentation class inexor::vulkan_renderer::wrapper::CommandPool RAII wrapper class for VkCommandPool.

Public Functions

CommandPool(const Device &device, std::uint32_t queue_family_index) Default constructor.

Note: It is important that the queue family index is specified in the abstraction above this command pool wrapper. We can’t choose one queue family index automatically inside of this wrapper which fits every purpose, because some wrappers require a queue family index which supports graphics bit, other require transfer bit.

Parameters

122 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

• device – The const reference to the device RAII wrapper class. • queue_family_index – The queue family index which is used by this command pool.

CommandPool(const CommandPool&) = delete

CommandPool(CommandPool&&) noexcept

~CommandPool()

CommandPool &operator=(const CommandPool&) = delete

CommandPool &operator=(CommandPool&&) = delete

inline VkCommandPool get() const

inline const VkCommandPool *ptr() const

Private Members

const Device &m_device VkCommandPool m_command_pool = {VK_NULL_HANDLE}

Class CpuTexture

• Defined in file_inexor_vulkan-renderer_wrapper_cpu_texture.hpp

Class Documentation class inexor::vulkan_renderer::wrapper::CpuTexture RAII wrapper class for texture data.

Todo: Scan asset directory automatically.

1.2. Source Code 123 Inexor Vulkan Renderer, Release v0.1-alpha.3

Public Functions

CpuTexture() Create a CpuTexture instance with a default texture. CpuTexture(const std::string &file_name, std::string name) Read a texture from a file. Parameters • file_name – The file name of the texture. • name – The internal debug marker name of the command buffer. This must not be an empty string. CpuTexture(const CpuTexture&) = delete

CpuTexture(CpuTexture&&) noexcept

~CpuTexture()

CpuTexture &operator=(const CpuTexture&) = delete

CpuTexture &operator=(CpuTexture&&) = default

inline std::string name() const

inline int width() const

inline int height() const

inline int channels() const

inline int mip_levels() const

inline stbi_uc *data() const

inline std::size_t data_size() const

Private Functions

void generate_error_texture_data() Generate a chessboard color pattern which will be used as error texture.

124 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Private Members

std::string m_name int m_texture_width = {0} int m_texture_height = {0} int m_texture_channels = {0} int m_mip_levels = {0} stbi_uc *m_texture_data = {nullptr}

Class DescriptorBuilder

• Defined in file_inexor_vulkan-renderer_wrapper_descriptor_builder.hpp

Class Documentation class inexor::vulkan_renderer::wrapper::DescriptorBuilder

Public Functions

DescriptorBuilder(const Device &device, std::uint32_t swapchain_image_count) Constructs the descriptor builder. Parameters • device – The const reference to a device RAII wrapper instance. • swapchain_image_count – The number of images in swapchain. DescriptorBuilder(const DescriptorBuilder&) = delete

DescriptorBuilder(DescriptorBuilder&&) = delete

~DescriptorBuilder() = default

DescriptorBuilder &operator=(const DescriptorBuilder&) = delete

DescriptorBuilder &operator=(DescriptorBuilder&&) = delete

template DescriptorBuilder &add_uniform_buffer(VkBuffer uniform_buffer, std::uint32_t binding, VkShaderStageFlagBits shader_stage = VK_SHADER_STAGE_VERTEX_BIT) Adds a uniform buffer to the descriptor container. Template Parameters T – The type of the uniform buffer. Parameters

1.2. Source Code 125 Inexor Vulkan Renderer, Release v0.1-alpha.3

• uniform_buffer – The uniform buffer which contains the data which will be accessed by the shader. • binding – The binding index which will be used in the SPIR-V shader. • shader_stage – The shader stage the uniform buffer will be used in, most likely the vertex shader. Returns A const reference to this DescriptorBuilder instance. DescriptorBuilder &add_combined_image_sampler(VkSampler image_sampler, VkImageView image_view, std::uint32_t binding, VkShaderStageFlagBits shader_stage = VK_SHADER_STAGE_FRAGMENT_BIT) Adds a combined image sampler to the descriptor container. Parameters • image_sampler – The pointer to the combined image sampler. • image_view – The pointer to the image view. • binding – The binding index which will be used in the SPIR-V shader. • shader_stage – The shader stage the uniform buffer will be used in, most likely the frag- ment shader. Returns A const reference to this DescriptorBuilder instance. ResourceDescriptor build(std::string name) Builds the resource descriptor. Parameters name – The internal name of the resource descriptor. Returns The resource descriptor which was created by the builder.

Private Members

const Device &m_device const std::uint32_t m_swapchain_image_count = {0} std::vector m_layout_bindings std::vector m_write_sets std::vector m_descriptor_buffer_infos std::vector m_descriptor_image_infos

Class Device

• Defined in file_inexor_vulkan-renderer_wrapper_device.hpp

126 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Class Documentation class inexor::vulkan_renderer::wrapper::Device A RAII wrapper class for VkDevice, VkPhysicalDevice and VkQueues.

Note: There is no method is_layer_supported in this wrapper class because device layers are deprecated.

Public Functions

Device(const wrapper::Instance &instance, VkSurfaceKHR surface, bool enable_vulkan_debug_markers, bool prefer_distinct_transfer_queue, std::optional preferred_physical_device_index = std::nullopt) Default constructor.

Todo: Add overloaded constructors for VkPhysicalDeviceFeatures and requested device extensions in the future!

Parameters • instance – The instance wrapper from which the device will be created. • surface – The surface which will be associated with the device. • enable_vulkan_debug_markers – True if Vulkan debug markers should be enabled, false otherwise. • prefer_distinct_transfer_queue – True if a distinct data transfer queue (if available) should be enabled, false otherwise. • preferred_physical_device_index – The index of the preferred graphics card which should be used, starting from 0. If the graphics card index is invalid or if the graphics card is unsuitable for the application’s purpose, another graphics card will be selected automat- ically. See the details of the device selection mechanism!

Device(const Device&) = delete

Device(Device&&) noexcept

~Device()

Device &operator=(const Device&) = delete

Device &operator=(Device&&) = delete

inline VkDevice device() const

1.2. Source Code 127 Inexor Vulkan Renderer, Release v0.1-alpha.3

inline VkPhysicalDevice physical_device() const

inline VmaAllocator allocator() const

inline const std::string &gpu_name() const

inline VkQueue graphics_queue() const

inline VkQueue present_queue() const

inline VkQueue transfer_queue() const

Note: Transfer queues are the fastest way to copy data across the PCIe bus. They are heavily underutilized even in modern games. Transfer queues can be used asynchronously to graphics queue.

inline std::uint32_t graphics_queue_family_index() const

inline std::uint32_t present_queue_family_index() const

inline std::uint32_t transfer_queue_family_index() const

void set_debug_marker_name(void *object, VkDebugReportObjectTypeEXT object_type, const std::string &name) const Assign an internal Vulkan debug marker name to a Vulkan object. This internal name can be seen in external debuggers like RenderDoc.

Note: This method is only available in debug mode with VK_EXT_debug_marker device extension en- abled.

Parameters • object – The Vulkan object. • object_type – The Vulkan debug report object type. • name – The internal name of the Vulkan object.

void set_memory_block_attachment(void *object, VkDebugReportObjectTypeEXT object_type, std::uint64_t name, std::size_t memory_size, const void *memory_block) const Assigns a block of memory to a Vulkan resource. This memory block can be seen in external debuggers like RenderDoc.

Note: This method is only available in debug mode with VK_EXT_debug_marker device extension en- abled.

128 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Parameters • object – The Vulkan object. • object_type – The Vulkan debug report object type. • name – The name of the memory block which will be connected to this object. • memory_size – The size of the memory block in bytes. • memory_address – The memory address to read from.

void bind_debug_region(VkCommandBuffer command_buffer, const std::string &name, std::array color) const Vulkan debug markers: Annotation of a rendering region. Parameters • color – [in] The rgba color of the rendering region. • name – [in] The name of the rendering region. • command_buffer – [in] The associated command buffer. The rendering region will be visible in external debuggers like RenderDoc. void insert_debug_marker(VkCommandBuffer command_buffer, const std::string &name, std::array color) const Insert a debug markers into the current renderpass using vkCmdDebugMarkerInsertEXT. This debug mark- ers can be seen in external debuggers like RenderDoc. Parameters • command_buffer – The command buffer which is associated to the debug marker. • name – The name of the debug marker. • color – An array of red, green, blue and alpha values for the debug region’s color. void end_debug_region(VkCommandBuffer command_buffer) const End the debug region of the current renderpass using vkCmdDebugMarkerEndEXT. Parameters command_buffer – The command buffer which is associated to the debug marker.

Public Static Functions

static bool is_extension_supported(VkPhysicalDevice graphics_card, const std::string &extension) Check if a certain device extension is available for a specific graphics card. Parameters • graphics_card – The graphics card. • extension – The name of the device extension. Returns true if the requested device extension is available. static bool is_swapchain_supported(VkPhysicalDevice graphics_card) Check if a swapchain is available for a specific graphics card. Parameters graphics_card – The graphics card. Returns true if swapchain is supported. static bool is_presentation_supported(VkPhysicalDevice graphics_card, VkSurfaceKHR surface) Check if presentation is available for a specific combination of graphics card and surface.

1.2. Source Code 129 Inexor Vulkan Renderer, Release v0.1-alpha.3

Parameters • graphics_card – The graphics card. • surface – The (window) surface. Returns true if presentation is supported.

Private Members

VkDevice m_device = {VK_NULL_HANDLE} VkPhysicalDevice m_graphics_card = {VK_NULL_HANDLE} VmaAllocator m_allocator = {VK_NULL_HANDLE} std::string m_gpu_name VkQueue m_graphics_queue = {VK_NULL_HANDLE} VkQueue m_present_queue = {VK_NULL_HANDLE} VkQueue m_transfer_queue = {VK_NULL_HANDLE} VkSurfaceKHR m_surface = {VK_NULL_HANDLE} std::uint32_t m_present_queue_family_index = {0} std::uint32_t m_graphics_queue_family_index = {0} std::uint32_t m_transfer_queue_family_index = {0} PFN_vkDebugMarkerSetObjectTagEXT m_vk_debug_marker_set_object_tag = {nullptr} PFN_vkDebugMarkerSetObjectNameEXT m_vk_debug_marker_set_object_name = {nullptr} PFN_vkCmdDebugMarkerBeginEXT m_vk_cmd_debug_marker_begin = {nullptr} PFN_vkCmdDebugMarkerEndEXT m_vk_cmd_debug_marker_end = {nullptr} PFN_vkCmdDebugMarkerInsertEXT m_vk_cmd_debug_marker_insert = {nullptr} PFN_vkSetDebugUtilsObjectNameEXT m_vk_set_debug_utils_object_name = {nullptr} const bool m_enable_vulkan_debug_markers = {false}

Class Fence

• Defined in file_inexor_vulkan-renderer_wrapper_fence.hpp

Class Documentation class inexor::vulkan_renderer::wrapper::Fence A RAII wrapper for VkFences.

130 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Public Functions

Fence(const wrapper::Device &device, const std::string &name, bool in_signaled_state) Default constructor.

Warning: Make sure to specify in_signaled_state correctly as needed, otherwise synchronization problems occur.

Parameters • device – The const reference to a device RAII wrapper instance. • name – The internal debug marker name of the VkFence. • in_signaled_state – True if the VkFence will be constructed in signaled state, false otherwise.

Fence(const Fence&) = delete

Fence(Fence&&) noexcept

~Fence()

Fence &operator=(const Fence&) = delete

Fence &operator=(Fence&&) = delete

inline VkFence get() const

void block(std::uint64_t timeout_limit = std::numeric_limits::max()) const Block fence by calling vkWaitForFences and wait until fence condition is fulfilled. Parameters timeout_limit – The time to wait in milliseconds. If no time is specified, the numeric maximum value is used. void reset() const Call vkResetFences.

Private Members

const wrapper::Device &m_device std::string m_name VkFence m_fence = {VK_NULL_HANDLE}

1.2. Source Code 131 Inexor Vulkan Renderer, Release v0.1-alpha.3

Class Framebuffer

• Defined in file_inexor_vulkan-renderer_wrapper_framebuffer.hpp

Class Documentation class inexor::vulkan_renderer::wrapper::Framebuffer RAII wrapper class for VkFramebuffer.

Public Functions

Framebuffer(const Device &device, VkRenderPass render_pass, const std::vector &attachments, const Swapchain &swapchain, std::string name) Default constructor. Parameters • device – The const reference to a device RAII wrapper instance. • render_pass – The renderpass which is associated with the framebuffer. • attachments – The attachments to use. • swapchain – The associated swapchain. • name – The internal debug marker name of the VkFramebuffer. Framebuffer(const Framebuffer&) = delete

Framebuffer(Framebuffer&&) noexcept

~Framebuffer()

Framebuffer &operator=(const Framebuffer&) = delete

Framebuffer &operator=(Framebuffer&&) = delete

inline VkFramebuffer get() const

Private Members

const wrapper::Device &m_device VkFramebuffer m_framebuffer = {VK_NULL_HANDLE} std::string m_name

132 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Class GPUMemoryBuffer

• Defined in file_inexor_vulkan-renderer_wrapper_gpu_memory_buffer.hpp

Inheritance Relationships

Derived Types

• public inexor::vulkan_renderer::wrapper::StagingBuffer (Class StagingBuffer) • public inexor::vulkan_renderer::wrapper::UniformBuffer (Class UniformBuffer)

Class Documentation class inexor::vulkan_renderer::wrapper::GPUMemoryBuffer RAII wrapper class for GPU Memory buffers. Uniform buffers or vertex/index buffers use this as a base class.

Note: The core of Inexor’s memory management is Vulkan Memory Allocator library (VMA).

Subclassed by inexor::vulkan_renderer::wrapper::StagingBuffer, inexor::vulkan_renderer::wrapper::UniformBuffer

Public Functions

GPUMemoryBuffer(const Device &device, const std::string &name, const VkDeviceSize &size, const VkBufferUsageFlags &buffer_usage, const VmaMemoryUsage &memory_usage) Construct the GPU memory buffer without specifying the actual data to fill in, only the memory size. Parameters • device – The const reference to a device RAII wrapper instance. • name – The internal debug marker name of the GPU memory buffer. • buffer_size – The size of the memory buffer in bytes. • buffer_usage – The buffer usage flags. • memory_usage – The VMA memory usage flags which specify the required memory al- location. GPUMemoryBuffer(const Device &device, const std::string &name, const VkDeviceSize &buffer_size, void *data, std::size_t data_size, const VkBufferUsageFlags &buffer_usage, const VmaMemoryUsage &memory_usage) Construct the GPU memory buffer and specifies the actual data to fill itin. Parameters • device – The const reference to a device RAII wrapper instance. • name – The internal debug marker name of the GPU memory buffer. • buffer_size – The size of the memory buffer in bytes. • data – A pointer to the data to fill the GPU memory buffer with.

1.2. Source Code 133 Inexor Vulkan Renderer, Release v0.1-alpha.3

• data_size – The size of the memory to copy from data pointer. • buffer_usage – The buffer usage flags. • memory_usage – The VMA memory usage flags which specify the required memory al- location. GPUMemoryBuffer(const GPUMemoryBuffer&) = delete

GPUMemoryBuffer(GPUMemoryBuffer&&) noexcept

virtual ~GPUMemoryBuffer()

GPUMemoryBuffer &operator=(const GPUMemoryBuffer&) = delete

GPUMemoryBuffer &operator=(GPUMemoryBuffer&&) = delete

inline const std::string &name() const

inline VkBuffer buffer() const

inline VmaAllocation allocation() const

inline VmaAllocationInfo allocation_info() const

inline VmaAllocationCreateInfo allocation_create_info() const

Protected Attributes

std::string m_name const Device &m_device VkBuffer m_buffer = {VK_NULL_HANDLE} VkDeviceSize m_buffer_size = {0} VmaAllocation m_allocation = {VK_NULL_HANDLE} VmaAllocationInfo m_allocation_info = {} VmaAllocationCreateInfo m_allocation_ci = {}

134 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Class GpuTexture

• Defined in file_inexor_vulkan-renderer_wrapper_gpu_texture.hpp

Class Documentation class inexor::vulkan_renderer::wrapper::GpuTexture RAII wrapper class for textures which are stored in GPU memory.

Todo: Support 3D textures and cube maps (implement new and separate wrappers though).

Note: The code which loads textures from files is wrapped in CpuTexture.

Public Functions

GpuTexture(const wrapper::Device &device, const CpuTexture &cpu_texture) Construct a texture from a file. Parameters • device – The const reference to a device RAII wrapper instance. • file_name – The name of the texture file. • name – The internal debug marker name of the texture. GpuTexture(const wrapper::Device &device, void *data, std::size_t data_size, int texture_width, int texture_height, int texture_channels, int mip_levels, std::string name) Construct a texture from a block of memory. Parameters • device – The const reference to a device RAII wrapper instance. • device – The const reference to a device RAII wrapper instance. • texture_data – A pointer to the texture data. • texture_width – The width of the texture. • texture_height – The height of the texture. • texture_size – The size of the texture. • name – The internal debug marker name of the texture. GpuTexture(const GpuTexture&) = delete

GpuTexture(GpuTexture&&) noexcept

~GpuTexture()

1.2. Source Code 135 Inexor Vulkan Renderer, Release v0.1-alpha.3

GpuTexture &operator=(const GpuTexture&) = delete

GpuTexture &operator=(GpuTexture&&) = delete

inline std::string name() const

inline VkImage image() const

inline VkImageView image_view() const

inline VkSampler sampler() const

Private Functions

void create_texture(void *texture_data, std::size_t texture_size) Create the texture. Parameters • texture_data – A pointer to the texture data. • texture_size – The size of the texture. void transition_image_layout(VkImage image, VkImageLayout old_layout, VkImageLayout new_layout) Transform the image layout. Parameters • image – The image. • old_layout – The old image layout. • new_layout – The new image layout. void create_texture_sampler() Create the texture sampler.

Private Members

std::unique_ptr m_texture_image OnceCommandBuffer m_copy_command_buffer VkSampler m_sampler = {VK_NULL_HANDLE} int m_texture_width = {0} int m_texture_height = {0} int m_texture_channels = {0} int m_mip_levels = {0} std::string m_name const wrapper::Device &m_device

136 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

const VkFormat m_texture_image_format = {VK_FORMAT_R8G8B8A8_UNORM}

Class Image

• Defined in file_inexor_vulkan-renderer_wrapper_image.hpp

Class Documentation class inexor::vulkan_renderer::wrapper::Image RAII wrapper class for VkImage.

Public Functions

Image(const Device &device, VkFormat format, VkImageUsageFlags image_usage, VkImageAspectFlags aspect_flags, VkSampleCountFlagBits sample_count, const std::string &name, VkExtent2D image_extent) Default constructor. Parameters • device – The const reference to a device RAII wrapper instance. • format – The color format. • image_usage – The image usage flags. • aspect_flags – The aspect flags. • sample_count – The sample count. • name – The internal debug marker name of the VkImage. • image_extent – The width and height of the image. Image(const Image&) = delete

Image(Image&&) noexcept

~Image()

Image &operator=(const Image&) = delete

Image &operator=(Image&&) = delete

inline VkFormat image_format() const

inline VkImageView image_view() const

inline VkImage get() const

1.2. Source Code 137 Inexor Vulkan Renderer, Release v0.1-alpha.3

Private Members

const wrapper::Device &m_device VmaAllocation m_allocation = {VK_NULL_HANDLE} VmaAllocationInfo m_allocation_info = {} VkImage m_image = {VK_NULL_HANDLE} VkFormat m_format = {VK_FORMAT_UNDEFINED} VkImageView m_image_view = {VK_NULL_HANDLE} std::string m_name

Class Instance

• Defined in file_inexor_vulkan-renderer_wrapper_instance.hpp

Class Documentation class inexor::vulkan_renderer::wrapper::Instance RAII wrapper class for VkInstances.

Public Functions

Instance(const std::string &application_name, const std::string &engine_name, std::uint32_t application_version, std::uint32_t engine_version, std::uint32_t vk_api_version, bool enable_validation_layers, bool enable_renderdoc_layer, const std::vector &requested_instance_extensions, const std::vector &requested_instance_layers) Construct the Vulkan instance and specify the requested instance layers and instance extensions. Parameters • application_name – The Vulkan application’s internal application name. • engine_name – The Vulkan application’s internal engine name. • application_version – The Vulkan application’s internal version. • engine_version – The Vulkan application’s internal engine version. • vk_api_version – The requested version of Vulkan API from which an instance will be created. If the requested version of Vulkan API is not available, the creation of the instance will fail! • enable_validation_layers – True if validation layers should be enabled, false other- wise. • enable_renderdoc_layer – True if renderdoc layer should be enabled, false otherwise. • requested_instance_extensions – The instance extensions which are requested. • requested_instance_layers – The instance layers which are requested.

138 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Instance(const std::string &application_name, const std::string &engine_name, std::uint32_t application_version, std::uint32_t engine_version, std::uint32_t vk_api_version, bool enable_validation_layers, bool enable_renderdoc_layer) Construct the Vulkan instance without the requested instance layers and instance extensions. Parameters • application_name – The Vulkan application’s internal application name. • engine_name – The Vulkan application’s internal engine name. • application_version – The Vulkan application’s internal version. • engine_version – The Vulkan application’s internal engine version. • vk_api_version – The requested version of Vulkan API from which an instance will be created. If the requested version of Vulkan API is not available, the creation of the instance will fail! • enable_validation_layers – True if validation layers should be enabled, false other- wise. • enable_renderdoc_layer – True if renderdoc layer should be enabled, false otherwise. Instance(const Instance&) = delete

Instance(Instance&&) noexcept

~Instance()

Instance &operator=(const Instance&) = delete

Instance &operator=(Instance&&) = default

inline VkInstance instance() const

inline std::uint32_t vulkan_api_version() const

Public Static Functions

static bool is_layer_supported(const std::string &layer_name) Check if a certain instance layer is available on the system. Parameters layer_name – The name of the instance layer. Returns true if the instance layer is supported. static bool is_extension_supported(const std::string &extension_name) Check if a certain instance extension is supported on the system. Parameters extension_name – The name of the instance extension. Returns true if the instance extension is supported.

1.2. Source Code 139 Inexor Vulkan Renderer, Release v0.1-alpha.3

Private Members

VkInstance m_instance = {VK_NULL_HANDLE} std::uint32_t m_vk_api_version

Class OnceCommandBuffer

• Defined in file_inexor_vulkan-renderer_wrapper_once_command_buffer.hpp

Class Documentation class inexor::vulkan_renderer::wrapper::OnceCommandBuffer RAII wrapper class for VkCommandBuffers which will be used only once. These types of command buffers are often used for copy operations. We’re only going to use the command buffer once and wait with returning from the function until the copy operation has finished executing. It’s good practice to tell the driver about our intent using VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT.

Public Functions

OnceCommandBuffer(const Device &device, VkQueue queue, std::uint32_t queue_family_index) Default constructor. Parameters • device – The const reference to a device RAII wrapper instance. • queue – The Vulkan queue to use. • queue_family_index – The Vulkan queue family index to use. We can’t determine the queue and queue family index to use automatically using the device wrapper reference because we might choose a queue which is unsuitable for the requested purpose! This is the reason we must specify the queue and queue family index in the constructor. OnceCommandBuffer(const OnceCommandBuffer&) = delete

OnceCommandBuffer(OnceCommandBuffer&&) noexcept

~OnceCommandBuffer()

OnceCommandBuffer &operator=(const OnceCommandBuffer&) = delete

OnceCommandBuffer &operator=(OnceCommandBuffer&&) = delete

void create_command_buffer() Create the command buffer.

Note: We are not merging this into the constructor because we need to be able to call this function separately.

140 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

void start_recording() Call vkBeginCommandBuffer. void end_recording_and_submit_command() Call vkEndCommandBuffer and vkFreeCommandBuffers. inline VkCommandBuffer command_buffer() const

Private Members

const Device &m_device VkQueue m_queue = {VK_NULL_HANDLE} CommandPool m_command_pool std::unique_ptr m_command_buffer bool m_recording_started = {false}

Class ResourceDescriptor

• Defined in file_inexor_vulkan-renderer_wrapper_descriptor.hpp

Class Documentation class inexor::vulkan_renderer::wrapper::ResourceDescriptor RAII wrapper class for resource descriptors.

Public Functions

ResourceDescriptor(const Device &device, std::uint32_t swapchain_image_count, std::vector &&layout_bindings, std::vector &&descriptor_writes, std::string &&name) Default constructor. Parameters • device – The const reference to a device RAII wrapper instance. • swapchain_image_count – The number of images in swapchain. • layout_bindings – The descriptor layout bindings. • descriptor_writes – The write descriptor sets. • name – The internal debug marker name of the resource descriptor. ResourceDescriptor(const ResourceDescriptor&) = delete

ResourceDescriptor(ResourceDescriptor&&) noexcept

~ResourceDescriptor()

1.2. Source Code 141 Inexor Vulkan Renderer, Release v0.1-alpha.3

ResourceDescriptor &operator=(const ResourceDescriptor&) = delete

ResourceDescriptor &operator=(ResourceDescriptor&&) = delete

inline const auto &descriptor_sets() const

inline auto descriptor_set_layout() const

inline const auto &descriptor_set_layout_bindings() const

Private Members

std::string m_name const Device &m_device VkDescriptorPool m_descriptor_pool = {VK_NULL_HANDLE} VkDescriptorSetLayout m_descriptor_set_layout = {VK_NULL_HANDLE} std::vector m_descriptor_set_layout_bindings std::vector m_write_descriptor_sets std::vector m_descriptor_sets std::uint32_t m_swapchain_image_count = {0}

Class Semaphore

• Defined in file_inexor_vulkan-renderer_wrapper_semaphore.hpp

Class Documentation class inexor::vulkan_renderer::wrapper::Semaphore RAII wrapper class for VkSemaphore.

Public Functions

Semaphore(const Device &device, const std::string &name) Default constructor. Parameters • device – The const reference to a device RAII wrapper instance. • name – The internal debug marker name of the VkSemaphore. Semaphore(const Semaphore&) = delete

142 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Semaphore(Semaphore&&) noexcept

~Semaphore()

Semaphore &operator=(const Semaphore&) = delete

Semaphore &operator=(Semaphore&&) = delete

inline VkSemaphore get() const

inline const VkSemaphore *ptr() const

Private Members

const Device &m_device VkSemaphore m_semaphore = {VK_NULL_HANDLE} std::string m_name

Class Shader

• Defined in file_inexor_vulkan-renderer_wrapper_shader.hpp

Class Documentation class inexor::vulkan_renderer::wrapper::Shader RAII wrapper class for VkShaderModules.

Public Functions

Shader(const Device &m_device, VkShaderStageFlagBits type, const std::string &name, const std::vector &code, const std::string &entry_point = "main") Construct a shader module from a block of SPIR-V memory. Parameters • device – The const reference to a device RAII wrapper instance. • type – The shader type. • name – The internal debug marker name of the VkShaderModule. • code – The memory block of the SPIR-V shader. • entry_point – The name of the entry point, “main” by default.

1.2. Source Code 143 Inexor Vulkan Renderer, Release v0.1-alpha.3

Shader(const Device &m_device, VkShaderStageFlagBits type, const std::string &name, const std::string &file_name, const std::string &entry_point = "main") Construct a shader module from a SPIR-V file. This constructor loads the file content and just callsthe other constructor. Parameters • device – The const reference to a device RAII wrapper instance. • type – The shader type. • name – The internal debug marker name of the VkShaderModule. • file_name – The name of the SPIR-V shader file to load. • entry_point – The name of the entry point, “main” by default. Shader(const Shader&) = delete

Shader(Shader&&) noexcept

~Shader()

Shader &operator=(const Shader&) = delete

Shader &operator=(Shader&&) = delete

inline const std::string &name() const

inline const std::string &entry_point() const

inline VkShaderStageFlagBits type() const

inline VkShaderModule module() const

Private Members

const Device &m_device std::string m_name std::string m_entry_point VkShaderStageFlagBits m_type VkShaderModule m_shader_module = {VK_NULL_HANDLE}

144 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Class StagingBuffer

• Defined in file_inexor_vulkan-renderer_wrapper_staging_buffer.hpp

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::wrapper::GPUMemoryBuffer (Class GPUMemoryBuffer)

Class Documentation class inexor::vulkan_renderer::wrapper::StagingBuffer : public inexor::vulkan_renderer::wrapper::GPUMemoryBuffer RAII wrapper class for staging buffers. A staging buffer is a buffer which is used for copying data. Usinga staging buffer is the most efficient way to copy memory from RAMtoGPU.

Public Functions

StagingBuffer(const Device &device, const std::string &name, VkDeviceSize buffer_size, void *data, std::size_t data_size) Default constructor. Parameters • device – The const reference to a device RAII wrapper instance. • name – The internal debug marker name of the staging buffer. • buffer_size – The size of the memory buffer to copy. • data – A pointer to the memory buffer. • data_size – The size of the memory buffer to copy. StagingBuffer(const StagingBuffer&) = delete

StagingBuffer(StagingBuffer&&) noexcept

~StagingBuffer() override = default

StagingBuffer &operator=(const StagingBuffer&) = delete

StagingBuffer &operator=(StagingBuffer&&) = delete

void upload_data_to_gpu(const GPUMemoryBuffer &tarbuffer) Call vkCmdCopyBuffer inside of the once command buffer. Parameters tarbuffer – The memory buffer to copy.

1.2. Source Code 145 Inexor Vulkan Renderer, Release v0.1-alpha.3

Private Members

const Device &m_device OnceCommandBuffer m_command_buffer_for_copying

Class Swapchain

• Defined in file_inexor_vulkan-renderer_wrapper_swapchain.hpp

Class Documentation class inexor::vulkan_renderer::wrapper::Swapchain RAII wrapper class for VkSwapchainKHR.

Public Functions

Swapchain(const Device &device, VkSurfaceKHR surface, std::uint32_t window_width, std::uint32_t window_height, bool enable_vsync, std::string name) Default constructor. Parameters • device – The const reference to a device RAII wrapper instance. • surface – The surface. • window_width – The width of the window. • window_height – The height of the window. • enable_vsync – True if vertical synchronization is requested, false otherwise. • name – The internal debug marker name of the VkSwapchainKHR. Swapchain(const Swapchain&) = delete

Swapchain(Swapchain&&) noexcept

~Swapchain()

Swapchain &operator=(const Swapchain&) = delete

Swapchain &operator=(Swapchain&&) = delete

std::uint32_t acquire_next_image(const Semaphore &semaphore) Call vkAcquireNextImageKHR. Parameters semaphore – A semaphore to signal once image acquisition has completed. void recreate(std::uint32_t window_width, std::uint32_t window_height) Recreate the swapchain.

146 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Parameters • window_width – The width of the window. • window_height – The height of the window. inline const VkSwapchainKHR *swapchain_ptr() const

inline VkSwapchainKHR swapchain() const

inline std::uint32_t image_count() const

inline VkFormat image_format() const

inline VkExtent2D extent() const

inline VkImageView image_view(std::size_t index) const

inline std::vector image_views() const

Private Functions

void setup_swapchain(VkSwapchainKHR old_swapchain, std::uint32_t window_width, std::uint32_t window_height) Set up the swapchain.

Note: Swapchain recreation can be made faster drastically when passing the old swapchain.

Parameters • old_swapchain – The old swapchain. • window_width – The width of the window. • window_height – The height of the window.

Private Members

const wrapper::Device &m_device VkSurfaceKHR m_surface = {VK_NULL_HANDLE} VkSwapchainKHR m_swapchain = {VK_NULL_HANDLE} VkSurfaceFormatKHR m_surface_format = {} VkExtent2D m_extent = {} std::vector m_swapchain_images std::vector m_swapchain_image_views std::uint32_t m_swapchain_image_count = {0}

1.2. Source Code 147 Inexor Vulkan Renderer, Release v0.1-alpha.3

std::string m_name bool m_vsync_enabled = {false}

Class UniformBuffer

• Defined in file_inexor_vulkan-renderer_wrapper_uniform_buffer.hpp

Inheritance Relationships

Base Type

• public inexor::vulkan_renderer::wrapper::GPUMemoryBuffer (Class GPUMemoryBuffer)

Class Documentation class inexor::vulkan_renderer::wrapper::UniformBuffer : public inexor::vulkan_renderer::wrapper::GPUMemoryBuffer RAII wrapper class for uniform buffers.

Public Functions

UniformBuffer(const Device &device, const std::string &name, const VkDeviceSize &size) Default constructor.

Todo: Add overloaded constructor which directly accepts the uniform buffer data.

Parameters • device – The const reference to a device RAII wrapper instance. • name – The internal debug marker name of the uniform buffer. • size – The size of the uniform buffer.

UniformBuffer(const UniformBuffer&) = delete

UniformBuffer(UniformBuffer&&) noexcept

~UniformBuffer() override = default

UniformBuffer &operator=(const UniformBuffer&) = delete

UniformBuffer &operator=(UniformBuffer&&) = delete

148 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

void update(void *data, std::size_t size) Update uniform buffer data. Parameters • data – A pointer to the uniform buffer data. • size – The size of the uniform buffer memory to copy.

Class Window

• Defined in file_inexor_vulkan-renderer_wrapper_window.hpp

Class Documentation class inexor::vulkan_renderer::wrapper::Window RAII wrapper class for GLFW windows.

Public Types

enum Mode Values:

enumerator WINDOWED enumerator FULLSCREEN enumerator WINDOWED_FULLSCREEN

Public Functions

Window(const std::string &title, std::uint32_t width, std::uint32_t height, bool visible, bool resizable, Mode mode) Default constructor. Parameters • title – The title of the window. This will be displayed in the window bar. • width – The width of the window. • height – The height of the window. • visible – True if the window is visible after creation, false otherwise. • resizable – True if the window should be resizable, false otherwise. Window(const Window&) = delete

Window(Window&&) = delete

~Window()

1.2. Source Code 149 Inexor Vulkan Renderer, Release v0.1-alpha.3

Window &operator=(const Window&) = delete

Window &operator=(Window&&) = delete

void wait_for_focus() In case the window has been minimized, process events until it has been restored. void set_title(const std::string &title) Change the window title. Parameters title – The new title of the window. void set_user_ptr(void *user_ptr) Set the GLFW window user pointer. Parameters user_ptr – The window user pointer. void set_resize_callback(GLFWframebuffersizefun frame_buffer_resize_callback) Set up the window resize callback. Parameters frame_buffer_resize_callback – The window resize callback. void set_keyboard_button_callback(GLFWkeyfun keyboard_button_callback) Call glfwSetKeyCallback. Parameters key_input_callback – The keyboard input callback. void set_cursor_position_callback(GLFWcursorposfun cursor_pos_callback) Call glfwSetCursorPosCallback. Parameters cursor_pos_callback – They cursor position callback. void set_mouse_button_callback(GLFWmousebuttonfun mouse_button_callback) Call glfwSetMouseButtonCallback. Parameters mouse_button_callback – The mouse button callback. void set_mouse_scroll_callback(GLFWscrollfun mouse_scroll_callback) Call glfwSetScrollCallback. Parameters mouse_scroll_callback – The mouse scroll callback. void show() Call glfwShowWindow. bool should_close() Check if the window is about to close. Returns true if the window will be closed. inline GLFWwindow *get() const

inline std::uint32_t width() const

inline std::uint32_t height() const

inline Mode mode() const

150 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Public Static Functions

static void poll() Call glfwPollEvents.

Private Members

std::uint32_t m_width std::uint32_t m_height Mode m_mode GLFWwindow *m_window = {nullptr}

Class WindowSurface

• Defined in file_inexor_vulkan-renderer_wrapper_window_surface.hpp

Class Documentation class inexor::vulkan_renderer::wrapper::WindowSurface RAII wrapper class for VkSurfaceKHR.

Public Functions

WindowSurface(VkInstance instance, GLFWwindow *window) Default constructor. Parameters • instance – The Vulkan instance which will be associated with this surface. • window – The window which will be associated with this surface. WindowSurface(const WindowSurface&) = delete

WindowSurface(WindowSurface&&) noexcept

~WindowSurface()

WindowSurface &operator=(const WindowSurface&) = delete

WindowSurface &operator=(WindowSurface&&) = default

inline VkSurfaceKHR get() const

1.2. Source Code 151 Inexor Vulkan Renderer, Release v0.1-alpha.3

Private Members

VkInstance m_instance = {VK_NULL_HANDLE} VkSurfaceKHR m_surface = {VK_NULL_HANDLE}

Enums

Enum BufferUsage

• Defined in file_inexor_vulkan-renderer_render_graph.hpp

Enum Documentation enum inexor::vulkan_renderer::BufferUsage Values:

enumerator INDEX_BUFFER Specifies that the buffer will be used to input index data.

enumerator VERTEX_BUFFER Specifies that the buffer will be used to input per vertex data to a vertex shader.

Enum CameraMovement

• Defined in file_inexor_vulkan-renderer_camera.hpp

Enum Documentation enum inexor::vulkan_renderer::CameraMovement Values:

enumerator FORWARD enumerator BACKWARD enumerator LEFT enumerator RIGHT

152 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Enum CameraType

• Defined in file_inexor_vulkan-renderer_camera.hpp

Enum Documentation

enum inexor::vulkan_renderer::CameraType Values:

enumerator LOOK_AT

Enum TextureUsage

• Defined in file_inexor_vulkan-renderer_render_graph.hpp

Enum Documentation enum inexor::vulkan_renderer::TextureUsage Values:

enumerator BACK_BUFFER Specifies that this texture is the output of the render graph.

enumerator DEPTH_STENCIL_BUFFER Specifies that this texture is a combined depth/stencil buffer.

Note: This may mean that this texture is completely GPU-sided and cannot be accessed by the CPU in any way.

enumerator NORMAL Specifies that this texture isn’t used for any special purpose.

Functions

Function inexor::vulkan_renderer::operator==

• Defined in file_inexor_vulkan-renderer_octree_gpu_vertex.hpp

1.2. Source Code 153 Inexor Vulkan Renderer, Release v0.1-alpha.3

Function Documentation inline bool inexor::vulkan_renderer::operator==(const OctreeGpuVertex &lhs, const OctreeGpuVertex &rhs)

Template Function inexor::vulkan_renderer::vk_tools::as_string

• Defined in file_inexor_vulkan-renderer_vk_tools_representation.hpp

Function Documentation template std::string_view inexor::vulkan_renderer::vk_tools::as_string(VulkanDataType) Convert a Vulkan data structure into a std::string_view.

Function inexor::vulkan_renderer::vk_tools::print_all_physical_devices

• Defined in file_inexor_vulkan-renderer_vk_tools_gpu_info.hpp

Function Documentation void inexor::vulkan_renderer::vk_tools::print_all_physical_devices(VkInstance instance, VkSurfaceKHR surface) List up all available gpus. Parameters • instance – The instance of Vulkan. • surface – The regarded Vulkan window surface.

Function inexor::vulkan_renderer::vk_tools::print_device_extensions

• Defined in file_inexor_vulkan-renderer_vk_tools_gpu_info.hpp

Function Documentation void inexor::vulkan_renderer::vk_tools::print_device_extensions(VkPhysicalDevice gpu) Print all available Vulkan device extensions. Parameters gpu – The regarded gpu.

154 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Function inexor::vulkan_renderer::vk_tools::print_driver_vulkan_version

• Defined in file_inexor_vulkan-renderer_vk_tools_gpu_info.hpp

Function Documentation

void inexor::vulkan_renderer::vk_tools::print_driver_vulkan_version() Print available version of Vulkan API.

Note: Inexor engine does not use a Vulkan metaloader such as Volk.

Function inexor::vulkan_renderer::vk_tools::print_instance_extensions

• Defined in file_inexor_vulkan-renderer_vk_tools_gpu_info.hpp

Function Documentation

void inexor::vulkan_renderer::vk_tools::print_instance_extensions() Print all available Vulkan instance extensions.

Function inexor::vulkan_renderer::vk_tools::print_instance_layers

• Defined in file_inexor_vulkan-renderer_vk_tools_gpu_info.hpp

Function Documentation

void inexor::vulkan_renderer::vk_tools::print_instance_layers() Print all available Vulkan instance layers.

Function inexor::vulkan_renderer::vk_tools::print_physical_device_features

• Defined in file_inexor_vulkan-renderer_vk_tools_gpu_info.hpp

Function Documentation void inexor::vulkan_renderer::vk_tools::print_physical_device_features(VkPhysicalDevice gpu) Print information about the features of the gpu. Parameters gpu – The regarded gpu.

1.2. Source Code 155 Inexor Vulkan Renderer, Release v0.1-alpha.3

Function inexor::vulkan_renderer::vk_tools::print_physical_device_info

• Defined in file_inexor_vulkan-renderer_vk_tools_gpu_info.hpp

Function Documentation

void inexor::vulkan_renderer::vk_tools::print_physical_device_info(VkPhysicalDevice gpu) Print information about the specified gpu. Parameters gpu – The regarded gpu.

Function inexor::vulkan_renderer::vk_tools::print_physical_device_limits

• Defined in file_inexor_vulkan-renderer_vk_tools_gpu_info.hpp

Function Documentation void inexor::vulkan_renderer::vk_tools::print_physical_device_limits(VkPhysicalDevice gpu) Print information about the limits of the specified gpu. Parameters gpu – The regarded gpu.

Function inexor::vulkan_renderer::vk_tools::print_physical_device_memory_properties

• Defined in file_inexor_vulkan-renderer_vk_tools_gpu_info.hpp

Function Documentation void inexor::vulkan_renderer::vk_tools::print_physical_device_memory_properties(VkPhysicalDevice gpu) Print information about the memory properties of a specified gpu. Parameters gpu – The regarded gpu.

Function inexor::vulkan_renderer::vk_tools::print_physical_device_queue_families

• Defined in file_inexor_vulkan-renderer_vk_tools_gpu_info.hpp

Function Documentation void inexor::vulkan_renderer::vk_tools::print_physical_device_queue_families(VkPhysicalDevice gpu) Print information about a gpu’s device queue families. Parameters gpu – The regarded gpu.

156 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Function inexor::vulkan_renderer::vk_tools::print_physical_device_sparse_properties

• Defined in file_inexor_vulkan-renderer_vk_tools_gpu_info.hpp

Function Documentation

void inexor::vulkan_renderer::vk_tools::print_physical_device_sparse_properties(VkPhysicalDevice gpu) Print information about the sparse properties of the specified gpu. Parameters gpu – The regarded gpu.

Function inexor::vulkan_renderer::vk_tools::print_presentation_modes

• Defined in file_inexor_vulkan-renderer_vk_tools_gpu_info.hpp

Function Documentation void inexor::vulkan_renderer::vk_tools::print_presentation_modes(VkPhysicalDevice gpu, VkSurfaceKHR surface) Print all available presentation modes. Parameters • gpu – The regarded gpu. • surface – The regarded surface.

Function inexor::vulkan_renderer::vk_tools::print_supported_surface_formats

• Defined in file_inexor_vulkan-renderer_vk_tools_gpu_info.hpp

Function Documentation void inexor::vulkan_renderer::vk_tools::print_supported_surface_formats(VkPhysicalDevice gpu, VkSurfaceKHR surface) Print all supported surface formats of a given combination of gpu and surface. Parameters • gpu – The regarded gpu. • surface – The regarded Vulkan window surface.

1.2. Source Code 157 Inexor Vulkan Renderer, Release v0.1-alpha.3

Function inexor::vulkan_renderer::vk_tools::print_surface_capabilities

• Defined in file_inexor_vulkan-renderer_vk_tools_gpu_info.hpp

Function Documentation

void inexor::vulkan_renderer::vk_tools::print_surface_capabilities(VkPhysicalDevice gpu, VkSurfaceKHR surface) Print all supported surface capabilities of a given combination of gpu and surface. Parameters • gpu – The regarded gpu. • surface – The regarded surface.

Function inexor::vulkan_renderer::vk_tools::result_to_description

• Defined in file_inexor_vulkan-renderer_vk_tools_representation.hpp

Function Documentation std::string_view inexor::vulkan_renderer::vk_tools::result_to_description(VkResult result) Return a VkResult’s description text as std::string_view.

Note: This function can be used for both VkResult error and success values.

Parameters result – The VkResult return value which will be turned into a std::string_view.

Function inexor::vulkan_renderer::world::create_random_world

• Defined in file_inexor_vulkan-renderer_world_cube.hpp

Function Documentation std::shared_ptr inexor::vulkan_renderer::world::create_random_world(std::uint32_t max_depth, const glm::vec3 &position, std::optional seed = std::nullopt) Construct a randomly generated cube world. Using the following probabilities: empty: 30% solid: 30% normal: 40% The number of intendations are evenly distributed. Empty normal cubes are not generated. Parameters • max_depth – The maximum of nested octants. • position – The position where the root cube is placed.

158 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

• seed – The seed used for the random number generator.

Function inexor::vulkan_renderer::world::ray_box_collision

• Defined in file_inexor_vulkan-renderer_world_collision_query.hpp

Function Documentation

bool inexor::vulkan_renderer::world::ray_box_collision(std::array &box_bounds, glm::vec3 &pos, glm::vec3 &dir) True of the ray build from the two vectors collides with the cube’s bounding box.

Note: There is no such function as glm::intersectRayBox.

Parameters • box_bounds – An array of two vectors which represent the edges of the bounding box. • pos – The start position of the ray. • dir – The direction of the ray. Returns True if the ray collides with the octree cube’s bounding box.

Function inexor::vulkan_renderer::world::ray_cube_collision_check

• Defined in file_inexor_vulkan-renderer_world_collision_query.hpp

Function Documentation std::optional> inexor::vulkan_renderer::world::ray_cube_collision_check(const Cube &cube, glm::vec3 pos, glm::vec3 dir, std::optional max_depth = std::nullopt) Check for a collision between a camera ray and octree geometry.

Note: This does not account yet for octree indentation!

Parameters • cube – The cube to check collisions with. • pos – The camera position.

1.2. Source Code 159 Inexor Vulkan Renderer, Release v0.1-alpha.3

• dir – The camera view direction. • max_depth – The maximum subcube iteration depth. If this depth is reached and the cube is an octant, it will be treated as if it was a solid cube. This is the foundation for the imple- mentation of grid size in octree editor. Returns A std::optional which contains the collision data (if any found).

Template Function inexor::vulkan_renderer::wrapper::make_info

• Defined in file_inexor_vulkan-renderer_wrapper_make_info.hpp

Function Documentation template T inexor::vulkan_renderer::wrapper::make_info() A small helper function that return vulkan create infos with sType already set.

auto render_pass_ci= make_info();

Note: Also zeros the returned struct

Function swap

• Defined in file_inexor_vulkan-renderer_world_cube.hpp

Function Documentation

void swap(inexor::vulkan_renderer::world::Cube &lhs, inexor::vulkan_renderer::world::Cube &rhs) noexcept

Variables

Variable inexor::vulkan_renderer::directions::DEFAULT_FRONT

• Defined in file_inexor_vulkan-renderer_camera.hpp

160 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Variable Documentation

constexpr glm::vec3 inexor::vulkan_renderer::directions::DEFAULT_FRONT = {1.0f, 0.0f, 0.0f} The default value of the camera’s front vector.

Variable inexor::vulkan_renderer::directions::DEFAULT_RIGHT

• Defined in file_inexor_vulkan-renderer_camera.hpp

Variable Documentation

constexpr glm::vec3 inexor::vulkan_renderer::directions::DEFAULT_RIGHT = {0.0f, 1.0f, 0.0f} The default value of the camera’s right vector.

Variable inexor::vulkan_renderer::directions::DEFAULT_UP

• Defined in file_inexor_vulkan-renderer_camera.hpp

Variable Documentation constexpr glm::vec3 inexor::vulkan_renderer::directions::DEFAULT_UP = {0.0f, 0.0f, 1.0f} The default value of the camera’s up vector.

Typedefs

Typedef inexor::vulkan_renderer::world::Polygon

• Defined in file_inexor_vulkan-renderer_world_cube.hpp

Typedef Documentation

using inexor::vulkan_renderer::world::Polygon = std::array std::vector can probably replaced with an array.

Typedef inexor::vulkan_renderer::world::PolygonCache

• Defined in file_inexor_vulkan-renderer_world_cube.hpp

1.2. Source Code 161 Inexor Vulkan Renderer, Release v0.1-alpha.3

Typedef Documentation using inexor::vulkan_renderer::world::PolygonCache = std::shared_ptr>

1.3 How to contribute

1.3.1 Code of Conduct

Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

Our Standards

Examples of behavior that contributes to creating a positive environment include: • Using welcoming and inclusive language • Being respectful of differing viewpoints and experiences • Gracefully accepting constructive criticism • Focusing on what is best for the community • Showing empathy towards other community members Examples of unacceptable behavior by participants include: • The use of sexualized language or imagery and unwelcome sexual attention or advances • Trolling, insulting or derogatory comments, and personal or political attacks • Public or private harassment • Publishing others’ private information, such as a physical or electronic address, without explicit permission • Other conduct which could reasonably be considered inappropriate in a professional setting

Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appro- priate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

162 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online oroffline event. Representation of a project may be further defined and clarified by project maintainers.

Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project’s leadership.

Attribution

This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://www. contributor-covenant.org/version/1/4/code-of-conduct.html For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq

1.3.2 Licenses

In general we accept every widely acknowledged license which allows to share, modify, share the modified work, make commercial use or any combination of these. The licenses we accept are listed here, and below are the ones we do not. If you are not sure about something or the license doesn’t appear in these lists, don’t hesitate to ask us about it on our Discord.

List of accepted licenses

• CC0 1.0 or any later version • CC BY 3.0 or any later version • CC BY-SA 3.0 or any later version • ZLIB • MIT

List of licenses we don’t accept:

The following licenses either have a non-derivative or non-commercial section: • CC BY-ND any version • CC BY-NC any version • CC BY-NC-ND any version • CC BY-NC-SA any version • No license at all

1.3. How to contribute 163 Inexor Vulkan Renderer, Release v0.1-alpha.3

Special notes

We reject content which is licensed under the terms of a license which aims at one special jurisdiction. We consider ourselves as an international community and we define freedom as the freedom for everyone, everywhere. Please, don’t use licenses which could cause trouble, e.g. all Creative Commons licenses before the 4.0 versions have local derivations for a lot of countries (e.g. CC BY 3.0 DE). Starting with CC v4.0 there is only one international license to address this issue. We also don’t accept Public Domain. The problem with Public Domain is that the definition is different from jurisdiction to jurisdiction, there isn’t an international declaration. Also in some jurisdiction it’s very complicated till impossible to make your work Public Domain before your rights expire after the ordinary time. Instead of Public Domain we recommend using CC0 (Creative Commons Zero). CC0 is basically a license which gives the creator a way to waive all their copyright and related rights in their works to the fullest extent allowed by law + a Public Domain fallback if the waiving of the rights isn’t possible under special circumstances.

Common mistakes:

• Missing version number of the license (if exists), e.g. “Creative Commons BY”. • Missing full name of the license, e.g. “licensed under a Creative Commons license”. • Mix between the short form and the complete name, e.g. “Creative Commons BY Attribution 4.0”.

1.3.3 Contribute code

• If you want to contribute code, join our Discord and have a look at our vulkan-renderer repository. • Try to find a first good issue in our issue tracker. • Open a pull request. • We want to keep commit as small in size as possible.

Signing commits

• We encourage you to sign your commits, although this is not a strict requirement from our side. • You can find help on how to sign commits in GitHub’s docs.

Commit naming convention

The commit naming convention will be checked by our continuous integration. In order to be valid, the followin rules must all be fulfilled: • The commit message must begin with a category in square brackets which describes the code part that was changed • The commit category must not be empty • A commit category must contain at least two characters. Allowed characters are: letters a-z, numbers 0-9, and -. For example [gpu-texture] • If two code parts are affected, separate the categories using |, for example [gpu-texture|gpu-info] • If three or more code parts are affected, use [*] as category • Leave one space after the commit category

164 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

• The commit message itself must consist of the following characters: letters a-z, numbers 0-9 • The commit message must begin with a capital letter • The commit message must exist and it must not be empty • The commit message must not end with ., ! or ? Examples • [docs] Explain commit naming convention • [gpu-info] Don't display empty gpu info queries as error • [gpu-info|representation] Cleanup • [ci] Add commit naming check • [*] Move GPU info to vk tools

Additional information

The regex pattern for the commit category is \*|(?:[a-z0-9]{2,}[\s|-]?)+, the pattern for the message is [A-Z0-9].+[^.!?,\s]

1.3.4 Contribute art

If you want to contribute textures, sounds or models, check out our website or join our Discord server to find more information about supported formats etc.

1.3.5 List of Contributors

We are always open for suggestions or pull requests. You can search after diff:first issue for good issues to get in touch with this project. Join our Discord server. IAmNotHanni • Project and community management. • Large portion of Vulkan renderer. Iceflower • Threadpool improvements. • Advice on thread safety and code design. • CMake improvements and feedback. • Feedback on Travis CI and Github actions. • Support for Exhale. • Overall contributions to CI (Travis/Github actions). • Replaced unscoped enums with scoped enums. • Replaced macros with constexpr’s. • Improvement of overall project structure.

1.3. How to contribute 165 Inexor Vulkan Renderer, Release v0.1-alpha.3

• Overall code cleanup. • Read the docs support. movabo • First generation of octree engine code. authenticate • Refactoring of texture loading code. • Error texture generation. Shikijo • Pointed out broken glsl compiler batch script on Windows. Croydon • Advice on conan package manager. westernheld • Testing and debugging. uilianries • Travis CI setup yeetari • Building and testing vulkan-renderer on Linux. • Added USE_VMA_RECORDING CMake option so vulkan-renderer can be build on Linux until VMA recording has been ported. • Overall contributions to CI (Travis/Github actions). • Add build instructions for gentoo. • Replace _DEBUG with NDEBUG. • std::vector size check improvement. • Help with git. • Overall code cleanup. • Getting vulkan-renderer compile and run on Linux. • Overall CMake expertise. • Compiling SPIR-V shaders through CMake setup. azkoon • Help with Discord server. • Help with wiki. joetoth • Help with Discord server.

166 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

1.4 Frequently asked questions

Please visit inexor.org and join our Discord server.

• What is Inexor? • Which platforms are supported? • What is the current state of the project? • How is Inexor organized? • How to contact us? • How to build? • Where to find Inexor’s documentation? • What is Vulkan API? • Why is Vulkan API the future? • Can you explain Vulkan API in simple terms? • How difficult is development with Vulkan API? • Does my graphics card support Vulkan API? • Will you support other rendering APIs? • Which topics are currently not in focus of development?

1.4.1 What is Inexor?

Inexor is a MIT-licensed open-source project which develops a new 3D octree game engine by combining modern C++ with Vulkan Vulkan API. We have the following goals for the Inexor engine: • Combine modern C++ with Vulkan API. • Task-based parallelization using a threadpool and a work stealing queue. • Generic rendering architecture using a rendergraph.

1.4. Frequently asked questions 167 Inexor Vulkan Renderer, Release v0.1-alpha.3

• Create a Vulkan API codebase which can be used in production. We are using good software engineering practices: • Resource acquisition is initialization (RAII). • Software design patterns. • Continuous integration (CI) using GitHub actions. • Code design by strict compliance with the C++ core guidelines and Scott Meyers books. • Use of the new C++ standard library (C++11, C++14, and C++17). • Code documentation using doxygen. • Automatic unit testing and benchmarking. • Static code analysis with clang-tidy. • Automatic code formatting using clang-format. • CMake project setup with conan package manager integration. You can find Vulkan example code online which follows the mantra “don’t use this in production - it’s tutorial code”. Inexor disagrees with this as we believe that defeats its own purpose. If example code is not meant to be used in some other projects then there’s something wrong with that example code. Many projects don’t use a proper memory management library like VMA or they do not abstract their code using RAII, but use a lot of code duplication instead. Inexor is designed to be used in production. Bear in mind however that Inexor is also still far away from being a finished game engine.

1.4.2 Which platforms are supported?

• We support x64 Microsoft Windows 8, 8.1, and 10. • We support every x64 Linux distribution for which Vulkan drivers exist. • We have specific build instructions for Gentoo and Ubuntu. If you have found a way to set it up for other Linux distributions, please open a pull request and let us know! • We do not support macOS or iOS because it would require us to use MoltenVK to get Vulkan running on Mac OS. Additionally, this would require some changes in the engines as not all of Inexor’s dependencies are available on macOS or iOS. • We also do not support Android because this would require some changes in the engines as not all of Inexor’s dependencies are available on Android.

1.4.3 What is the current state of the project?

We are still in very early development, but this project can already offer: • A modern C++17 codebase with a setup for CMake and conan package manager. • Stable builds for Windows and Linux using Continuous Integration (CI). • A rendergraph in early development. • ImGui integration using separate renderpasses.

168 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

• RAII wrappers for various Vulkan resources. • Extensive logging with spdlog. • Vulkan Memory Allocator for graphics memory management. • VMA memory replays for debugging are already working. • Full RenderDoc integration with internal resource naming.

1.4.4 How is Inexor organized?

• Inexor has no central authority. • It’s a headless collective which makes decisions through creative discussions. • We are welcoming new contributors to our team.

1.4.5 How to contact us?

Please visit inexor.org and join our Discord server.

1.4.6 How to build?

If you have any trouble building please open a ticket or join our Discord. How to build vulkan-renderer?

1.4.7 Where to find Inexor’s documentation?

• Read our docs here.

1.4.8 What is Vulkan API?

Inexor uses Vulkan API as rendering backend. Vulkan is a new, multi platform low level API (application program- ming interface) for high-performance graphics programming and computing. It is the successor to OpenGL, and it is important to state that is is very different from it. Vulkan is not just a new version of OpenGL or an extension ofit. Instead, Vulkan is a very low level API which allows for much deeper control over the graphics card and the driver, like DirectX 12 or Apple’s Metal. Unlike OpenGL, Vulkan API is build in a way it fits the architecture of modern graphics cards. This offers better performance due to reduction of overhead and driver guesswork during runtime. This results in

1.4. Frequently asked questions 169 Inexor Vulkan Renderer, Release v0.1-alpha.3 higher frame rate, more predictable CPU workload and a lower memory usage. The most important benefit of Vulkan is the fact that it allows for multithreaded rendering, which is not possible in OpenGL at all. In general, Vulkan does a lot of work during the initialization of the application but therefore reduces work during rendering. Since Vulkan is much more explicit in terms of code, it foces you to think about the structure and architecture of your code. Both Vulkan and OpenGL are being developed by the . Vulkan is being developed through an unprecedented collabora- tion of major industry-leading companies (Google, Intel, AMD, NVidia, Sony, Samsung, Huawei, Qualcomm, Valve Software and many more). Vulkan is the only multi platform low level graphics API.

1.4.9 Why is Vulkan API the future?

Performance • Lower and more predictable CPU load which results in better performance and a reduction of driver guesswork. • Vulkan API is asynchronous and encourages multithreaded rendering. This is not possible with OpenGL! • The low level API design of Vulkan allows for advanced optimizations such as rendergraphs for generic rendering architectures. • It also wants you to use the GPU asynchronously, sometimes referred to as GPU multithreading. • Vulkan allows the use of multiple GPUs, even if they are not physically linked via crossfire bridge. • The reduction of CPU workload and it’s improved predictability can enforce the GPU to be the limiting factor of performance, as it should be. Memory efficiency • Vulkan gives much deeper control and better interfaces over graphics and system memory. • Vulkan API enforces memory management to be done by the application rather than the driver. • Since the application knows best about the importance of every resource it uses, Vulkan API allows for a better memory usage. Architecture • Unlike OpenGL, Vulkan fits the design of modern GPUs as it is not just onesingle state machine. This means Vulkan API was designed from the beginning to match the architecture of modern graphics cards. OpenGL however still matches the design of graphics cards from the time it was invented in the 1990s. • Vulkan is a fresh start, whereas OpenGL contains a myriad of hacks to support very rare use cases. • Vulkan has layers and extensions as part of its design. You can check for supported GPU plugins on the target machine and enable them as needed. • Vulkan API itself is completely platform agnostic. • Available on a variety of platforms: Windows, Linux, mobile devices and much more! • The ending of the OpenGL era has begun. • Vulkan is being developed through an unprecedented collaboration of major industry-leading companies. It is not being developed by one company only (like Microsoft’s DirectX for example). • As Vulkan’s motto states, it really is industry-forged. Consistency and standardization • Vulkan precompiles shaders to a standardized bytecode format called SPIR-V. This also reduces driver guesswork during runtime.

170 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

• The explicit design of Vulkan gives much deeper control and avoids driver guesswork and undefined behavior of graphics drivers. Debugging tools • Validation layers and diagnostics can be independently activated during development, allowing better error han- dling and debugging compared with OpenGL or DirectX. • Upon release builds, the validation layers can be turned off easily. • Vulkan API applications can be debugged with RenderDoc. • The Vulkan specification is very easy to read and it is the central guideline for how to use the API. Open Source • Vulkan API and some Vulkan graphics card drivers are open source.

1.4.10 Can you explain Vulkan API in simple terms?

• Vulkan API gives programmers much deeper control over the gamer’s hardware. • If applied correctly, Vulkan can result in a significant performance boost. • The API encourages the programmers to think in detail about graphics cards and their game engine. • It offers advanced optimization techniques which can result in a lower RAM and video memory usage. • Using Vulkan can yield in lower and more predictable CPU usage. • Vulkan allows programmers to make more effective use of multiple CPU cores.

1.4.11 How difficult is development with Vulkan API?

• This API does a lot of initialization during the loading phase of the application. • The key to success is a good abstraction of Vulkan API based on the needs of the application/game. • Vulkan is a C-style API. In simplified terms you fill out structures which start with Vk.. and submit them together with other parameters to vk... functions. That’s it. No complex interfaces. • Vulkan API has a very good documentation. • The challenges of Vulkan game/engine development boil down to basic programming challenges: abstraction, resource management and parallelization. • You may want to read Vulkan in 30 minutes by Baldur Karlsson.

1.4. Frequently asked questions 171 Inexor Vulkan Renderer, Release v0.1-alpha.3

1.4.12 Does my graphics card support Vulkan API?

• You can look up your graphics card in the Vulkan hardware database by Sascha Willems. • Every new graphics card which is coming out these days supports Vulkan API. • Vulkan is also supported on older graphics cards going back to Radeon HD 7000 series and Nvidia Geforce 6 series.

1.4.13 Will you support other rendering APIs?

• No, because testing for Vulkan already takes a lot of time and there is no sense in supporting deprecated tech- nology. • Some studios like id-software also dropped OpenGL entirely. • Vulkan API is the only low level multi platform graphics and compute API.

1.4.14 Which topics are currently not in focus of development?

• We are currently focusing on the renderer and Vulkan API. When the time has come, we will take parallelization into account. • A game engine needs other components besides rendering of course. However, we are currently not focusing on the following topics: networking, sound, physics, packaging of game engine resources and everything else which is not related to rendering. • We will not begin to support additional platforms besides Linux and Windows in the near future.

1.5 Changelog

All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning. You can find all releases in our GitHub repository.

1.5.1 v0.1-alpha.3 (17 May 2020)

Changed

• RAII in shader code • RAII in shaders, gpu memory buffers, staging buffers, mesh buffers and textures • RAII in descriptors • RAII VkInstance • RAII Swapchain • Removed manager classes entirely.

172 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

1.5.2 v0.1-alpha.2 (26 Apr 2020)

Added

• Create a threadpool using C++17. • Added a simple C++17 implementation of an octree. • Added event system using boost::signals2. • Use boost::bitstream for data processing. • Convert octree data structure to vertex geometry (a mesh buffer). • Support arbitrary indentations of octree geometry. • Added a descriptor set layout for simple octree geometry. • Ported Vulkan Memory Allocator library (VMA) to Linux. • Added a simple camera movement class. • Write spdlog console output to a logfile.

Changed

• Improvements considering C++ code quality standards. • Logging format and logger usage.

Fixed

• Fixed a bug that would render every model twice.

1.5.3 v0.1-alpha.1 (12 Apr 2020)

Added

• Create a CMake file with conan package manager setup. • Integrate Vulkan Memory Allocator library (VMA). • Integrate RenderDoc support. • Use spdlog as logger library. • Integrate tiny_gltf library. • Mesh buffer manager for vertex and index buffers based onVMA. • Texture manager based on stb_image and VMA. • Uniform buffer manager based on VMA. • Shader manager for loading SPIR-V shaders. • Load TOML configuration files using toml11. We deliberately won’t use JSON for this. • Vulkan fence manager. • Vulkan semaphore manager.

1.5. Changelog 173 Inexor Vulkan Renderer, Release v0.1-alpha.3

• GPU info query functions. • Vulkan debug callbacks. • Vulkan standard validation layers. • C++11 std::chrono class. • Use glm. • Depth buffer. • Let VMA generate memory debug logs. • Associate internal resource names with memory regions to improve debugging. • Use separate data transfer queue for cpu to gpu memory copies if available. • Availability checks for Vulkan features. • Settings decision maker for Vulkan initialization. • Simple command line argument parser. • Automatic GPU selection mechanism and -gpu command line argument for preferential GPU. • Create windows using glfw3. • Keyboard input based on glfw3. • Load geometry of glTF 2.0 files using tiny_gltf library. • Basic camera class.

1.6 Helpful Links

• Khronos’ website about Vulkan API • Vulkan API 1.1 specification

1.6.1 Advantages of Vulkan

• NVidia developer: What Is Vulkan? • Stackoverflow: What can Vulkan do specifically that OpenGL 4.6+ cannot? • Stackexchange gamedev: What is Vulkan and how does it differ from OpenGL? • Stuck on OpenGL ES? Time to move on! Why Vulkan is the future of graphics • A Brief Overview Of Vulkan API • What advantages does Vulkan have over already established graphics APIs?

174 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

1.6.2 Getting started with Vulkan

GDC 2018 - Getting explicit: How Hard is Vulkan really? Dustin Land, Software engineer, id-Software. Porting your engine to Vulkan or DX12 Adam Sawicki, Developer Software Engineer, AMD. DevU 2017: Getting Started with Vulkan Developers from Imagination, Google and LunarG. Vulkan Best Practices Roundtable discussion NVidia, Imagination, Qualcomm, id-Software, EPIC-games and Google. Vulkan Memory Management Jordan Logan, Developer technology engineer, AMD. Vulkan Memory Management Steven Tovey, Developer technology engineer, AMD. Vulkan: State of the Union 2019 Developers from ARM, LunarG, NVidia.

1.6.3 Beginner Vulkan API tutorials

• Click here to check if your graphics card supports Vulkan API. • How to learn Vulkan? • The Vulkan tutorial • The Vulkan guide • Sascha Willems’ Vulkan tutorials • Intel’s Vulkan tutorial: API without secrets • Qualcomm developer network’s Vulkan tutorials • Introduction To Vulkan • Raw Vulkan: An overview on how to program a Hello Triangle Vulkan application from the ground up. • Vulkan Tutorial - 101 • Mike Bailey’s Vulkan Page • Using the Vulkan Validation Layers • Sascha Willems’ tutorial about Vulkan debug markers • Awesome Vulkan list

1.6.4 Migrating from OpenGL to Vulkan API

• Dustin Land’s blog series ‘I Am Graphics And So Can You’ • Transitioning from OpenGL to Vulkan • Porting a Graphics Engine to the Vulkan API

1.6. Helpful Links 175 Inexor Vulkan Renderer, Release v0.1-alpha.3

1.6.5 Advanced Vulkan API tutorials and articles

• Sascha Willems’ glTF2 + PBR (physically based rendering) demo • NVidia Developer Blog: Tips and Tricks: Vulkan Dos and Don’ts • Vulkan in 30 minutes • Writing an efficient Vulkan renderer • A simple Vulkan Compute example • Getting started with Vulkan API on Linux • Get started with Vulkan on Android • Use Vulkan API on macOS and iOS using MoltenVK • Multithreading in Vulkan, where should I start? • Multi-Threading in Vulkan • Vulkan Device Generated Commands • NVidia: Vulkan Memory Management • Using Vulkan Device Memory • Vulkan Barriers Explained • GPUOpen performance guide

1.6.6 Vulkan API presentations

• NVidia: GPU-driven rendering • NVidia: Vulkan: the essentials • The most common Vulkan mistakes • High-performance, Low-Overhead Rendering with OpenGL and Vulkan • Vulkan on NVidia GPUs • Get Your Engine Ready for Vulkan on Mobile • Vulkan’s Key Features on ARM Architecture

1.6.7 Vulkan API example projects

• The official Khronos Vulkan samples • Sascha Willems’ Vulkan tutorials • Sascha Willems’ tutorial about Vulkan debug markers • VFPR - a Vulkan Forward Plus Renderer

176 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

1.6.8 Drivers

• NVidia drivers • Open source AMD Vulkan driver • Open source Intel Vulkan driver

1.6.9 Debuggers

• RenderDoc • NVidia NSight • AMD’s GPU profiler

1.6.10 Modern C++

• Awesome modern C++ • C++ Core Guidelines

1.7 Source Code License

Copyright 2019-present Inexor Collective Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documen- tation files (the “Software”), to deal in the Software without restriction, including without limitation the rights touse, 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 PAR- TICULAR 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 SOFT- WARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

1.8 Contact us

Please join our Discord server and visit our website at www.inexor.org.

1.7. Source Code License 177 Inexor Vulkan Renderer, Release v0.1-alpha.3

1.9 Frequently asked questions

Please visit inexor.org and join our Discord server.

• What is Inexor? • Which platforms are supported? • What is the current state of the project? • How is Inexor organized? • How to contact us? • How to build? • Where to find Inexor’s documentation? • What is Vulkan API? • Why is Vulkan API the future? • Can you explain Vulkan API in simple terms? • How difficult is development with Vulkan API? • Does my graphics card support Vulkan API? • Will you support other rendering APIs? • Which topics are currently not in focus of development?

1.9.1 What is Inexor?

Inexor is a MIT-licensed open-source project which develops a new 3D octree game engine by combining modern C++ with Vulkan Vulkan API. We have the following goals for the Inexor engine: • Combine modern C++ with Vulkan API. • Task-based parallelization using a threadpool and a work stealing queue. • Generic rendering architecture using a rendergraph.

178 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

• Create a Vulkan API codebase which can be used in production. We are using good software engineering practices: • Resource acquisition is initialization (RAII). • Software design patterns. • Continuous integration (CI) using GitHub actions. • Code design by strict compliance with the C++ core guidelines and Scott Meyers books. • Use of the new C++ standard library (C++11, C++14, and C++17). • Code documentation using doxygen. • Automatic unit testing and benchmarking. • Static code analysis with clang-tidy. • Automatic code formatting using clang-format. • CMake project setup with conan package manager integration. You can find Vulkan example code online which follows the mantra “don’t use this in production - it’s tutorial code”. Inexor disagrees with this as we believe that defeats its own purpose. If example code is not meant to be used in some other projects then there’s something wrong with that example code. Many projects don’t use a proper memory management library like VMA or they do not abstract their code using RAII, but use a lot of code duplication instead. Inexor is designed to be used in production. Bear in mind however that Inexor is also still far away from being a finished game engine.

1.9.2 Which platforms are supported?

• We support x64 Microsoft Windows 8, 8.1, and 10. • We support every x64 Linux distribution for which Vulkan drivers exist. • We have specific build instructions for Gentoo and Ubuntu. If you have found a way to set it up for other Linux distributions, please open a pull request and let us know! • We do not support macOS or iOS because it would require us to use MoltenVK to get Vulkan running on Mac OS. Additionally, this would require some changes in the engines as not all of Inexor’s dependencies are available on macOS or iOS. • We also do not support Android because this would require some changes in the engines as not all of Inexor’s dependencies are available on Android.

1.9.3 What is the current state of the project?

We are still in very early development, but this project can already offer: • A modern C++17 codebase with a setup for CMake and conan package manager. • Stable builds for Windows and Linux using Continuous Integration (CI). • A rendergraph in early development. • ImGui integration using separate renderpasses.

1.9. Frequently asked questions 179 Inexor Vulkan Renderer, Release v0.1-alpha.3

• RAII wrappers for various Vulkan resources. • Extensive logging with spdlog. • Vulkan Memory Allocator for graphics memory management. • VMA memory replays for debugging are already working. • Full RenderDoc integration with internal resource naming.

1.9.4 How is Inexor organized?

• Inexor has no central authority. • It’s a headless collective which makes decisions through creative discussions. • We are welcoming new contributors to our team.

1.9.5 How to contact us?

Please visit inexor.org and join our Discord server.

1.9.6 How to build?

If you have any trouble building please open a ticket or join our Discord. How to build vulkan-renderer?

1.9.7 Where to find Inexor’s documentation?

• Read our docs here.

1.9.8 What is Vulkan API?

Inexor uses Vulkan API as rendering backend. Vulkan is a new, multi platform low level API (application program- ming interface) for high-performance graphics programming and computing. It is the successor to OpenGL, and it is important to state that is is very different from it. Vulkan is not just a new version of OpenGL or an extension ofit. Instead, Vulkan is a very low level API which allows for much deeper control over the graphics card and the driver, like DirectX 12 or Apple’s Metal. Unlike OpenGL, Vulkan API is build in a way it fits the architecture of modern graphics cards. This offers better performance due to reduction of overhead and driver guesswork during runtime. This results in

180 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3 higher frame rate, more predictable CPU workload and a lower memory usage. The most important benefit of Vulkan is the fact that it allows for multithreaded rendering, which is not possible in OpenGL at all. In general, Vulkan does a lot of work during the initialization of the application but therefore reduces work during rendering. Since Vulkan is much more explicit in terms of code, it foces you to think about the structure and architecture of your code. Both Vulkan and OpenGL are being developed by the Khronos Group. Vulkan is being developed through an unprecedented collabora- tion of major industry-leading companies (Google, Intel, AMD, NVidia, Sony, Samsung, Huawei, Qualcomm, Valve Software and many more). Vulkan is the only multi platform low level graphics API.

1.9.9 Why is Vulkan API the future?

Performance • Lower and more predictable CPU load which results in better performance and a reduction of driver guesswork. • Vulkan API is asynchronous and encourages multithreaded rendering. This is not possible with OpenGL! • The low level API design of Vulkan allows for advanced optimizations such as rendergraphs for generic rendering architectures. • It also wants you to use the GPU asynchronously, sometimes referred to as GPU multithreading. • Vulkan allows the use of multiple GPUs, even if they are not physically linked via crossfire bridge. • The reduction of CPU workload and it’s improved predictability can enforce the GPU to be the limiting factor of performance, as it should be. Memory efficiency • Vulkan gives much deeper control and better interfaces over graphics and system memory. • Vulkan API enforces memory management to be done by the application rather than the driver. • Since the application knows best about the importance of every resource it uses, Vulkan API allows for a better memory usage. Architecture • Unlike OpenGL, Vulkan fits the design of modern GPUs as it is not just onesingle state machine. This means Vulkan API was designed from the beginning to match the architecture of modern graphics cards. OpenGL however still matches the design of graphics cards from the time it was invented in the 1990s. • Vulkan is a fresh start, whereas OpenGL contains a myriad of hacks to support very rare use cases. • Vulkan has layers and extensions as part of its design. You can check for supported GPU plugins on the target machine and enable them as needed. • Vulkan API itself is completely platform agnostic. • Available on a variety of platforms: Windows, Linux, mobile devices and much more! • The ending of the OpenGL era has begun. • Vulkan is being developed through an unprecedented collaboration of major industry-leading companies. It is not being developed by one company only (like Microsoft’s DirectX for example). • As Vulkan’s motto states, it really is industry-forged. Consistency and standardization • Vulkan precompiles shaders to a standardized bytecode format called SPIR-V. This also reduces driver guesswork during runtime.

1.9. Frequently asked questions 181 Inexor Vulkan Renderer, Release v0.1-alpha.3

• The explicit design of Vulkan gives much deeper control and avoids driver guesswork and undefined behavior of graphics drivers. Debugging tools • Validation layers and diagnostics can be independently activated during development, allowing better error han- dling and debugging compared with OpenGL or DirectX. • Upon release builds, the validation layers can be turned off easily. • Vulkan API applications can be debugged with RenderDoc. • The Vulkan specification is very easy to read and it is the central guideline for how to use the API. Open Source • Vulkan API and some Vulkan graphics card drivers are open source.

1.9.10 Can you explain Vulkan API in simple terms?

• Vulkan API gives programmers much deeper control over the gamer’s hardware. • If applied correctly, Vulkan can result in a significant performance boost. • The API encourages the programmers to think in detail about graphics cards and their game engine. • It offers advanced optimization techniques which can result in a lower RAM and video memory usage. • Using Vulkan can yield in lower and more predictable CPU usage. • Vulkan allows programmers to make more effective use of multiple CPU cores.

1.9.11 How difficult is development with Vulkan API?

• This API does a lot of initialization during the loading phase of the application. • The key to success is a good abstraction of Vulkan API based on the needs of the application/game. • Vulkan is a C-style API. In simplified terms you fill out structures which start with Vk.. and submit them together with other parameters to vk... functions. That’s it. No complex interfaces. • Vulkan API has a very good documentation. • The challenges of Vulkan game/engine development boil down to basic programming challenges: abstraction, resource management and parallelization. • You may want to read Vulkan in 30 minutes by Baldur Karlsson.

182 Chapter 1. Documentation Inexor Vulkan Renderer, Release v0.1-alpha.3

1.9.12 Does my graphics card support Vulkan API?

• You can look up your graphics card in the Vulkan hardware database by Sascha Willems. • Every new graphics card which is coming out these days supports Vulkan API. • Vulkan is also supported on older graphics cards going back to Radeon HD 7000 series and Nvidia Geforce 6 series.

1.9.13 Will you support other rendering APIs?

• No, because testing for Vulkan already takes a lot of time and there is no sense in supporting deprecated tech- nology. • Some studios like id-software also dropped OpenGL entirely. • Vulkan API is the only low level multi platform graphics and compute API.

1.9.14 Which topics are currently not in focus of development?

• We are currently focusing on the renderer and Vulkan API. When the time has come, we will take parallelization into account. • A game engine needs other components besides rendering of course. However, we are currently not focusing on the following topics: networking, sound, physics, packaging of game engine resources and everything else which is not related to rendering. • We will not begin to support additional platforms besides Linux and Windows in the near future.

1.9. Frequently asked questions 183 Inexor Vulkan Renderer, Release v0.1-alpha.3

184 Chapter 1. Documentation INDEX

Symbols inexor::vulkan_renderer::Application::load_shaders --gpu (C++ function), 75 command line option, 11 inexor::vulkan_renderer::Application::load_textures --no-separate-data-queue (C++ function), 75 command line option, 11 inexor::vulkan_renderer::Application::load_toml_configuration_file --no-stats (C++ function), 75 command line option, 11 inexor::vulkan_renderer::Application::m_enable_validation_layers --no-validation (C++ member), 76 command line option, 11 inexor::vulkan_renderer::Application::m_fragment_shader_files --no-vk-debug-markers (C++ member), 76 command line option, 11 inexor::vulkan_renderer::Application::m_gltf_model_files --renderdoc (C++ member), 76 command line option, 11 inexor::vulkan_renderer::Application::m_input_data --vsync (C++ member), 76 command line option, 11 inexor::vulkan_renderer::Application::m_stop_on_validation_message (C++ member), 76 C inexor::vulkan_renderer::Application::m_texture_files C++ member command line option ( ), 76 inexor::vulkan_renderer::Application::m_vertex_shader_files --gpu , 11 (C++ member), 76 --no-separate-data-queue, 11 inexor::vulkan_renderer::Application::m_worlds --no-stats, 11 (C++ member), 76 --no-validation, 11 inexor::vulkan_renderer::Application::mouse_button_callback --no-vk-debug-markers, 11 (C++ function), 75 --renderdoc, 11 inexor::vulkan_renderer::Application::mouse_scroll_callback --vsync, 11 (C++ function), 75 I inexor::vulkan_renderer::Application::process_mouse_input (C++ function), 76 inexor::vulkan_renderer::Application (C++ inexor::vulkan_renderer::Application::run class), 74 (C++ function), 75 inexor::vulkan_renderer::Application::Applicationinexor::vulkan_renderer::Application::setup_vulkan_debug_callback (C++ function), 74 (C++ function), 75 inexor::vulkan_renderer::Application::check_application_specific_featuresinexor::vulkan_renderer::Application::setup_window_and_input_callbacks (C++ function), 76 (C++ function), 75 inexor::vulkan_renderer::Application::check_octree_collisionsinexor::vulkan_renderer::Application::update_imgui_overlay (C++ function), 76 (C++ function), 75 inexor::vulkan_renderer::Application::cursor_position_callbackinexor::vulkan_renderer::Application::update_uniform_buffers (C++ function), 74 (C++ function), 76 inexor::vulkan_renderer::Application::key_callback inexor::vulkan_renderer::BezierCurve (C++ (C++ function), 74 class), 76 inexor::vulkan_renderer::Application::load_octree_geometryinexor::vulkan_renderer::BezierCurve::add_input_point (C++ function), 75 (C++ function), 76

185 Inexor Vulkan Renderer, Release v0.1-alpha.3 inexor::vulkan_renderer::BezierCurve::bernstein_polynomialinexor::vulkan_renderer::BufferResource::m_vertex_attributes (C++ function), 77 (C++ member), 78 inexor::vulkan_renderer::BezierCurve::binomial_coefficientinexor::vulkan_renderer::BufferResource::set_element_size (C++ function), 77 (C++ function), 78 inexor::vulkan_renderer::BezierCurve::calculate_bezier_curveinexor::vulkan_renderer::BufferResource::upload_data (C++ function), 76 (C++ function), 78 inexor::vulkan_renderer::BezierCurve::calculate_point_on_curveinexor::vulkan_renderer::BufferUsage (C++ (C++ function), 77 enum), 152 inexor::vulkan_renderer::BezierCurve::clear inexor::vulkan_renderer::BufferUsage::INDEX_BUFFER (C++ function), 77 (C++ enumerator), 152 inexor::vulkan_renderer::BezierCurve::clear_inputinexor::vulkan_renderer::BufferUsage::VERTEX_BUFFER (C++ function), 77 (C++ enumerator), 152 inexor::vulkan_renderer::BezierCurve::clear_outputinexor::vulkan_renderer::Camera (C++ class), 79 (C++ function), 77 inexor::vulkan_renderer::Camera::aspect_ratio inexor::vulkan_renderer::BezierCurve::is_curve_generated(C++ function), 80 (C++ function), 77 inexor::vulkan_renderer::Camera::Camera inexor::vulkan_renderer::BezierCurve::m_curve_generated(C++ function), 79 (C++ member), 77 inexor::vulkan_renderer::Camera::change_zoom inexor::vulkan_renderer::BezierCurve::m_curve_precision(C++ function), 81 (C++ member), 77 inexor::vulkan_renderer::Camera::far_plane inexor::vulkan_renderer::BezierCurve::m_input_points (C++ function), 81 (C++ member), 77 inexor::vulkan_renderer::Camera::fov (C++ inexor::vulkan_renderer::BezierCurve::m_output_points function), 80 (C++ member), 77 inexor::vulkan_renderer::Camera::front (C++ inexor::vulkan_renderer::BezierCurve::output_points function), 80 (C++ function), 76 inexor::vulkan_renderer::Camera::is_moving inexor::vulkan_renderer::BezierInputPoint (C++ function), 81 (C++ struct), 64 inexor::vulkan_renderer::Camera::m_aspect_ratio inexor::vulkan_renderer::BezierInputPoint::pos (C++ member), 82 (C++ member), 64 inexor::vulkan_renderer::Camera::m_far_plane inexor::vulkan_renderer::BezierInputPoint::weight (C++ member), 83 (C++ member), 64 inexor::vulkan_renderer::Camera::m_fov (C++ inexor::vulkan_renderer::BezierOutputPoint member), 82 (C++ struct), 65 inexor::vulkan_renderer::Camera::m_fov_max inexor::vulkan_renderer::BezierOutputPoint::normal (C++ member), 82 (C++ member), 65 inexor::vulkan_renderer::Camera::m_fov_min inexor::vulkan_renderer::BezierOutputPoint::tangent (C++ member), 82 (C++ member), 65 inexor::vulkan_renderer::Camera::m_front inexor::vulkan_renderer::BufferResource (C++ member), 81 (C++ class), 78 inexor::vulkan_renderer::Camera::m_keys inexor::vulkan_renderer::BufferResource::add_vertex_attribute(C++ member), 83 (C++ function), 78 inexor::vulkan_renderer::Camera::m_mouse_sensitivity inexor::vulkan_renderer::BufferResource::BufferResource(C++ member), 82 (C++ function), 78 inexor::vulkan_renderer::Camera::m_movement_speed inexor::vulkan_renderer::BufferResource::m_data (C++ member), 82 (C++ member), 78 inexor::vulkan_renderer::Camera::m_near_plane inexor::vulkan_renderer::BufferResource::m_data_size (C++ member), 82 (C++ member), 78 inexor::vulkan_renderer::Camera::m_perspective_matrix inexor::vulkan_renderer::BufferResource::m_data_upload_needed(C++ member), 82 (C++ member), 78 inexor::vulkan_renderer::Camera::m_pitch inexor::vulkan_renderer::BufferResource::m_element_size(C++ member), 82 (C++ member), 78 inexor::vulkan_renderer::Camera::m_pitch_max inexor::vulkan_renderer::BufferResource::m_usage (C++ member), 82 (C++ member), 78 inexor::vulkan_renderer::Camera::m_pitch_min

186 Index Inexor Vulkan Renderer, Release v0.1-alpha.3

(C++ member), 82 (C++ function), 79 inexor::vulkan_renderer::Camera::m_position inexor::vulkan_renderer::Camera::set_rotation (C++ member), 81 (C++ function), 80 inexor::vulkan_renderer::Camera::m_right inexor::vulkan_renderer::Camera::set_rotation_speed (C++ member), 81 (C++ function), 80 inexor::vulkan_renderer::Camera::m_roll inexor::vulkan_renderer::Camera::set_type (C++ member), 82 (C++ function), 79 inexor::vulkan_renderer::Camera::m_rotation_speedinexor::vulkan_renderer::Camera::type (C++ (C++ member), 82 function), 79 inexor::vulkan_renderer::Camera::m_type inexor::vulkan_renderer::Camera::up (C++ (C++ member), 81 function), 80 inexor::vulkan_renderer::Camera::m_up (C++ inexor::vulkan_renderer::Camera::update member), 82 (C++ function), 81 inexor::vulkan_renderer::Camera::m_update_neededinexor::vulkan_renderer::Camera::update_matrices (C++ member), 83 (C++ function), 81 inexor::vulkan_renderer::Camera::m_view_matrixinexor::vulkan_renderer::Camera::update_vectors (C++ member), 82 (C++ function), 81 inexor::vulkan_renderer::Camera::m_world_up inexor::vulkan_renderer::Camera::view_matrix (C++ member), 82 (C++ function), 81 inexor::vulkan_renderer::Camera::m_yaw (C++ inexor::vulkan_renderer::Camera::yaw (C++ member), 82 function), 80 inexor::vulkan_renderer::Camera::m_zoom_step inexor::vulkan_renderer::CameraMovement (C++ member), 82 (C++ enum), 152 inexor::vulkan_renderer::Camera::movement_speedinexor::vulkan_renderer::CameraMovement::BACKWARD (C++ function), 80 (C++ enumerator), 152 inexor::vulkan_renderer::Camera::near_plane inexor::vulkan_renderer::CameraMovement::FORWARD (C++ function), 81 (C++ enumerator), 152 inexor::vulkan_renderer::Camera::perspective_matrixinexor::vulkan_renderer::CameraMovement::LEFT (C++ function), 81 (C++ enumerator), 152 inexor::vulkan_renderer::Camera::pitch (C++ inexor::vulkan_renderer::CameraMovement::RIGHT function), 80 (C++ enumerator), 152 inexor::vulkan_renderer::Camera::position inexor::vulkan_renderer::CameraType (C++ (C++ function), 79 enum), 153 inexor::vulkan_renderer::Camera::right (C++ inexor::vulkan_renderer::CameraType::LOOK_AT function), 80 (C++ enumerator), 153 inexor::vulkan_renderer::Camera::roll (C++ inexor::vulkan_renderer::directions::DEFAULT_FRONT function), 80 (C++ member), 161 inexor::vulkan_renderer::Camera::rotate inexor::vulkan_renderer::directions::DEFAULT_RIGHT (C++ function), 80 (C++ member), 161 inexor::vulkan_renderer::Camera::rotation inexor::vulkan_renderer::directions::DEFAULT_UP (C++ function), 80 (C++ member), 161 inexor::vulkan_renderer::Camera::rotation_speedinexor::vulkan_renderer::FPSCounter (C++ (C++ function), 80 class), 83 inexor::vulkan_renderer::Camera::set_aspect_ratioinexor::vulkan_renderer::FPSCounter::m_fps_update_interval (C++ function), 79 (C++ member), 83 inexor::vulkan_renderer::Camera::set_far_planeinexor::vulkan_renderer::FPSCounter::m_frames (C++ function), 81 (C++ member), 83 inexor::vulkan_renderer::Camera::set_movement_speedinexor::vulkan_renderer::FPSCounter::m_last_time (C++ function), 80 (C++ member), 83 inexor::vulkan_renderer::Camera::set_movement_stateinexor::vulkan_renderer::FPSCounter::update (C++ function), 79 (C++ function), 83 inexor::vulkan_renderer::Camera::set_near_planeinexor::vulkan_renderer::GraphicsStage (C++ (C++ function), 81 class), 84 inexor::vulkan_renderer::Camera::set_position inexor::vulkan_renderer::GraphicsStage::~GraphicsStage

Index 187 Inexor Vulkan Renderer, Release v0.1-alpha.3

(C++ function), 84 (C++ member), 86 inexor::vulkan_renderer::GraphicsStage::bind_bufferinexor::vulkan_renderer::ImGUIOverlay::m_vertex_data (C++ function), 84 (C++ member), 86 inexor::vulkan_renderer::GraphicsStage::GraphicsStageinexor::vulkan_renderer::ImGUIOverlay::m_vertex_shader (C++ function), 84 (C++ member), 86 inexor::vulkan_renderer::GraphicsStage::m_blend_attachmentinexor::vulkan_renderer::ImGUIOverlay::operator= (C++ member), 85 (C++ function), 85, 86 inexor::vulkan_renderer::GraphicsStage::m_buffer_bindingsinexor::vulkan_renderer::ImGUIOverlay::PushConstBlock (C++ member), 85 (C++ struct), 65, 86 inexor::vulkan_renderer::GraphicsStage::m_clears_screeninexor::vulkan_renderer::ImGUIOverlay::PushConstBlock::scale (C++ member), 85 (C++ member), 65, 86 inexor::vulkan_renderer::GraphicsStage::m_depth_testinexor::vulkan_renderer::ImGUIOverlay::PushConstBlock::translate (C++ member), 85 (C++ member), 65, 86 inexor::vulkan_renderer::GraphicsStage::m_depth_writeinexor::vulkan_renderer::ImGUIOverlay::scale (C++ member), 85 (C++ function), 86 inexor::vulkan_renderer::GraphicsStage::m_shadersinexor::vulkan_renderer::ImGUIOverlay::update (C++ member), 85 (C++ function), 86 inexor::vulkan_renderer::GraphicsStage::operator=inexor::vulkan_renderer::InexorException (C++ function), 84 (C++ class), 87 inexor::vulkan_renderer::GraphicsStage::set_blend_attachmentinexor::vulkan_renderer::input::KeyboardMouseInputData (C++ function), 84 (C++ class), 87 inexor::vulkan_renderer::GraphicsStage::set_clears_screeninexor::vulkan_renderer::input::KeyboardMouseInputData::~KeyboardMouseInputData (C++ function), 84 (C++ function), 87 inexor::vulkan_renderer::GraphicsStage::set_depth_optionsinexor::vulkan_renderer::input::KeyboardMouseInputData::calculate_cursor_position_delta (C++ function), 84 (C++ function), 89 inexor::vulkan_renderer::GraphicsStage::uses_shaderinexor::vulkan_renderer::input::KeyboardMouseInputData::get_cursor_pos (C++ function), 84 (C++ function), 89 inexor::vulkan_renderer::ImGUIOverlay (C++ inexor::vulkan_renderer::input::KeyboardMouseInputData::is_key_pressed class), 85 (C++ function), 88 inexor::vulkan_renderer::ImGUIOverlay::~ImGUIOverlayinexor::vulkan_renderer::input::KeyboardMouseInputData::is_mouse_button_pressed (C++ function), 85 (C++ function), 88 inexor::vulkan_renderer::ImGUIOverlay::ImGUIOverlayinexor::vulkan_renderer::input::KeyboardMouseInputData::KeyboardMouseInputData (C++ function), 85 (C++ function), 87 inexor::vulkan_renderer::ImGUIOverlay::m_descriptorinexor::vulkan_renderer::input::KeyboardMouseInputData::m_current_cursor_pos (C++ member), 86 (C++ member), 89 inexor::vulkan_renderer::ImGUIOverlay::m_deviceinexor::vulkan_renderer::input::KeyboardMouseInputData::m_input_mutex (C++ member), 86 (C++ member), 89 inexor::vulkan_renderer::ImGUIOverlay::m_fragment_shaderinexor::vulkan_renderer::input::KeyboardMouseInputData::m_keyboard_updated (C++ member), 86 (C++ member), 89 inexor::vulkan_renderer::ImGUIOverlay::m_imgui_textureinexor::vulkan_renderer::input::KeyboardMouseInputData::m_mouse_buttons_updated (C++ member), 86 (C++ member), 89 inexor::vulkan_renderer::ImGUIOverlay::m_index_bufferinexor::vulkan_renderer::input::KeyboardMouseInputData::m_pressed_keys (C++ member), 86 (C++ member), 89 inexor::vulkan_renderer::ImGUIOverlay::m_index_datainexor::vulkan_renderer::input::KeyboardMouseInputData::m_pressed_mouse_buttons (C++ member), 86 (C++ member), 89 inexor::vulkan_renderer::ImGUIOverlay::m_push_const_blockinexor::vulkan_renderer::input::KeyboardMouseInputData::m_previous_cursor_pos (C++ member), 86 (C++ member), 89 inexor::vulkan_renderer::ImGUIOverlay::m_scaleinexor::vulkan_renderer::input::KeyboardMouseInputData::operator= (C++ member), 86 (C++ function), 87 inexor::vulkan_renderer::ImGUIOverlay::m_stageinexor::vulkan_renderer::input::KeyboardMouseInputData::press_key (C++ member), 86 (C++ function), 87 inexor::vulkan_renderer::ImGUIOverlay::m_swapchaininexor::vulkan_renderer::input::KeyboardMouseInputData::press_mouse_button (C++ member), 86 (C++ function), 88 inexor::vulkan_renderer::ImGUIOverlay::m_vertex_bufferinexor::vulkan_renderer::input::KeyboardMouseInputData::release_key

188 Index Inexor Vulkan Renderer, Release v0.1-alpha.3

(C++ function), 87 (C++ function), 93 inexor::vulkan_renderer::input::KeyboardMouseInputData::release_mouse_buttoninexor::vulkan_renderer::io::OctreeParser (C++ function), 88 (C++ class), 93 inexor::vulkan_renderer::input::KeyboardMouseInputData::set_cursor_posinexor::vulkan_renderer::io::OctreeParser::deserialize (C++ function), 89 (C++ function), 93 inexor::vulkan_renderer::input::KeyboardMouseInputData::was_key_pressed_onceinexor::vulkan_renderer::io::OctreeParser::serialize (C++ function), 88 (C++ function), 93 inexor::vulkan_renderer::input::KeyboardMouseInputData::was_mouse_button_pressed_onceinexor::vulkan_renderer::MSAATarget (C++ (C++ function), 89 struct), 65 inexor::vulkan_renderer::io::ByteStream inexor::vulkan_renderer::MSAATarget::m_color (C++ class), 90 (C++ member), 66 inexor::vulkan_renderer::io::ByteStream::bufferinexor::vulkan_renderer::MSAATarget::m_depth (C++ function), 90 (C++ member), 66 inexor::vulkan_renderer::io::ByteStream::ByteStreaminexor::vulkan_renderer::OctreeGpuVertex (C++ function), 90 (C++ struct), 66 inexor::vulkan_renderer::io::ByteStream::m_bufferinexor::vulkan_renderer::OctreeGpuVertex::color (C++ member), 90 (C++ member), 66 inexor::vulkan_renderer::io::ByteStream::read_fileinexor::vulkan_renderer::OctreeGpuVertex::OctreeGpuVertex (C++ function), 90 (C++ function), 66 inexor::vulkan_renderer::io::ByteStream::size inexor::vulkan_renderer::OctreeGpuVertex::position (C++ function), 90 (C++ member), 66 inexor::vulkan_renderer::io::ByteStreamReader inexor::vulkan_renderer::operator== (C++ (C++ class), 91 function), 154 inexor::vulkan_renderer::io::ByteStreamReader::ByteStreamReaderinexor::vulkan_renderer::PhysicalBackBuffer (C++ function), 91 (C++ class), 94 inexor::vulkan_renderer::io::ByteStreamReader::check_endinexor::vulkan_renderer::PhysicalBackBuffer::~PhysicalBackBuffer (C++ function), 91 (C++ function), 94 inexor::vulkan_renderer::io::ByteStreamReader::m_iterinexor::vulkan_renderer::PhysicalBackBuffer::m_swapchain (C++ member), 91 (C++ member), 94 inexor::vulkan_renderer::io::ByteStreamReader::m_streaminexor::vulkan_renderer::PhysicalBackBuffer::operator= (C++ member), 91 (C++ function), 94 inexor::vulkan_renderer::io::ByteStreamReader::readinexor::vulkan_renderer::PhysicalBackBuffer::PhysicalBackBuffer (C++ function), 91 (C++ function), 94 inexor::vulkan_renderer::io::ByteStreamReader::remaininginexor::vulkan_renderer::PhysicalBuffer (C++ function), 91 (C++ class), 95 inexor::vulkan_renderer::io::ByteStreamReader::skipinexor::vulkan_renderer::PhysicalBuffer::~PhysicalBuffer (C++ function), 91 (C++ function), 95 inexor::vulkan_renderer::io::ByteStreamWriter inexor::vulkan_renderer::PhysicalBuffer::m_alloc_info (C++ class), 92 (C++ member), 95 inexor::vulkan_renderer::io::ByteStreamWriter::writeinexor::vulkan_renderer::PhysicalBuffer::m_buffer (C++ function), 92 (C++ member), 95 inexor::vulkan_renderer::io::IoException inexor::vulkan_renderer::PhysicalBuffer::operator= (C++ class), 92 (C++ function), 95 inexor::vulkan_renderer::io::NXOCParser inexor::vulkan_renderer::PhysicalBuffer::PhysicalBuffer (C++ class), 92 (C++ function), 95 inexor::vulkan_renderer::io::NXOCParser::deserializeinexor::vulkan_renderer::PhysicalGraphicsStage (C++ function), 93 (C++ class), 96 inexor::vulkan_renderer::io::NXOCParser::deserialize_implinexor::vulkan_renderer::PhysicalGraphicsStage::~PhysicalGraphicsStage (C++ function), 93 (C++ function), 96 inexor::vulkan_renderer::io::NXOCParser::LATEST_VERSIONinexor::vulkan_renderer::PhysicalGraphicsStage::m_framebuffers (C++ member), 93 (C++ member), 96 inexor::vulkan_renderer::io::NXOCParser::serializeinexor::vulkan_renderer::PhysicalGraphicsStage::m_render_pass (C++ function), 93 (C++ member), 96 inexor::vulkan_renderer::io::NXOCParser::serialize_implinexor::vulkan_renderer::PhysicalGraphicsStage::operator=

Index 189 Inexor Vulkan Renderer, Release v0.1-alpha.3

(C++ function), 96 (C++ function), 100 inexor::vulkan_renderer::PhysicalGraphicsStage::PhysicalGraphicsStageinexor::vulkan_renderer::RenderGraph::build_buffer (C++ function), 96 (C++ function), 101 inexor::vulkan_renderer::PhysicalImage (C++ inexor::vulkan_renderer::RenderGraph::build_graphics_pipeline class), 97 (C++ function), 101 inexor::vulkan_renderer::PhysicalImage::~PhysicalImageinexor::vulkan_renderer::RenderGraph::build_image (C++ function), 97 (C++ function), 101 inexor::vulkan_renderer::PhysicalImage::m_imageinexor::vulkan_renderer::RenderGraph::build_image_view (C++ member), 97 (C++ function), 101 inexor::vulkan_renderer::PhysicalImage::m_image_viewinexor::vulkan_renderer::RenderGraph::build_pipeline_layout (C++ member), 97 (C++ function), 101 inexor::vulkan_renderer::PhysicalImage::operator=inexor::vulkan_renderer::RenderGraph::build_render_pass (C++ function), 97 (C++ function), 101 inexor::vulkan_renderer::PhysicalImage::PhysicalImageinexor::vulkan_renderer::RenderGraph::compile (C++ function), 97 (C++ function), 100 inexor::vulkan_renderer::PhysicalResource inexor::vulkan_renderer::RenderGraph::m_buffer_resources (C++ class), 98 (C++ member), 101 inexor::vulkan_renderer::PhysicalResource::~PhysicalResourceinexor::vulkan_renderer::RenderGraph::m_command_pool (C++ function), 98 (C++ member), 101 inexor::vulkan_renderer::PhysicalResource::m_allocationinexor::vulkan_renderer::RenderGraph::m_device (C++ member), 99 (C++ member), 101 inexor::vulkan_renderer::PhysicalResource::m_allocatorinexor::vulkan_renderer::RenderGraph::m_log (C++ member), 99 (C++ member), 101 inexor::vulkan_renderer::PhysicalResource::m_deviceinexor::vulkan_renderer::RenderGraph::m_stage_stack (C++ member), 99 (C++ member), 101 inexor::vulkan_renderer::PhysicalResource::operator=inexor::vulkan_renderer::RenderGraph::m_stages (C++ function), 98 (C++ member), 101 inexor::vulkan_renderer::PhysicalResource::PhysicalResourceinexor::vulkan_renderer::RenderGraph::m_swapchain (C++ function), 98 (C++ member), 101 inexor::vulkan_renderer::PhysicalStage (C++ inexor::vulkan_renderer::RenderGraph::m_texture_resources class), 99 (C++ member), 101 inexor::vulkan_renderer::PhysicalStage::~PhysicalStageinexor::vulkan_renderer::RenderGraph::record_command_buffer (C++ function), 99 (C++ function), 101 inexor::vulkan_renderer::PhysicalStage::deviceinexor::vulkan_renderer::RenderGraph::render (C++ function), 100 (C++ function), 100 inexor::vulkan_renderer::PhysicalStage::m_command_buffersinexor::vulkan_renderer::RenderGraph::RenderGraph (C++ member), 100 (C++ function), 100 inexor::vulkan_renderer::PhysicalStage::m_deviceinexor::vulkan_renderer::RenderGraphObject (C++ member), 100 (C++ struct), 67 inexor::vulkan_renderer::PhysicalStage::m_finished_semaphoreinexor::vulkan_renderer::RenderGraphObject::~RenderGraphObject (C++ member), 100 (C++ function), 67 inexor::vulkan_renderer::PhysicalStage::m_pipelineinexor::vulkan_renderer::RenderGraphObject::as (C++ member), 100 (C++ function), 67 inexor::vulkan_renderer::PhysicalStage::m_pipeline_layoutinexor::vulkan_renderer::RenderGraphObject::operator= (C++ member), 100 (C++ function), 67 inexor::vulkan_renderer::PhysicalStage::operator=inexor::vulkan_renderer::RenderGraphObject::RenderGraphObject (C++ function), 99 (C++ function), 67 inexor::vulkan_renderer::PhysicalStage::PhysicalStageinexor::vulkan_renderer::RenderResource (C++ function), 99 (C++ class), 102 inexor::vulkan_renderer::PhysicalStage::pipeline_layoutinexor::vulkan_renderer::RenderResource::~RenderResource (C++ function), 99 (C++ function), 102 inexor::vulkan_renderer::RenderGraph (C++ inexor::vulkan_renderer::RenderResource::m_name class), 100 (C++ member), 103 inexor::vulkan_renderer::RenderGraph::add inexor::vulkan_renderer::RenderResource::m_physical

190 Index Inexor Vulkan Renderer, Release v0.1-alpha.3

(C++ member), 103 (C++ enumerator), 153 inexor::vulkan_renderer::RenderResource::operator=inexor::vulkan_renderer::TextureUsage::DEPTH_STENCIL_BUFFER (C++ function), 102 (C++ enumerator), 153 inexor::vulkan_renderer::RenderResource::RenderResourceinexor::vulkan_renderer::TextureUsage::NORMAL (C++ function), 102, 103 (C++ enumerator), 153 inexor::vulkan_renderer::RenderStage (C++ inexor::vulkan_renderer::TimeStep (C++ class), class), 103 106 inexor::vulkan_renderer::RenderStage::~RenderStageinexor::vulkan_renderer::TimeStep::m_initialisation_time (C++ function), 104 (C++ member), 106 inexor::vulkan_renderer::RenderStage::add_descriptor_layoutinexor::vulkan_renderer::TimeStep::m_last_time (C++ function), 104 (C++ member), 106 inexor::vulkan_renderer::RenderStage::add_push_constant_rangeinexor::vulkan_renderer::TimeStep::time_step (C++ function), 104 (C++ function), 106 inexor::vulkan_renderer::RenderStage::m_descriptor_layoutsinexor::vulkan_renderer::TimeStep::time_step_since_initialisation (C++ member), 104 (C++ function), 106 inexor::vulkan_renderer::RenderStage::m_name inexor::vulkan_renderer::TimeStep::TimeStep (C++ member), 104 (C++ function), 106 inexor::vulkan_renderer::RenderStage::m_physicalinexor::vulkan_renderer::tools::CommandLineArgumentParser (C++ member), 104 (C++ class), 106 inexor::vulkan_renderer::RenderStage::m_push_constant_rangesinexor::vulkan_renderer::tools::CommandLineArgumentParser::arg (C++ member), 105 (C++ function), 107 inexor::vulkan_renderer::RenderStage::m_reads inexor::vulkan_renderer::tools::CommandLineArgumentParser::m_accepted_args (C++ member), 104 (C++ member), 107 inexor::vulkan_renderer::RenderStage::m_writesinexor::vulkan_renderer::tools::CommandLineArgumentParser::m_parsed_arguments (C++ member), 104 (C++ member), 107 inexor::vulkan_renderer::RenderStage::operator=inexor::vulkan_renderer::tools::CommandLineArgumentParser::make_arg_template (C++ function), 104 (C++ function), 107 inexor::vulkan_renderer::RenderStage::reads_frominexor::vulkan_renderer::tools::CommandLineArgumentParser::parse_args (C++ function), 104 (C++ function), 107 inexor::vulkan_renderer::RenderStage::RenderStageinexor::vulkan_renderer::tools::CommandLineArgumentParser::parsed_arg_count (C++ function), 104 (C++ function), 107 inexor::vulkan_renderer::RenderStage::set_on_recordinexor::vulkan_renderer::tools::CommandLineArgumentTemplate (C++ function), 104 (C++ class), 108 inexor::vulkan_renderer::RenderStage::writes_toinexor::vulkan_renderer::tools::CommandLineArgumentTemplate::argument (C++ function), 104 (C++ function), 108 inexor::vulkan_renderer::SwapchainSettings inexor::vulkan_renderer::tools::CommandLineArgumentTemplate::CommandLineArgumentTemplate (C++ struct), 68 (C++ function), 108 inexor::vulkan_renderer::SwapchainSettings::swapchain_sizeinexor::vulkan_renderer::tools::CommandLineArgumentTemplate::m_argument (C++ member), 68 (C++ member), 108 inexor::vulkan_renderer::SwapchainSettings::window_sizeinexor::vulkan_renderer::tools::CommandLineArgumentTemplate::m_takes_values (C++ member), 68 (C++ member), 108 inexor::vulkan_renderer::TextureResource inexor::vulkan_renderer::tools::CommandLineArgumentTemplate::takes_values (C++ class), 105 (C++ function), 108 inexor::vulkan_renderer::TextureResource::m_formatinexor::vulkan_renderer::tools::CommandLineArgumentValue (C++ member), 105 (C++ class), 108 inexor::vulkan_renderer::TextureResource::m_usageinexor::vulkan_renderer::tools::CommandLineArgumentValue::as (C++ member), 105 (C++ function), 108 inexor::vulkan_renderer::TextureResource::set_formatinexor::vulkan_renderer::tools::CommandLineArgumentValue::CommandLineArgumentValue (C++ function), 105 (C++ function), 108 inexor::vulkan_renderer::TextureResource::TextureResourceinexor::vulkan_renderer::tools::CommandLineArgumentValue::m_value (C++ function), 105 (C++ member), 109 inexor::vulkan_renderer::TextureUsage (C++ inexor::vulkan_renderer::tools::File (C++ enum), 153 class), 109 inexor::vulkan_renderer::TextureUsage::BACK_BUFFERinexor::vulkan_renderer::tools::File::File

Index 191 Inexor Vulkan Renderer, Release v0.1-alpha.3

(C++ function), 109 (C++ function), 110 inexor::vulkan_renderer::tools::File::file_datainexor::vulkan_renderer::VulkanRenderer (C++ function), 109 (C++ class), 110 inexor::vulkan_renderer::tools::File::file_sizeinexor::vulkan_renderer::VulkanRenderer::~VulkanRenderer (C++ function), 109 (C++ function), 111 inexor::vulkan_renderer::tools::File::load_fileinexor::vulkan_renderer::VulkanRenderer::calculate_memory_budget (C++ function), 109 (C++ function), 111 inexor::vulkan_renderer::tools::File::m_file_datainexor::vulkan_renderer::VulkanRenderer::generate_octree_indices (C++ member), 109 (C++ function), 111 inexor::vulkan_renderer::tools::File::m_file_sizeinexor::vulkan_renderer::VulkanRenderer::m_back_buffer (C++ member), 109 (C++ member), 112 inexor::vulkan_renderer::UniformBufferObject inexor::vulkan_renderer::VulkanRenderer::m_camera (C++ struct), 68 (C++ member), 112 inexor::vulkan_renderer::UniformBufferObject::modelinexor::vulkan_renderer::VulkanRenderer::m_command_pool (C++ member), 68 (C++ member), 112 inexor::vulkan_renderer::UniformBufferObject::projinexor::vulkan_renderer::VulkanRenderer::m_debug_report_callback (C++ member), 68 (C++ member), 111 inexor::vulkan_renderer::UniformBufferObject::viewinexor::vulkan_renderer::VulkanRenderer::m_debug_report_callback_initialised (C++ member), 68 (C++ member), 111 inexor::vulkan_renderer::vk_tools::as_string inexor::vulkan_renderer::VulkanRenderer::m_descriptors (C++ function), 154 (C++ member), 112 inexor::vulkan_renderer::vk_tools::print_all_physical_devicesinexor::vulkan_renderer::VulkanRenderer::m_device (C++ function), 154 (C++ member), 112 inexor::vulkan_renderer::vk_tools::print_device_extensionsinexor::vulkan_renderer::VulkanRenderer::m_fps_counter (C++ function), 154 (C++ member), 112 inexor::vulkan_renderer::vk_tools::print_driver_vulkan_versioninexor::vulkan_renderer::VulkanRenderer::m_frame_finished_fence (C++ function), 155 (C++ member), 112 inexor::vulkan_renderer::vk_tools::print_instance_extensionsinexor::vulkan_renderer::VulkanRenderer::m_image_available_semaphore (C++ function), 155 (C++ member), 112 inexor::vulkan_renderer::vk_tools::print_instance_layersinexor::vulkan_renderer::VulkanRenderer::m_imgui_overlay (C++ function), 155 (C++ member), 112 inexor::vulkan_renderer::vk_tools::print_physical_device_featuresinexor::vulkan_renderer::VulkanRenderer::m_index_buffer (C++ function), 155 (C++ member), 112 inexor::vulkan_renderer::vk_tools::print_physical_device_infoinexor::vulkan_renderer::VulkanRenderer::m_instance (C++ function), 156 (C++ member), 112 inexor::vulkan_renderer::vk_tools::print_physical_device_limitsinexor::vulkan_renderer::VulkanRenderer::m_octree_indices (C++ function), 156 (C++ member), 112 inexor::vulkan_renderer::vk_tools::print_physical_device_memory_propertiesinexor::vulkan_renderer::VulkanRenderer::m_octree_vertices (C++ function), 156 (C++ member), 112 inexor::vulkan_renderer::vk_tools::print_physical_device_queue_familiesinexor::vulkan_renderer::VulkanRenderer::m_render_graph (C++ function), 156 (C++ member), 112 inexor::vulkan_renderer::vk_tools::print_physical_device_sparse_propertiesinexor::vulkan_renderer::VulkanRenderer::m_settings_decision_maker (C++ function), 157 (C++ member), 111 inexor::vulkan_renderer::vk_tools::print_presentation_modesinexor::vulkan_renderer::VulkanRenderer::m_shader_stages (C++ function), 157 (C++ member), 111 inexor::vulkan_renderer::vk_tools::print_supported_surface_formatsinexor::vulkan_renderer::VulkanRenderer::m_shaders (C++ function), 157 (C++ member), 112 inexor::vulkan_renderer::vk_tools::print_surface_capabilitiesinexor::vulkan_renderer::VulkanRenderer::m_stopwatch (C++ function), 158 (C++ member), 111 inexor::vulkan_renderer::vk_tools::result_to_descriptioninexor::vulkan_renderer::VulkanRenderer::m_surface (C++ function), 158 (C++ member), 112 inexor::vulkan_renderer::VulkanException inexor::vulkan_renderer::VulkanRenderer::m_swapchain (C++ class), 110 (C++ member), 112 inexor::vulkan_renderer::VulkanException::VulkanExceptioninexor::vulkan_renderer::VulkanRenderer::m_textures

192 Index Inexor Vulkan Renderer, Release v0.1-alpha.3

(C++ member), 112 (C++ function), 69 inexor::vulkan_renderer::VulkanRenderer::m_time_passedinexor::vulkan_renderer::VulkanSettingsDecisionMaker::image_transform (C++ member), 111 (C++ function), 70 inexor::vulkan_renderer::VulkanRenderer::m_time_stepinexor::vulkan_renderer::VulkanSettingsDecisionMaker::is_graphics_card_suitable (C++ member), 111 (C++ function), 69 inexor::vulkan_renderer::VulkanRenderer::m_uniform_buffersinexor::vulkan_renderer::VulkanSettingsDecisionMaker::rate_graphics_card (C++ member), 112 (C++ function), 69 inexor::vulkan_renderer::VulkanRenderer::m_vertex_bufferinexor::vulkan_renderer::VulkanSettingsDecisionMaker::swapchain_extent (C++ member), 112 (C++ function), 70 inexor::vulkan_renderer::VulkanRenderer::m_vsync_enabledinexor::vulkan_renderer::VulkanSettingsDecisionMaker::swapchain_image_count (C++ member), 112 (C++ function), 70 inexor::vulkan_renderer::VulkanRenderer::m_windowinexor::vulkan_renderer::VulkanSettingsDecisionMaker::swapchain_surface_color_format (C++ member), 112 (C++ function), 70 inexor::vulkan_renderer::VulkanRenderer::m_window_heightinexor::vulkan_renderer::world::create_random_world (C++ member), 112 (C++ function), 158 inexor::vulkan_renderer::VulkanRenderer::m_window_modeinexor::vulkan_renderer::world::Cube (C++ (C++ member), 112 class), 113 inexor::vulkan_renderer::VulkanRenderer::m_window_resizedinexor::vulkan_renderer::world::Cube::~Cube (C++ member), 111 (C++ function), 114 inexor::vulkan_renderer::VulkanRenderer::m_window_titleinexor::vulkan_renderer::world::Cube::bounding_box (C++ member), 112 (C++ function), 114 inexor::vulkan_renderer::VulkanRenderer::m_window_widthinexor::vulkan_renderer::world::Cube::center (C++ member), 112 (C++ function), 114 inexor::vulkan_renderer::VulkanRenderer::operator=inexor::vulkan_renderer::world::Cube::children (C++ function), 111 (C++ function), 114 inexor::vulkan_renderer::VulkanRenderer::recreate_swapchaininexor::vulkan_renderer::world::Cube::clone (C++ function), 111 (C++ function), 114 inexor::vulkan_renderer::VulkanRenderer::render_frameinexor::vulkan_renderer::world::Cube::count_geometry_cubes (C++ function), 111 (C++ function), 114 inexor::vulkan_renderer::VulkanRenderer::setup_render_graphinexor::vulkan_renderer::world::Cube::Cube (C++ function), 111 (C++ function), 114 inexor::vulkan_renderer::VulkanRenderer::VulkanRendererinexor::vulkan_renderer::world::Cube::EDGES (C++ function), 111 (C++ member), 116 inexor::vulkan_renderer::VulkanSettingsDecisionMakerinexor::vulkan_renderer::world::Cube::grid_level (C++ struct), 68 (C++ function), 114 inexor::vulkan_renderer::VulkanSettingsDecisionMaker::decide_present_modeinexor::vulkan_renderer::world::Cube::indent (C++ function), 71 (C++ function), 115 inexor::vulkan_renderer::VulkanSettingsDecisionMaker::find_any_data_transfer_queue_familyinexor::vulkan_renderer::world::Cube::indentations (C++ function), 72 (C++ function), 114 inexor::vulkan_renderer::VulkanSettingsDecisionMaker::find_composite_alpha_formatinexor::vulkan_renderer::world::Cube::invalidate_polygon_cache (C++ function), 70 (C++ function), 115 inexor::vulkan_renderer::VulkanSettingsDecisionMaker::find_depth_buffer_formatinexor::vulkan_renderer::world::Cube::is_root (C++ function), 72 (C++ function), 114 inexor::vulkan_renderer::VulkanSettingsDecisionMaker::find_distinct_data_transfer_queue_familyinexor::vulkan_renderer::world::Cube::m_children (C++ function), 72 (C++ member), 116 inexor::vulkan_renderer::VulkanSettingsDecisionMaker::find_graphics_queue_familyinexor::vulkan_renderer::world::Cube::m_indentations (C++ function), 71 (C++ member), 116 inexor::vulkan_renderer::VulkanSettingsDecisionMaker::find_presentation_queue_familyinexor::vulkan_renderer::world::Cube::m_index_in_parent (C++ function), 71 (C++ member), 116 inexor::vulkan_renderer::VulkanSettingsDecisionMaker::find_queue_family_for_both_graphics_and_presentationinexor::vulkan_renderer::world::Cube::m_parent (C++ function), 72 (C++ member), 116 inexor::vulkan_renderer::VulkanSettingsDecisionMaker::graphics_cardinexor::vulkan_renderer::world::Cube::m_polygon_cache (C++ function), 69 (C++ member), 116 inexor::vulkan_renderer::VulkanSettingsDecisionMaker::graphics_card_typeinexor::vulkan_renderer::world::Cube::m_polygon_cache_valid

Index 193 Inexor Vulkan Renderer, Release v0.1-alpha.3

(C++ member), 116 (C++ function), 114 inexor::vulkan_renderer::world::Cube::m_positioninexor::vulkan_renderer::world::Cube::size (C++ member), 116 (C++ function), 114 inexor::vulkan_renderer::world::Cube::m_size inexor::vulkan_renderer::world::Cube::SUB_CUBES (C++ member), 116 (C++ member), 116 inexor::vulkan_renderer::world::Cube::m_type inexor::vulkan_renderer::world::Cube::Type (C++ member), 116 (C++ enum), 113 inexor::vulkan_renderer::world::Cube::neighborinexor::vulkan_renderer::world::Cube::type (C++ function), 115 (C++ function), 114 inexor::vulkan_renderer::world::Cube::NeighborAxisinexor::vulkan_renderer::world::Cube::Type::EMPTY (C++ enum), 113 (C++ enumerator), 113 inexor::vulkan_renderer::world::Cube::NeighborAxis::Xinexor::vulkan_renderer::world::Cube::Type::NORMAL (C++ enumerator), 113 (C++ enumerator), 113 inexor::vulkan_renderer::world::Cube::NeighborAxis::Yinexor::vulkan_renderer::world::Cube::Type::OCTANT (C++ enumerator), 113 (C++ enumerator), 113 inexor::vulkan_renderer::world::Cube::NeighborAxis::Zinexor::vulkan_renderer::world::Cube::Type::SOLID (C++ enumerator), 113 (C++ enumerator), 113 inexor::vulkan_renderer::world::Cube::NeighborDirectioninexor::vulkan_renderer::world::Cube::update_polygon_cache (C++ enum), 113 (C++ function), 115 inexor::vulkan_renderer::world::Cube::NeighborDirection::NEGATIVEinexor::vulkan_renderer::world::Cube::vertices (C++ enumerator), 113 (C++ function), 116 inexor::vulkan_renderer::world::Cube::NeighborDirection::POSITIVEinexor::vulkan_renderer::world::Indentation (C++ enumerator), 113 (C++ class), 117 inexor::vulkan_renderer::world::Cube::operator=inexor::vulkan_renderer::world::Indentation::end (C++ function), 114 (C++ function), 118 inexor::vulkan_renderer::world::Cube::operator[]inexor::vulkan_renderer::world::Indentation::end_abs (C++ function), 114 (C++ function), 118 inexor::vulkan_renderer::world::Cube::polygonsinexor::vulkan_renderer::world::Indentation::indent_end (C++ function), 115 (C++ function), 118 inexor::vulkan_renderer::world::Cube::positioninexor::vulkan_renderer::world::Indentation::indent_start (C++ function), 114 (C++ function), 118 inexor::vulkan_renderer::world::Cube::remove_childreninexor::vulkan_renderer::world::Indentation::Indentation (C++ function), 116 (C++ function), 117 inexor::vulkan_renderer::world::Cube::root inexor::vulkan_renderer::world::Indentation::m_end (C++ function), 116 (C++ member), 118 inexor::vulkan_renderer::world::Cube::rotate inexor::vulkan_renderer::world::Indentation::m_start (C++ function), 115, 116 (C++ member), 118 inexor::vulkan_renderer::world::Cube::RotationAxisinexor::vulkan_renderer::world::Indentation::MAX (C++ struct), 73, 117 (C++ member), 118 inexor::vulkan_renderer::world::Cube::RotationAxis::ChildTypeinexor::vulkan_renderer::world::Indentation::mirror (C++ type), 73, 117 (C++ function), 118 inexor::vulkan_renderer::world::Cube::RotationAxis::EdgeTypeinexor::vulkan_renderer::world::Indentation::offset (C++ type), 73, 117 (C++ function), 118 inexor::vulkan_renderer::world::Cube::RotationAxis::Typeinexor::vulkan_renderer::world::Indentation::operator!= (C++ type), 73, 117 (C++ function), 117 inexor::vulkan_renderer::world::Cube::RotationAxis::Xinexor::vulkan_renderer::world::Indentation::operator== (C++ member), 73, 117 (C++ function), 117 inexor::vulkan_renderer::world::Cube::RotationAxis::Yinexor::vulkan_renderer::world::Indentation::set_end (C++ member), 73, 117 (C++ function), 118 inexor::vulkan_renderer::world::Cube::RotationAxis::Zinexor::vulkan_renderer::world::Indentation::set_start (C++ member), 73, 117 (C++ function), 118 inexor::vulkan_renderer::world::Cube::set_indentinexor::vulkan_renderer::world::Indentation::start (C++ function), 115 (C++ function), 118 inexor::vulkan_renderer::world::Cube::set_typeinexor::vulkan_renderer::world::Indentation::start_abs

194 Index Inexor Vulkan Renderer, Release v0.1-alpha.3

(C++ function), 118 (C++ function), 121 inexor::vulkan_renderer::world::Indentation::uidinexor::vulkan_renderer::wrapper::CommandBuffer::CommandBuffer (C++ function), 118 (C++ function), 120 inexor::vulkan_renderer::world::Polygon inexor::vulkan_renderer::wrapper::CommandBuffer::draw (C++ type), 161 (C++ function), 122 inexor::vulkan_renderer::world::PolygonCache inexor::vulkan_renderer::wrapper::CommandBuffer::draw_indexed (C++ type), 162 (C++ function), 122 inexor::vulkan_renderer::world::ray_box_collisioninexor::vulkan_renderer::wrapper::CommandBuffer::end (C++ function), 159 (C++ function), 121 inexor::vulkan_renderer::world::ray_cube_collision_checkinexor::vulkan_renderer::wrapper::CommandBuffer::end_render_pass (C++ function), 159 (C++ function), 122 inexor::vulkan_renderer::world::RayCubeCollisioninexor::vulkan_renderer::wrapper::CommandBuffer::get (C++ class), 119 (C++ function), 122 inexor::vulkan_renderer::world::RayCubeCollision::~RayCubeCollisioninexor::vulkan_renderer::wrapper::CommandBuffer::m_command_buffer (C++ function), 119 (C++ member), 122 inexor::vulkan_renderer::world::RayCubeCollision::cornerinexor::vulkan_renderer::wrapper::CommandBuffer::m_device (C++ function), 119 (C++ member), 122 inexor::vulkan_renderer::world::RayCubeCollision::cubeinexor::vulkan_renderer::wrapper::CommandBuffer::m_name (C++ function), 119 (C++ member), 122 inexor::vulkan_renderer::world::RayCubeCollision::edgeinexor::vulkan_renderer::wrapper::CommandBuffer::operator= (C++ function), 119 (C++ function), 120 inexor::vulkan_renderer::world::RayCubeCollision::faceinexor::vulkan_renderer::wrapper::CommandBuffer::ptr (C++ function), 119 (C++ function), 122 inexor::vulkan_renderer::world::RayCubeCollision::intersectioninexor::vulkan_renderer::wrapper::CommandBuffer::push_constants (C++ function), 119 (C++ function), 121 inexor::vulkan_renderer::world::RayCubeCollision::m_cubeinexor::vulkan_renderer::wrapper::CommandPool (C++ member), 120 (C++ class), 122 inexor::vulkan_renderer::world::RayCubeCollision::m_intersectioninexor::vulkan_renderer::wrapper::CommandPool::~CommandPool (C++ member), 120 (C++ function), 123 inexor::vulkan_renderer::world::RayCubeCollision::m_nearest_cornerinexor::vulkan_renderer::wrapper::CommandPool::CommandPool (C++ member), 120 (C++ function), 122, 123 inexor::vulkan_renderer::world::RayCubeCollision::m_nearest_edgeinexor::vulkan_renderer::wrapper::CommandPool::get (C++ member), 120 (C++ function), 123 inexor::vulkan_renderer::world::RayCubeCollision::m_selected_faceinexor::vulkan_renderer::wrapper::CommandPool::m_command_pool (C++ member), 120 (C++ member), 123 inexor::vulkan_renderer::world::RayCubeCollision::operator=inexor::vulkan_renderer::wrapper::CommandPool::m_device (C++ function), 119 (C++ member), 123 inexor::vulkan_renderer::world::RayCubeCollision::RayCubeCollisioninexor::vulkan_renderer::wrapper::CommandPool::operator= (C++ function), 119 (C++ function), 123 inexor::vulkan_renderer::wrapper::CommandBufferinexor::vulkan_renderer::wrapper::CommandPool::ptr (C++ class), 120 (C++ function), 123 inexor::vulkan_renderer::wrapper::CommandBuffer::~CommandBufferinexor::vulkan_renderer::wrapper::CpuTexture (C++ function), 120 (C++ class), 123 inexor::vulkan_renderer::wrapper::CommandBuffer::begininexor::vulkan_renderer::wrapper::CpuTexture::~CpuTexture (C++ function), 120 (C++ function), 124 inexor::vulkan_renderer::wrapper::CommandBuffer::begin_render_passinexor::vulkan_renderer::wrapper::CpuTexture::channels (C++ function), 121 (C++ function), 124 inexor::vulkan_renderer::wrapper::CommandBuffer::bind_descriptorinexor::vulkan_renderer::wrapper::CpuTexture::CpuTexture (C++ function), 121 (C++ function), 124 inexor::vulkan_renderer::wrapper::CommandBuffer::bind_graphics_pipelineinexor::vulkan_renderer::wrapper::CpuTexture::data (C++ function), 121 (C++ function), 124 inexor::vulkan_renderer::wrapper::CommandBuffer::bind_index_bufferinexor::vulkan_renderer::wrapper::CpuTexture::data_size (C++ function), 121 (C++ function), 124 inexor::vulkan_renderer::wrapper::CommandBuffer::bind_vertex_buffersinexor::vulkan_renderer::wrapper::CpuTexture::generate_error_texture_data

Index 195 Inexor Vulkan Renderer, Release v0.1-alpha.3

(C++ function), 124 (C++ function), 128 inexor::vulkan_renderer::wrapper::CpuTexture::heightinexor::vulkan_renderer::wrapper::Device::bind_debug_region (C++ function), 124 (C++ function), 129 inexor::vulkan_renderer::wrapper::CpuTexture::m_mip_levelsinexor::vulkan_renderer::wrapper::Device::Device (C++ member), 125 (C++ function), 127 inexor::vulkan_renderer::wrapper::CpuTexture::m_nameinexor::vulkan_renderer::wrapper::Device::device (C++ member), 125 (C++ function), 127 inexor::vulkan_renderer::wrapper::CpuTexture::m_texture_channelsinexor::vulkan_renderer::wrapper::Device::end_debug_region (C++ member), 125 (C++ function), 129 inexor::vulkan_renderer::wrapper::CpuTexture::m_texture_datainexor::vulkan_renderer::wrapper::Device::gpu_name (C++ member), 125 (C++ function), 128 inexor::vulkan_renderer::wrapper::CpuTexture::m_texture_heightinexor::vulkan_renderer::wrapper::Device::graphics_queue (C++ member), 125 (C++ function), 128 inexor::vulkan_renderer::wrapper::CpuTexture::m_texture_widthinexor::vulkan_renderer::wrapper::Device::graphics_queue_family_index (C++ member), 125 (C++ function), 128 inexor::vulkan_renderer::wrapper::CpuTexture::mip_levelsinexor::vulkan_renderer::wrapper::Device::insert_debug_marker (C++ function), 124 (C++ function), 129 inexor::vulkan_renderer::wrapper::CpuTexture::nameinexor::vulkan_renderer::wrapper::Device::is_extension_supported (C++ function), 124 (C++ function), 129 inexor::vulkan_renderer::wrapper::CpuTexture::operator=inexor::vulkan_renderer::wrapper::Device::is_presentation_supported (C++ function), 124 (C++ function), 129 inexor::vulkan_renderer::wrapper::CpuTexture::widthinexor::vulkan_renderer::wrapper::Device::is_swapchain_supported (C++ function), 124 (C++ function), 129 inexor::vulkan_renderer::wrapper::DescriptorBuilderinexor::vulkan_renderer::wrapper::Device::m_allocator (C++ class), 125 (C++ member), 130 inexor::vulkan_renderer::wrapper::DescriptorBuilder::~DescriptorBuilderinexor::vulkan_renderer::wrapper::Device::m_device (C++ function), 125 (C++ member), 130 inexor::vulkan_renderer::wrapper::DescriptorBuilder::add_combined_image_samplerinexor::vulkan_renderer::wrapper::Device::m_enable_vulkan_debug_markers (C++ function), 126 (C++ member), 130 inexor::vulkan_renderer::wrapper::DescriptorBuilder::add_uniform_bufferinexor::vulkan_renderer::wrapper::Device::m_gpu_name (C++ function), 125 (C++ member), 130 inexor::vulkan_renderer::wrapper::DescriptorBuilder::buildinexor::vulkan_renderer::wrapper::Device::m_graphics_card (C++ function), 126 (C++ member), 130 inexor::vulkan_renderer::wrapper::DescriptorBuilder::DescriptorBuilderinexor::vulkan_renderer::wrapper::Device::m_graphics_queue (C++ function), 125 (C++ member), 130 inexor::vulkan_renderer::wrapper::DescriptorBuilder::m_descriptor_buffer_infosinexor::vulkan_renderer::wrapper::Device::m_graphics_queue_family_index (C++ member), 126 (C++ member), 130 inexor::vulkan_renderer::wrapper::DescriptorBuilder::m_descriptor_image_infosinexor::vulkan_renderer::wrapper::Device::m_present_queue (C++ member), 126 (C++ member), 130 inexor::vulkan_renderer::wrapper::DescriptorBuilder::m_deviceinexor::vulkan_renderer::wrapper::Device::m_present_queue_family_index (C++ member), 126 (C++ member), 130 inexor::vulkan_renderer::wrapper::DescriptorBuilder::m_layout_bindingsinexor::vulkan_renderer::wrapper::Device::m_surface (C++ member), 126 (C++ member), 130 inexor::vulkan_renderer::wrapper::DescriptorBuilder::m_swapchain_image_countinexor::vulkan_renderer::wrapper::Device::m_transfer_queue (C++ member), 126 (C++ member), 130 inexor::vulkan_renderer::wrapper::DescriptorBuilder::m_write_setsinexor::vulkan_renderer::wrapper::Device::m_transfer_queue_family_index (C++ member), 126 (C++ member), 130 inexor::vulkan_renderer::wrapper::DescriptorBuilder::operator=inexor::vulkan_renderer::wrapper::Device::m_vk_cmd_debug_marker_begin (C++ function), 125 (C++ member), 130 inexor::vulkan_renderer::wrapper::Device inexor::vulkan_renderer::wrapper::Device::m_vk_cmd_debug_marker_end (C++ class), 127 (C++ member), 130 inexor::vulkan_renderer::wrapper::Device::~Deviceinexor::vulkan_renderer::wrapper::Device::m_vk_cmd_debug_marker_insert (C++ function), 127 (C++ member), 130 inexor::vulkan_renderer::wrapper::Device::allocatorinexor::vulkan_renderer::wrapper::Device::m_vk_debug_marker_set_object_name

196 Index Inexor Vulkan Renderer, Release v0.1-alpha.3

(C++ member), 130 (C++ member), 132 inexor::vulkan_renderer::wrapper::Device::m_vk_debug_marker_set_object_taginexor::vulkan_renderer::wrapper::Framebuffer::operator= (C++ member), 130 (C++ function), 132 inexor::vulkan_renderer::wrapper::Device::m_vk_set_debug_utils_object_nameinexor::vulkan_renderer::wrapper::GPUMemoryBuffer (C++ member), 130 (C++ class), 133 inexor::vulkan_renderer::wrapper::Device::operator=inexor::vulkan_renderer::wrapper::GPUMemoryBuffer::~GPUMemoryBuffer (C++ function), 127 (C++ function), 134 inexor::vulkan_renderer::wrapper::Device::physical_deviceinexor::vulkan_renderer::wrapper::GPUMemoryBuffer::allocation (C++ function), 127 (C++ function), 134 inexor::vulkan_renderer::wrapper::Device::present_queueinexor::vulkan_renderer::wrapper::GPUMemoryBuffer::allocation_create_info (C++ function), 128 (C++ function), 134 inexor::vulkan_renderer::wrapper::Device::present_queue_family_indexinexor::vulkan_renderer::wrapper::GPUMemoryBuffer::allocation_info (C++ function), 128 (C++ function), 134 inexor::vulkan_renderer::wrapper::Device::set_debug_marker_nameinexor::vulkan_renderer::wrapper::GPUMemoryBuffer::buffer (C++ function), 128 (C++ function), 134 inexor::vulkan_renderer::wrapper::Device::set_memory_block_attachmentinexor::vulkan_renderer::wrapper::GPUMemoryBuffer::GPUMemoryBuffer (C++ function), 128 (C++ function), 133, 134 inexor::vulkan_renderer::wrapper::Device::transfer_queueinexor::vulkan_renderer::wrapper::GPUMemoryBuffer::m_allocation (C++ function), 128 (C++ member), 134 inexor::vulkan_renderer::wrapper::Device::transfer_queue_family_indexinexor::vulkan_renderer::wrapper::GPUMemoryBuffer::m_allocation_ci (C++ function), 128 (C++ member), 134 inexor::vulkan_renderer::wrapper::Fence inexor::vulkan_renderer::wrapper::GPUMemoryBuffer::m_allocation_info (C++ class), 130 (C++ member), 134 inexor::vulkan_renderer::wrapper::Fence::~Fenceinexor::vulkan_renderer::wrapper::GPUMemoryBuffer::m_buffer (C++ function), 131 (C++ member), 134 inexor::vulkan_renderer::wrapper::Fence::blockinexor::vulkan_renderer::wrapper::GPUMemoryBuffer::m_buffer_size (C++ function), 131 (C++ member), 134 inexor::vulkan_renderer::wrapper::Fence::Fenceinexor::vulkan_renderer::wrapper::GPUMemoryBuffer::m_device (C++ function), 131 (C++ member), 134 inexor::vulkan_renderer::wrapper::Fence::get inexor::vulkan_renderer::wrapper::GPUMemoryBuffer::m_name (C++ function), 131 (C++ member), 134 inexor::vulkan_renderer::wrapper::Fence::m_deviceinexor::vulkan_renderer::wrapper::GPUMemoryBuffer::name (C++ member), 131 (C++ function), 134 inexor::vulkan_renderer::wrapper::Fence::m_fenceinexor::vulkan_renderer::wrapper::GPUMemoryBuffer::operator= (C++ member), 131 (C++ function), 134 inexor::vulkan_renderer::wrapper::Fence::m_nameinexor::vulkan_renderer::wrapper::GpuTexture (C++ member), 131 (C++ class), 135 inexor::vulkan_renderer::wrapper::Fence::operator=inexor::vulkan_renderer::wrapper::GpuTexture::~GpuTexture (C++ function), 131 (C++ function), 135 inexor::vulkan_renderer::wrapper::Fence::resetinexor::vulkan_renderer::wrapper::GpuTexture::create_texture (C++ function), 131 (C++ function), 136 inexor::vulkan_renderer::wrapper::Framebuffer inexor::vulkan_renderer::wrapper::GpuTexture::create_texture_sampler (C++ class), 132 (C++ function), 136 inexor::vulkan_renderer::wrapper::Framebuffer::~Framebufferinexor::vulkan_renderer::wrapper::GpuTexture::GpuTexture (C++ function), 132 (C++ function), 135 inexor::vulkan_renderer::wrapper::Framebuffer::Framebufferinexor::vulkan_renderer::wrapper::GpuTexture::image (C++ function), 132 (C++ function), 136 inexor::vulkan_renderer::wrapper::Framebuffer::getinexor::vulkan_renderer::wrapper::GpuTexture::image_view (C++ function), 132 (C++ function), 136 inexor::vulkan_renderer::wrapper::Framebuffer::m_deviceinexor::vulkan_renderer::wrapper::GpuTexture::m_copy_command_buffer (C++ member), 132 (C++ member), 136 inexor::vulkan_renderer::wrapper::Framebuffer::m_framebufferinexor::vulkan_renderer::wrapper::GpuTexture::m_device (C++ member), 132 (C++ member), 136 inexor::vulkan_renderer::wrapper::Framebuffer::m_nameinexor::vulkan_renderer::wrapper::GpuTexture::m_mip_levels

Index 197 Inexor Vulkan Renderer, Release v0.1-alpha.3

(C++ member), 136 (C++ function), 139 inexor::vulkan_renderer::wrapper::GpuTexture::m_nameinexor::vulkan_renderer::wrapper::Instance::Instance (C++ member), 136 (C++ function), 138, 139 inexor::vulkan_renderer::wrapper::GpuTexture::m_samplerinexor::vulkan_renderer::wrapper::Instance::instance (C++ member), 136 (C++ function), 139 inexor::vulkan_renderer::wrapper::GpuTexture::m_texture_channelsinexor::vulkan_renderer::wrapper::Instance::is_extension_supported (C++ member), 136 (C++ function), 139 inexor::vulkan_renderer::wrapper::GpuTexture::m_texture_heightinexor::vulkan_renderer::wrapper::Instance::is_layer_supported (C++ member), 136 (C++ function), 139 inexor::vulkan_renderer::wrapper::GpuTexture::m_texture_imageinexor::vulkan_renderer::wrapper::Instance::m_instance (C++ member), 136 (C++ member), 140 inexor::vulkan_renderer::wrapper::GpuTexture::m_texture_image_formatinexor::vulkan_renderer::wrapper::Instance::m_vk_api_version (C++ member), 136 (C++ member), 140 inexor::vulkan_renderer::wrapper::GpuTexture::m_texture_widthinexor::vulkan_renderer::wrapper::Instance::operator= (C++ member), 136 (C++ function), 139 inexor::vulkan_renderer::wrapper::GpuTexture::nameinexor::vulkan_renderer::wrapper::Instance::vulkan_api_version (C++ function), 136 (C++ function), 139 inexor::vulkan_renderer::wrapper::GpuTexture::operator=inexor::vulkan_renderer::wrapper::make_info (C++ function), 135, 136 (C++ function), 160 inexor::vulkan_renderer::wrapper::GpuTexture::samplerinexor::vulkan_renderer::wrapper::OnceCommandBuffer (C++ function), 136 (C++ class), 140 inexor::vulkan_renderer::wrapper::GpuTexture::transition_image_layoutinexor::vulkan_renderer::wrapper::OnceCommandBuffer::~OnceCommandBuffer (C++ function), 136 (C++ function), 140 inexor::vulkan_renderer::wrapper::Image inexor::vulkan_renderer::wrapper::OnceCommandBuffer::command_buffer (C++ class), 137 (C++ function), 141 inexor::vulkan_renderer::wrapper::Image::~Imageinexor::vulkan_renderer::wrapper::OnceCommandBuffer::create_command_buffer (C++ function), 137 (C++ function), 140 inexor::vulkan_renderer::wrapper::Image::get inexor::vulkan_renderer::wrapper::OnceCommandBuffer::end_recording_and_submit_command (C++ function), 137 (C++ function), 141 inexor::vulkan_renderer::wrapper::Image::Imageinexor::vulkan_renderer::wrapper::OnceCommandBuffer::m_command_buffer (C++ function), 137 (C++ member), 141 inexor::vulkan_renderer::wrapper::Image::image_formatinexor::vulkan_renderer::wrapper::OnceCommandBuffer::m_command_pool (C++ function), 137 (C++ member), 141 inexor::vulkan_renderer::wrapper::Image::image_viewinexor::vulkan_renderer::wrapper::OnceCommandBuffer::m_device (C++ function), 137 (C++ member), 141 inexor::vulkan_renderer::wrapper::Image::m_allocationinexor::vulkan_renderer::wrapper::OnceCommandBuffer::m_queue (C++ member), 138 (C++ member), 141 inexor::vulkan_renderer::wrapper::Image::m_allocation_infoinexor::vulkan_renderer::wrapper::OnceCommandBuffer::m_recording_started (C++ member), 138 (C++ member), 141 inexor::vulkan_renderer::wrapper::Image::m_deviceinexor::vulkan_renderer::wrapper::OnceCommandBuffer::OnceCommandBuffer (C++ member), 138 (C++ function), 140 inexor::vulkan_renderer::wrapper::Image::m_formatinexor::vulkan_renderer::wrapper::OnceCommandBuffer::operator= (C++ member), 138 (C++ function), 140 inexor::vulkan_renderer::wrapper::Image::m_imageinexor::vulkan_renderer::wrapper::OnceCommandBuffer::start_recording (C++ member), 138 (C++ function), 140 inexor::vulkan_renderer::wrapper::Image::m_image_viewinexor::vulkan_renderer::wrapper::ResourceDescriptor (C++ member), 138 (C++ class), 141 inexor::vulkan_renderer::wrapper::Image::m_nameinexor::vulkan_renderer::wrapper::ResourceDescriptor::~ResourceDescriptor (C++ member), 138 (C++ function), 141 inexor::vulkan_renderer::wrapper::Image::operator=inexor::vulkan_renderer::wrapper::ResourceDescriptor::descriptor_set_layout (C++ function), 137 (C++ function), 142 inexor::vulkan_renderer::wrapper::Instance inexor::vulkan_renderer::wrapper::ResourceDescriptor::descriptor_set_layout_bindings (C++ class), 138 (C++ function), 142 inexor::vulkan_renderer::wrapper::Instance::~Instanceinexor::vulkan_renderer::wrapper::ResourceDescriptor::descriptor_sets

198 Index Inexor Vulkan Renderer, Release v0.1-alpha.3

(C++ function), 142 (C++ member), 144 inexor::vulkan_renderer::wrapper::ResourceDescriptor::m_descriptor_poolinexor::vulkan_renderer::wrapper::Shader::module (C++ member), 142 (C++ function), 144 inexor::vulkan_renderer::wrapper::ResourceDescriptor::m_descriptor_set_layoutinexor::vulkan_renderer::wrapper::Shader::name (C++ member), 142 (C++ function), 144 inexor::vulkan_renderer::wrapper::ResourceDescriptor::m_descriptor_set_layout_bindingsinexor::vulkan_renderer::wrapper::Shader::operator= (C++ member), 142 (C++ function), 144 inexor::vulkan_renderer::wrapper::ResourceDescriptor::m_descriptor_setsinexor::vulkan_renderer::wrapper::Shader::Shader (C++ member), 142 (C++ function), 143, 144 inexor::vulkan_renderer::wrapper::ResourceDescriptor::m_deviceinexor::vulkan_renderer::wrapper::Shader::type (C++ member), 142 (C++ function), 144 inexor::vulkan_renderer::wrapper::ResourceDescriptor::m_nameinexor::vulkan_renderer::wrapper::StagingBuffer (C++ member), 142 (C++ class), 145 inexor::vulkan_renderer::wrapper::ResourceDescriptor::m_swapchain_image_countinexor::vulkan_renderer::wrapper::StagingBuffer::~StagingBuffer (C++ member), 142 (C++ function), 145 inexor::vulkan_renderer::wrapper::ResourceDescriptor::m_write_descriptor_setsinexor::vulkan_renderer::wrapper::StagingBuffer::m_command_buffer_for_copying (C++ member), 142 (C++ member), 146 inexor::vulkan_renderer::wrapper::ResourceDescriptor::operator=inexor::vulkan_renderer::wrapper::StagingBuffer::m_device (C++ function), 141, 142 (C++ member), 146 inexor::vulkan_renderer::wrapper::ResourceDescriptor::ResourceDescriptorinexor::vulkan_renderer::wrapper::StagingBuffer::operator= (C++ function), 141 (C++ function), 145 inexor::vulkan_renderer::wrapper::Semaphore inexor::vulkan_renderer::wrapper::StagingBuffer::StagingBuffer (C++ class), 142 (C++ function), 145 inexor::vulkan_renderer::wrapper::Semaphore::~Semaphoreinexor::vulkan_renderer::wrapper::StagingBuffer::upload_data_to_gpu (C++ function), 143 (C++ function), 145 inexor::vulkan_renderer::wrapper::Semaphore::getinexor::vulkan_renderer::wrapper::Swapchain (C++ function), 143 (C++ class), 146 inexor::vulkan_renderer::wrapper::Semaphore::m_deviceinexor::vulkan_renderer::wrapper::Swapchain::~Swapchain (C++ member), 143 (C++ function), 146 inexor::vulkan_renderer::wrapper::Semaphore::m_nameinexor::vulkan_renderer::wrapper::Swapchain::acquire_next_image (C++ member), 143 (C++ function), 146 inexor::vulkan_renderer::wrapper::Semaphore::m_semaphoreinexor::vulkan_renderer::wrapper::Swapchain::extent (C++ member), 143 (C++ function), 147 inexor::vulkan_renderer::wrapper::Semaphore::operator=inexor::vulkan_renderer::wrapper::Swapchain::image_count (C++ function), 143 (C++ function), 147 inexor::vulkan_renderer::wrapper::Semaphore::ptrinexor::vulkan_renderer::wrapper::Swapchain::image_format (C++ function), 143 (C++ function), 147 inexor::vulkan_renderer::wrapper::Semaphore::Semaphoreinexor::vulkan_renderer::wrapper::Swapchain::image_view (C++ function), 142 (C++ function), 147 inexor::vulkan_renderer::wrapper::Shader inexor::vulkan_renderer::wrapper::Swapchain::image_views (C++ class), 143 (C++ function), 147 inexor::vulkan_renderer::wrapper::Shader::~Shaderinexor::vulkan_renderer::wrapper::Swapchain::m_device (C++ function), 144 (C++ member), 147 inexor::vulkan_renderer::wrapper::Shader::entry_pointinexor::vulkan_renderer::wrapper::Swapchain::m_extent (C++ function), 144 (C++ member), 147 inexor::vulkan_renderer::wrapper::Shader::m_deviceinexor::vulkan_renderer::wrapper::Swapchain::m_name (C++ member), 144 (C++ member), 147 inexor::vulkan_renderer::wrapper::Shader::m_entry_pointinexor::vulkan_renderer::wrapper::Swapchain::m_surface (C++ member), 144 (C++ member), 147 inexor::vulkan_renderer::wrapper::Shader::m_nameinexor::vulkan_renderer::wrapper::Swapchain::m_surface_format (C++ member), 144 (C++ member), 147 inexor::vulkan_renderer::wrapper::Shader::m_shader_moduleinexor::vulkan_renderer::wrapper::Swapchain::m_swapchain (C++ member), 144 (C++ member), 147 inexor::vulkan_renderer::wrapper::Shader::m_typeinexor::vulkan_renderer::wrapper::Swapchain::m_swapchain_image_count

Index 199 Inexor Vulkan Renderer, Release v0.1-alpha.3

(C++ member), 147 (C++ enumerator), 149 inexor::vulkan_renderer::wrapper::Swapchain::m_swapchain_image_viewsinexor::vulkan_renderer::wrapper::Window::operator= (C++ member), 147 (C++ function), 149, 150 inexor::vulkan_renderer::wrapper::Swapchain::m_swapchain_imagesinexor::vulkan_renderer::wrapper::Window::poll (C++ member), 147 (C++ function), 151 inexor::vulkan_renderer::wrapper::Swapchain::m_vsync_enabledinexor::vulkan_renderer::wrapper::Window::set_cursor_position_callback (C++ member), 148 (C++ function), 150 inexor::vulkan_renderer::wrapper::Swapchain::operator=inexor::vulkan_renderer::wrapper::Window::set_keyboard_button_callback (C++ function), 146 (C++ function), 150 inexor::vulkan_renderer::wrapper::Swapchain::recreateinexor::vulkan_renderer::wrapper::Window::set_mouse_button_callback (C++ function), 146 (C++ function), 150 inexor::vulkan_renderer::wrapper::Swapchain::setup_swapchaininexor::vulkan_renderer::wrapper::Window::set_mouse_scroll_callback (C++ function), 147 (C++ function), 150 inexor::vulkan_renderer::wrapper::Swapchain::Swapchaininexor::vulkan_renderer::wrapper::Window::set_resize_callback (C++ function), 146 (C++ function), 150 inexor::vulkan_renderer::wrapper::Swapchain::swapchaininexor::vulkan_renderer::wrapper::Window::set_title (C++ function), 147 (C++ function), 150 inexor::vulkan_renderer::wrapper::Swapchain::swapchain_ptrinexor::vulkan_renderer::wrapper::Window::set_user_ptr (C++ function), 147 (C++ function), 150 inexor::vulkan_renderer::wrapper::UniformBufferinexor::vulkan_renderer::wrapper::Window::should_close (C++ class), 148 (C++ function), 150 inexor::vulkan_renderer::wrapper::UniformBuffer::~UniformBufferinexor::vulkan_renderer::wrapper::Window::show (C++ function), 148 (C++ function), 150 inexor::vulkan_renderer::wrapper::UniformBuffer::operator=inexor::vulkan_renderer::wrapper::Window::wait_for_focus (C++ function), 148 (C++ function), 150 inexor::vulkan_renderer::wrapper::UniformBuffer::UniformBufferinexor::vulkan_renderer::wrapper::Window::width (C++ function), 148 (C++ function), 150 inexor::vulkan_renderer::wrapper::UniformBuffer::updateinexor::vulkan_renderer::wrapper::Window::Window (C++ function), 148 (C++ function), 149 inexor::vulkan_renderer::wrapper::Window inexor::vulkan_renderer::wrapper::WindowSurface (C++ class), 149 (C++ class), 151 inexor::vulkan_renderer::wrapper::Window::~Windowinexor::vulkan_renderer::wrapper::WindowSurface::~WindowSurface (C++ function), 149 (C++ function), 151 inexor::vulkan_renderer::wrapper::Window::get inexor::vulkan_renderer::wrapper::WindowSurface::get (C++ function), 150 (C++ function), 151 inexor::vulkan_renderer::wrapper::Window::heightinexor::vulkan_renderer::wrapper::WindowSurface::m_instance (C++ function), 150 (C++ member), 152 inexor::vulkan_renderer::wrapper::Window::m_heightinexor::vulkan_renderer::wrapper::WindowSurface::m_surface (C++ member), 151 (C++ member), 152 inexor::vulkan_renderer::wrapper::Window::m_modeinexor::vulkan_renderer::wrapper::WindowSurface::operator= (C++ member), 151 (C++ function), 151 inexor::vulkan_renderer::wrapper::Window::m_widthinexor::vulkan_renderer::wrapper::WindowSurface::WindowSurface (C++ member), 151 (C++ function), 151 inexor::vulkan_renderer::wrapper::Window::m_window (C++ member), 151 S inexor::vulkan_renderer::wrapper::Window::Modestd::hash (C++ enum), 149 (C++ struct), 74 inexor::vulkan_renderer::wrapper::Window::modestd::hash::operator() (C++ function), 150 (C++ function), 74 inexor::vulkan_renderer::wrapper::Window::Mode::FULLSCREENswap (C++ function), 116, 160 (C++ enumerator), 149 inexor::vulkan_renderer::wrapper::Window::Mode::WINDOWED (C++ enumerator), 149 inexor::vulkan_renderer::wrapper::Window::Mode::WINDOWED_FULLSCREEN

200 Index