Skip to content

Commit

Permalink
[Release] Feature/0.4.0 (#198)
Browse files Browse the repository at this point in the history
* multiview working on Vulkan, but not on dx

* Proof of not working stuff

* top shader

* finally working multiview

* Feature/x11 (#200)

* added x11 support

* minor change

* Restyled Feature/x11 (#201)

* Restyled by clang-format

* Restyled by cmake-format

---------

Co-authored-by: Restyled.io <[email protected]>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <[email protected]>

* Feature/sdl (#202)

* factored out a lot of code

made sdl3 the default example window system

* revamped swapchain on vulkan side

added multiview example

* removed unnecessary build targets

* revisited lut example

removed old ones
examples are finished, moving to the next tasks

* agility sdk fix

* updated readme

* Restyled Feature/sdl (#203)

* Restyled by astyle

* Restyled by clang-format

* Restyled by cmake-format

* Restyled by prettier-markdown

* Restyled by whitespace

---------

Co-authored-by: Restyled.io <[email protected]>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <[email protected]>

* fixes for linux platform

* Bindless descriptor tables (#204)

* step 1: create mock of bindless desctiptor tables

* moved descriptor buffer to an extension

added descriptor storage for bindless resources
reserved place for root descriptors

* Restyled Bindless descriptor tables (#205)

* Restyled by astyle

* Restyled by clang-format

* Restyled by cmake-format

* Restyled by prettier-markdown

* Restyled by whitespace

---------

Co-authored-by: Restyled.io <[email protected]>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <[email protected]>

* fixed build for linux

* rootsig for dx only impl

* DXIL overlap problem solved (through bruteforce though)

* Added push descriptor support

Added space overlaps

* fixed bindings for push descriptor

* why did I use update after bind?

* made inline array of render targets

* const correctness for structures

* fixed multiview not working with depth

* com_ptr again, fixed texture replacement resulting in leak
added non-uniform root signature creation

* fixed textures copy to and from buffer not taking into account offsets

* feature bump

* tested on Vulkan

* Restyled Feature/0.4.0 (#199)

* Restyled by astyle

* Restyled by clang-format

* Restyled by cmake-format

* Restyled by prettier-markdown

* Restyled by whitespace

---------

Co-authored-by: Restyled.io <[email protected]>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
3 people authored Nov 26, 2024
1 parent 6cdd204 commit 3231853
Show file tree
Hide file tree
Showing 181 changed files with 7,478 additions and 41,456 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ FodyWeavers.xsd
/CMakeSettings.json
*.idb
.vscode/settings.json
/wisdom/include/wisdom/vulkan/gen/generate_functions.bat

/**/gen/generate_functions.bat
#restyler
*.orig
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

cmake_minimum_required(VERSION 3.22)

set(WISDOM_VERSION "0.3.15")
set(WISDOM_VERSION "0.4.0")
project("Wisdom" VERSION ${WISDOM_VERSION})

set(CMAKE_DEBUG_POSTFIX d)
Expand All @@ -43,7 +43,6 @@ if(WISDOM_BUILD_BINDINGS)
add_subdirectory("bindings")
endif()
if(WISDOM_BUILD_EXAMPLES)
option(WISDOM_EXCLUDE_KDGUI "Exclude KDGui Example from build" ON)
add_subdirectory("examples")
endif()

Expand Down
40 changes: 0 additions & 40 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,37 +73,6 @@
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "x64-debug-vk",
"displayName": "x64 Debug Vk",
"description": "Target Windows (64-bit) with the Visual Studio development environment. (Debug)",
"inherits": "windows-base",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"WISDOM_FORCE_VULKAN": true
}
},
{
"name": "x64-debug-winrt",
"displayName": "x64 Debug UWP",
"description": "Target Windows (64-bit) with the Visual Studio development environment. (Debug)",
"inherits": "windows-base",
"generator": "Visual Studio 17 2022",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"WISDOM_BUILD_TYPE": "headers",
"CMAKE_SYSTEM_NAME": "WindowsStore",
"CMAKE_SYSTEM_VERSION": "10.0"
}
},
{
"name": "x64-release",
"displayName": "x64 Release",
Expand All @@ -113,15 +82,6 @@
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "x64-release-vk",
"displayName": "x64 Release Vk",
"description": "Target Windows (64-bit) with the Visual Studio development environment. (RelWithDebInfo)",
"inherits": "x64-debug-vk",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "x64-only-lib",
"displayName": "x64 Lib",
Expand Down
20 changes: 20 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Version History

- 0.4.0 Major Update

- Fixed Vulkan Swapchain on resize occasionally result in error messages
- Revisited Examples and made them use SDL3 for window creation
- Added common library for examples
- Added Multiview support with example
- Examples are now stored in examples/bin folder with compiled shaders and resources
- Added support for Xlib without XCB for Vulkan
- Moved DescriptorBuffer to its own extension. It is now only possible to use if both VK_EXT_mutable_descriptor_type and VK_EXT_descritpor_buffer are enabled
- Added support for VK_EXT_descriptor_indexing and created DescriptorStorage for bindless descriptors. This is now the default way of creating descriptor tables
- Lifted the restriction of mandatory VK_EXT_mutable_descriptor_type and VK_EXT_descritpor_buffer for Vulkan. It is now possible to use Wisdom with Vulkan 1.2 (with other mandatory extensions of course)
- Renamed RootConstants to PushConstants because it is more common name
- Added support for push descriptors. Maximum number of push descriptors is 8 for now.
- Added new CreateRootSignature method for DX12 and Vulkan. It is now possible to create a root signatures with non-uniform spacing.

- Bugfixes:

- Fixed textures not being destroyed correctly in DX12 on replacement (texture1 = std::move(texture2)) was resulting in leaks)
- Fixed DX12 copy texture not working correctly with offsets

- 0.3.15

- Fixed Vulkan default texture barriers
Expand Down
65 changes: 31 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![CMake Windows](https://github.com/Agrael1/Wisdom/actions/workflows/cmake.yml/badge.svg)

**Low-level Direct Translation header only Graphics API. Easy to learn, easy to extend, highly performant, multiplatform!**
**Low-level Direct Translation Graphics API. Easy to learn, easy to extend, highly performant, multiplatform!**

## NuGet Link

Expand All @@ -11,20 +11,21 @@ https://www.nuget.org/packages/Wisdom/
# Why?

A lot of old OpenGL solutions are scratching the ceiling of OpenGL potential, and Vulkan is too low-level for most of the tasks. DirectX 12 is a good alternative, but it's not cross-platform.
Wisdom is designed to be a direct translation layer on top of DirectX 12 and Vulkan, with a simple API, that is easy to learn and extend. It's designed to be used in games, simulations, and other heavy computations.
It's not designed to be a rendering engine, but a tool to create one.
Wisdom is designed to be a direct translation layer on top of DirectX 12 and Vulkan, with a simple API, that is easy to learn and extend.
It is still low level, yet more user friendly. It uses a lot of advanced graphics features, like Descriptor Buffer and Direct GPU Upload.

The library is designed to be used in a modern C++20 environment, with a lot of modern C++ features, like concepts, modules, and ranges. It's designed to be used with CMake or NuGet, and it's easy to integrate with your project.
It is also using the fine selection of features from the underlying APIs to provide the best performance possible with wide range of freedom and be future proof.
You can use it even partially, for example initialize device and swapchain, get internals of library objects and use it with your own rendering engine, or use it fully, with all the extensions and features.

Library transparency makes it a good choice for gradual API replacement. This is further enhanced by the interoperability with other APIs through platform extensions.

# Details

The API is structured like this:

- The basic types are defined, depending on platform of choice. They are **Factory**, **Adapter**, **Device** etc. They are directly implemented, this eliminates memory indirection and potential cache misses.
- The the platform is selected the most suitable to the system: Windows - DirectX 12, MacOS - Metal **[TBD]**
- You can override the platform selection with `WISDOM_FORCE_VULKAN` option on CMake configuration. This will force the library to use Vulkan as a base API. This is useful for debugging Vulkan extensions.
- All calls are done directly, without usage of interfaces/virtual functions. This eliminates call indirection and the projection is direct as if you wrote the code directly inside your functions.
- The platform selects the most suitable implemetation to the system: Windows - DirectX 12, Linux - Vulkan. This is done in compile time.
- You can override the implementation selection with `WISDOM_FORCE_VULKAN` option on CMake configuration. This will force the library to use Vulkan as a base API. This is useful for debugging Vulkan extensions.
- All calls are done directly, without usage of interfaces/virtual functions. This eliminates call indirection and the code is inlined as if you wrote the code directly inside your functions.
- Underlying accessibility, all of the internals are accessible using `GetInternal()` and can be used to bridge functionality or to create extensions. All the internal state is immutable for the stability of work between library and extensions. However it's not advised to use internal state directly, since it is platform dependent.

Vulkan is compiled on compatible systems and used as default only if there is no other alternative. Vulkan can still be used under supported operating system with explicit types `wis::VKFactory`, `wis::VKDevice` etc.
Expand All @@ -36,14 +37,18 @@ Vulkan is compiled on compatible systems and used as default only if there is no
Supported platforms are:

- Windows API (Win32) - DirectX 12 and Vulkan
- Windows Store (UWP) - Microsoft Store certified applications. DirectX 12 only.
- Linux (X11 and Wayland) - Vulkan only
- Windows Store (UWP) - Microsoft Store applications. DirectX 12 only.
- Linux (X11, XCB and Wayland) - Vulkan only

# Build

This is a CMake project, all the plugins are ensured to download beforehand, so it's enough to just configure the project, everything is going to be downloaded with respect to platform.
The later reconfigurations are not reloading the plugins for easy expansion of the library, but if the plugin reload is required, the cache deletion should be done, or change `PLUGINS_LOADED` CMakeCache entry to `FALSE`.

The library does not contain any extra dependencies, except for the ones required by the underlying APIs, such as DX12 Agility SDK and memory allocators.

If you don't have Vulkan SDK installed on Windows the library will still provide you with DX12 implementation, that comes with Windows system. No administrative rights are required to build or use the library.

# CMake Options

- `WISDOM_LOG_LEVEL=debug/warn` set the log level for the library, values are `debug,trace,info,warn,error,critical` log calls under current level are not compiled
Expand All @@ -64,6 +69,13 @@ There is also a NuPkg available for NuGet consumption in release artifacts.

To link library simply use `target_link_libraries(${YOUR_TARGET} PUBLIC wis::wisdom)`. Alternatively if you wish for header only target, there is also `target_link_libraries(${YOUR_TARGET} PUBLIC wis::wisdom-headers)`.

Available targets are:

- `wis::wisdom` - functional library
- `wis::debug` - debug extension
- `wis::extended-allocation` - extended allocation extension (direct GPU Upload)
- `wis::platform` - platform specific extensions (Swapchain and Interop exports)

# System Requirements

**Windows:**
Expand All @@ -72,30 +84,25 @@ To link library simply use `target_link_libraries(${YOUR_TARGET} PUBLIC wis::wis
- CMake 3.22+

Tested on MSVC v143, Visual Studio 2022.
Video card must support DirectX 12.0+ and Enchanced Barriers.
Video card must support DirectX 12.1+ and Enchanced Barriers.

for Vulkan:

- Vulkan 1.3.2xx+

Tested on Windows with NVIDIA GeForce GTX 1070 and Linux with RTX A4000 with latest drivers.

**Windows Store:**
Functionality is tested on NVIDIA GeForce GTX 1070 and RTX A4000 with latest drivers. AMD cards were tested, but with limited functionality.

To Compile for Windows Store with CMake, the following is required:
Best performance is achieved with NVIDIA cards later than GTX 1650 series, because of the descriptor buffer support.

- CMakeSettings: `-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 -DCMAKE_BUILD_TYPE=Debug/Release/RelWithDebInfo/MinSizeRel`
- Windows 10 SDK 10.0.19041.0+
- Visual Studio Generator, tested on Visual Studio 2022 (v143) - Ninja generator is not supported
- Installed UWP SDK
Tested on Windows with NVIDIA GeForce GTX 1070 and Linux with RTX A4000 with latest drivers.

To launch a project find generated .sln in build `out/build/{BuildName}/examples/hello-triangle-winrt` folder and launch it with Visual Studio. This is due to deployment requirements of UWP applications, which is performed with Visual Studio.
**Windows Store:**

Or you can install a NuGet package to any Visual studio project.
You can install a NuGet package to any Visual studio project.

After the first launch, the project can be launched from the Start Menu.

This type of project does not support Vulkan, since Vulkan does not have UWP surface.
This type of project does not support Vulkan, since Vulkan does not have UWP surface, but the API is the same as for any other platform. Useful when you want to deploy your application to Microsoft Store without too much code rewriting.

**Linux**

Expand All @@ -104,25 +111,15 @@ This type of project does not support Vulkan, since Vulkan does not have UWP sur

Video card driver should have Descriptor buffer support. Tested on NVIDIA RTX A4000.

KDUils for the example need some packages to be installed:
`sudo apt install libxkbcommon-dev libxcb-xkb-dev libxkbcommon-x11-dev wayland-scanner++ wayland-protocols`

Visit https://github.com/KDAB/KDUtils to see more details.
Alternatively you can disable the example with `WISDOM_EXCLUDE_KDGUI=ON` option.

**MacOS**

- TBD... When I get my hands on a Mac

# Roadmap

The project has Gitub projects enabled, so you can see the progress on the project.
For the roadmap, the following features are planned:

- [ ] SDL2 integration
- [x] SDL3 examples
- [ ] UWP example
- [ ] Elaborate documentation
- [ ] C API generation
- [x] C API generation
- [ ] Debugging tools
- [ ] Small game engine
- [x] Lower CMake version requirement to 3.22
Loading

0 comments on commit 3231853

Please sign in to comment.