Non Dispatchable handles are not typed in 32 bit builds, so the
vku::GetObjectHandle() helper fails to compile. The solution is to just
not define the helper in 32 bit builds.
Move the vk_typemap_helper.h file in Vulkan-ValidationLayers over to this
repo with a different name to reflect the use of it
Changes from that include:
* Rename the functions to be more obvious as to what they do
* Placing them in the `vku` namespace
* Adding the `InitStructHelper` class which deduces the type based on the
variable that is being initialized
* Compiler error if there is no corresponding sType
The library originates from Vulkan-ValidationLayers, but is being moved
into this repo to make it easier for others to use it.
The library has also been modified to be header only and C compatible,
which allows more developers to be able to use it. This does require some
changes, but only affects the vkuFormatElementSize and vkuFormatTexelSize
functions which used default parameters. Two new functions,
vkuFormatElementSizeWithAspect and vkuFormatTexelSizeWithAspect have been
added to handle the non-default image aspect case (the default was COLOR_BIT).
Renaming was done using the following convention:
* public header files begin with `vk_`
* enums begin with VKU_FORMAT_
* functions begin with vku
CI will fail now if we ship a .h / .hpp file that doesn't use
the correct prefix.
I also documented the precedent for this prefix and the existing
integration testing.
The code did not follow the provided clang-format file, which causes
conflict when a developer runs clang-format on the repo. This commit fixes
the generator so that the output is what clang-format would generate.
One issue is that clang-format's ColumnLimit will wrap long lines, and is
very difficult to replicate in python code without excessive changes. The
chosen solution is to use a custom clang-format file for the Utilities
folder which ignores the ColumnLimit.
Fixes the vk_layer_dispatch_table.h header file so that they can be used
in other projects. The contents of this header and
vk_dispatch_table_helper.h have been moved into a new header
vul_dispatch_table.h.
The structs VulDeviceDispatchTable and VulInstanceDispatchTable
struct contain function pointers for the device and instance, respectively.
The functions vul_init_device_dispatch_table and
vul_init_instance_dispatch_table fill out the aforementioned structs,
making the task of setting up the disptach table in a layer much simpler.
Pulling in latest changes from VVL
Use BUILD_TESTS instead of VUL_TESTS. While it's good practice to
prefix variable names it makes updating this code more difficult.
Also since tests can only ever be enabled if the project is top
level, it doesn't affect add_subdirectory users.
Other misc. CMake cleanup
Allows build options specific to Vulkan-Utility-Libraries to be
easily grouped via cmake-gui.
This approach is also nicer for users who consume the library via
add_subdirectory or FetchContent since it more obvious what
settings are being ovverriden.
Remove UTILITY_LIBRARIES_CPP_STANDARD since we don't have a
reason to support multiple CPP standards.
Set testing to OFF by default to make consuming the library easier
for users and package managers.