QhenkiX is my personal C++20 library for 3D software creation. It consists mainly of a render hardware interface (RHI) that abstracts graphics operations across multiple graphics APIs. Currently Direct3D 12 and Direct3D 11 are supported, with future plans to support Vulkan. It aims to serve as a base for a game project while providing a way for me to experiment with graphics techniques and different graphics APIs.
You can find the most recent interface (context.h
) and related structures in the RHI folder. API specific implementations live here.
As a very brief summary, here are some notable current features and design choices:
- D3D12 and D3D11 graphics backend
- Interface designed to target/resemble D3D12
- Finer grained synchronization based off D3D12 enhanced barriers
- Support for runtime shader compliation
- Automatic selection between FXC and DXC depending on desired Shader Model
- Reflection for automatic input assembly parameters
- SXC standalone shader compiler
- Command-line tool for batch compilation of shaders with configuration files
- Support for shader permutations with different defines and optimization levels
- Parallel compilation pipeline with dependency tracking for incremental builds
- Separate resource binding models for "modern" and "compatibility" graphics backends
- Modern interface resembles D3D12 binding model which allows for flexible and performant binding patterns such as bindless descriptors
- Compatibility interface allows for simple binding of resources to slots with minimal additional code
- Some math utilities
- ImGui integration
See the examples for use cases of the library.
-
Clone the repository.
git clone https://github.com/AaronTian-stack/QhenkiX.git
-
Generate build files using CMake. Example:
cd QhenkiX mkdir build cd build cmake ..
-
Build the project:
cmake --build . --config Release
Or open the generated Visual Studio solution (
QhenkiX-Workspace.sln
) and build from there. -
To use QhenkiX in your own project, you have several options:
- Using CMake: Add QhenkiX as a subdirectory in your CMakeLists.txt:
add_subdirectory(path/to/QhenkiX/QhenkiX) target_link_libraries(your_target PRIVATE QhenkiX)
- Using Visual Studio: Add the QhenkiX project as a reference to your solution and link against the generated static library.
- Using CMake: Add QhenkiX as a subdirectory in your CMakeLists.txt:
-
Extend the Application class and start writing your graphics code. See the examples.
QhenkiX is built as a static library (.lib
).
When using CMake, simply link against the QhenkiX target:
target_link_libraries(your_target PRIVATE QhenkiX)
If you are creating a project using QhenkiX in Visual Studio, you can add QhenkiX as a reference (right click Project -> Add -> Reference) if they are in the same solution.
QhenkiX requires the below .dll
s to run. When using CMake, the examples automatically copy the required DLLs to the output directory.
Required DLLs:
dxcompiler.dll
- compile SM 5.1+ shaders programmaticallydxil.dll
- validate/sign shaders generated with DXCSDL3.dll
- windowing and input
This project relies on the following dependencies and build tools:
Build Requirements:
- CMake 3.18 or higher
Third-party Libraries:
- Boost - (Boost Software License 1.0)
- D3D12MemAllocator - (MIT License)
- robin-map - (MIT License)
- DXC (DirectX Shader Compiler) - (MIT License)
- SDL3 - (zlib License)
- DirectXTex - (MIT License)
- Dear ImGui - (MIT License)
- utf8 - (Boost Software License 1.0)
- magic_enum - (MIT License)
This project is mostly made for my own use and will be frequently subject to large breaking changes, so there is not any documentation currently besides certain select functions. However I will eventually create a wiki of some sort and also explain my design choices in detail...
- FXC depends on
d3dcompiler_47.dll
which is not included with this library. This is included with the Windows SDK and that specific version is used byD3DCompileFromFile
. I will eventually bundle a specific version of the DLL with the library. - It should be possible to run the D3D11 backend on Windows 7 or 8, I just need to refactor (bundling D3D12 headers with the library directly) and maybe add a special compile macro.
A list of useful references I found during the creation of this project.
This project is licensed under the MIT license.