Skip to content

Commit

Permalink
Add support of noexcept-path for vk::raii classes
Browse files Browse the repository at this point in the history
  • Loading branch information
asuessenbach committed Dec 4, 2023
1 parent e621db0 commit 26a50d4
Show file tree
Hide file tree
Showing 24 changed files with 9,758 additions and 8,151 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/ci-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ jobs:
strategy:
matrix:
build_type: [Debug, Release]
compiler:
- {cxx: "g++-9", c: "gcc-9"}
- {cxx: "g++-10", c: "gcc-10"}
- {cxx: "g++-11", c: "gcc-11"}
- {cxx: "clang++-13", c: "clang-13"}
- {cxx: "clang++-14", c: "clang-14"}
compiler: [g++-9, g++-10, g++-11, clang++-13, clang++-14]
cxx_standard: [11, 14, 17, 20, 23]

steps:
Expand All @@ -42,8 +37,7 @@ jobs:
-DVULKAN_HPP_TESTS_BUILD_ONLY_DYNAMIC=ON
-DVULKAN_HPP_TESTS_BUILD_WITH_LOCAL_VULKAN_HPP=ON
-DVULKAN_HPP_RUN_GENERATOR=ON
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler}}
-DCMAKE_CXX_STANDARD=${{matrix.cxx_standard}}
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
architecture: [x86, x64]
build_type: [Debug, Release]
cxx_standard: [11, 14, 17, 20, 23]

steps:
- uses: actions/checkout@v4
with:
Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ function( vulkan_hpp__setup_library )
vulkan_hpp__setup_platform( NAME ${TARGET_NAME} )
vulkan_hpp__setup_vulkan_include( NAME ${TARGET_NAME} )
vulkan_hpp__setup_warning_level( NAME ${TARGET_NAME} )
set_target_properties( ${TARGET_NAME} PROPERTIES CXX_STANDARD 11 )
set_target_properties( ${TARGET_NAME} PROPERTIES CXX_STANDARD_REQUIRED ON )
set_target_properties( ${TARGET_NAME} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON )
endif()
set_target_properties( ${TARGET_NAME} PROPERTIES FOLDER ${TARGET_FOLDER} )
endfunction()
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,10 @@ This either selects the dynamic (when it's 1) or the static (when it's not 1) Di

By default, a little helper class ```DynamicLoader``` is used to dynamically load the vulkan library. If you set it to something different than 1 before including vulkan.hpp, this helper is not available, and you need to explicitly provide your own loader type for the function ```DispatchLoaderDynamic::init()```.

#### VULKAN_HPP_EXPECTED

When this is not externally defined and VULKAN_HPP_CPP_VERSION is at least 23, VULKAN_HPP_EXPECTED is defined to be std::expected, and VULKAN_HPP_UNEXPECTED is defined to be std::unexpected.

#### VULKAN_HPP_FLAGS_MASK_TYPE_AS_PUBLIC

By default, the member ```m_mask``` of the ```Flags``` template class is private. This is to prevent accidentally setting a ```Flags``` with some inappropriate value. But it also prevents using a ```Flags```, or a structure holding a ```Flags```, to be used as a non-type template parameter. If you really need that functionality, and accept the reduced security, you can use this define to change the access specifier for m_mask from private to public, which allows using a ```Flags``` as a non-type template parameter.
Expand Down Expand Up @@ -889,6 +893,10 @@ By defining ```VULKAN_HPP_NO_SMART_HANDLE``` before including vulkan.hpp, the he

With C++20, the so-called spaceship-operator ```<=>``` is introduced. If that operator is supported, all the structs and classes in vulkan.hpp use the default implementation of it. As currently some implementations of this operator are very slow, and others seem to be incomplete, by defining ```VULKAN_HPP_NO_SPACESHIP_OPERATOR``` before including vulkan.hpp you can remove that operator from those structs and classes.

#### VULKAN_HPP_RAII_NO_EXCEPTIONS

If both, VULKAN_HPP_NO_EXCEPTIONS and VULKAN_HPP_EXPECTED are defined, the vk::raii-classes don't throw exceptions. That is, the actual constructors are not available, but the creation-functions must be used. For more details have a look at the vk_raii_ProgrammingGuide.md.

#### VULKAN_HPP_STORAGE_API

With this define you can specify whether the ```DispatchLoaderDynamic``` is imported or exported (see ```VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE```). If ```VULKAN_HPP_STORAGE_API``` is not defined externally, and ```VULKAN_HPP_STORAGE_SHARED``` is defined, depending on the ```VULKAN_HPP_STORAGE_SHARED_EXPORT``` being defined, ```VULKAN_HPP_STORAGE_API``` is either set to ```__declspec( dllexport )``` (for MSVC) / ```__attribute__( ( visibility( "default" ) ) )``` (for gcc or clang) or ```__declspec( dllimport )``` (for MSVC), respectively. For other compilers, you might specify the corresponding storage by defining ```VULKAN_HPP_STORAGE_API``` on your own.
Expand All @@ -897,6 +905,10 @@ With this define you can specify whether the ```DispatchLoaderDynamic``` is impo

32-bit vulkan is not typesafe for non-dispatchable handles, so we don't allow copy constructors on this platform by default. To enable this feature on 32-bit platforms define ```VULKAN_HPP_TYPESAFE_CONVERSION```.

#### VULKAN_HPP_UNEXPECTED

See ```VULKAN_HPP_EXPECTED```.

#### VULKAN_HPP_USE_REFLECT

With this define you can include a reflection mechanism on the vk-structures. It adds a function ```reflect``` that returns a tuple-version of the structure. That tuple then could easily be iterated. But at least for now, that feature takes lots of compile-time resources, so currently it is recommended to enable that feature only if you're willing to pay that price.
Expand Down
Loading

0 comments on commit 26a50d4

Please sign in to comment.