Commit graph

47 commits

Author SHA1 Message Date
spencer-lunarg
551221d913 formats: Handle SRGB correction 2025-03-31 18:20:22 -04:00
Charles Giessen
0d5b49b80f formats: vkuGetFormatInfo to use array
Puts the contents of a switch in a big array, then rewrites
vkuGetFormatInfo() to index into it based on the formats enum value.

This was done because the switch statement was large enough that
compilers wouldn't inline the function, leading to performance bubbles.

The logic for generating the logic of vkuGetFormatInfo is complex but
boils down to finding the groups of consecutive VkFormats, where the
end of a group has a value that is more than 1 away from the next format
value.

To follow C const initializer rules, VKU_FORMAT_COMPRESSED_COMPONENT
had to be turned into a macro.
2025-03-26 08:00:39 -06:00
spencer-lunarg
bc3a4d9fd9 scripts: Remove Protect workaround 2025-03-07 17:34:40 -05:00
spencer-lunarg
50563f4836 format: Fix DepthStencil to Color compatible check 2025-03-05 23:36:42 -05:00
spencer-lunarg
6be00ca9f5 scripts: Manual VK_ENABLE_BETA_EXTENSIONS 2025-02-22 06:19:00 -07:00
spencer-lunarg
42b34ac73e scripts: Use new VulkanObject from headers 2025-02-21 15:01:59 -05:00
Mike Schuchardt
fe7a09b138 build: Update to header 1.4.307 2025-01-30 16:58:56 -08:00
spencer-lunarg
1ddbe6c40a scripts: Sync up base generator and vulkan object 2025-01-27 09:09:41 -07:00
spencer-lunarg
f07e27717a formats: Add vkuFormatTexelsPerBlock 2025-01-21 13:24:57 -05:00
spencer-lunarg
9cf0d32399 formats: Add vkuFormatTexelBlockSize 2025-01-21 12:56:19 -05:00
spencer-lunarg
4923254936 formats: Add vkuFormatIsDepthStencilWithColorSizeCompatible 2025-01-21 12:52:31 -05:00
spencer-lunarg
249718532d formats: Remove vkuFormatElementIsTexel 2025-01-20 15:00:04 -05:00
spencer-lunarg
2fe3a7791d format: Add note for Multi-planar 2025-01-15 12:29:45 -05:00
Takuto Ikuta
2b185cfb53 Update safe_struct_generator.py 2024-12-18 10:46:30 -06:00
Mike Schuchardt
5a72ae0208 build: Update to header 1.4.303 2024-12-03 09:53:15 -08:00
spencer-lunarg
a71907b857 build: Update to header 1.3.296 2024-09-26 11:14:40 -04:00
sjfricke
ea5774a13e safe: Fix VK_EXT_sample_locations 2024-09-09 14:51:36 -07:00
Mike Schuchardt
fbb4db92c6 safestruct: Add VkPipelineCreatInfoKHR workaround
Pipeline create info structs can appear in the VkPipelineCreatInfoKHR
pNext chain even though they don't extend that structure in the
traditional sense.
2024-09-02 11:53:44 -07:00
Arno
9479047902 safestruct: Accessors for non trivial globals
Adding Tracy in VVL showed that we are paying the price of initializing
global variables upon shared library entry, even if we do not
end up accessing those.
Adding accessors will make sure we pay this price
only when truly needed.
Also making the necessary changes in VVL.
2024-07-17 09:32:38 -05:00
Charles Giessen
144ce1b3c1 Better declare GetObjectType()'s lack of 32 bit support
Create a new default specialization for 32 bit which indicates to the
user that the GetObjectType() helper does not work in 32 bit builds.
2024-06-27 11:01:38 -05:00
Jeremy Gebben
07759f0479 safe_struct: Make FreePnextChain() non-recursive 2024-06-10 10:50:44 -06:00
spencer-lunarg
8d8986262d safestruct: Remove safe_VkDescriptorDataEXT 2024-04-25 15:17:01 +09:00
ziga-lunarg
d0ffc68fe7 Revert "safestruct: Remove safe_VkDescriptorDataEXT"
This reverts commit 1135918c96.
2024-04-21 06:04:38 +09:00
Aaron Ruby
72696f2782 safestruct: Add QNX platform types to abstract_types list 2024-04-11 16:57:41 -05:00
spencer-lunarg
1135918c96 safestruct: Remove safe_VkDescriptorDataEXT 2024-04-11 00:28:48 +09:00
Jeremy Gebben
cdd0e00cff Move vk_safe_struct to VUL
This code was being generated in both Vulkan-ValidationLayers
and Vulkan-ExtensionLayer. Further uses are on the horizon so
lets stop the copypasta.

Also, add functions to manipulate extension lists and pNext chains,
since many client layers have been doing that themselves.
2024-03-28 11:11:35 -06:00
spencer-lunarg
822dd7f3a6 scripts: Add struct extension re-lookup in base generator 2024-01-25 10:54:14 -07:00
spencer-lunarg
fce11d52fe scripts: Sync base_generator.py 2023-12-29 09:23:16 -07:00
Juan Ramos
678ce607a0 ci: Add clang-format to CI
This also removes the extra .clang-format in the include directory

closes #78
2023-11-10 14:36:43 -07:00
Charles Giessen
dcfce25b43 Remove consecutive platform defines
Generated code must macro-guard platform specific code, but did it in a
naive fashion where consecutive guards for the same platform repeated the
macro. With the help of PlatformGuardHelper, the code generation will elide
redundant macro guards.
2023-10-18 18:44:30 -06:00
Charles Giessen
85f06aeb61 util: Fix vku::GetObjectType() broken for 32 bit builds
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.
2023-10-05 11:47:23 -06:00
Daniel Rakos
859486391c build: API parameterization 2023-10-05 10:45:51 -06:00
Mike Schuchardt
f528b23aec Make GetObjectType specializations inline
Avoid multiple definition compiler error
2023-10-04 13:53:48 -07:00
unknown
beadc7e034 Fix base_generator vendorTags logic
The logic didn't correctly iterate through the children of tags,
causing the vendorTags list to be generated incorrectly.
2023-10-04 11:41:20 -06:00
unknown
cf011e717a Add GetObjectType helper to struct_helper
This utility converst Vulkan handle types to VkObjectType enums, which is used
by the debug utils set name & tag functions.
2023-10-04 11:41:20 -06:00
Juan Ramos
2169a0849e Fix doc for vkuFormatIsXChromaSubsampled
Now the documentation matches the implementation.
2023-10-01 14:49:40 -06:00
James Price
d3e6eb65dd Remove extra semicolon after member definition
Some compilers complain about this.
2023-09-21 15:28:08 -06:00
unknown
6774c9b24b util: Add vk_struct_helper.hpp
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
2023-09-19 10:10:31 -06:00
Juan Ramos
1c6d92cccf Use vku prefix for vk_dispatch_table.h interface 2023-09-13 16:49:54 -06:00
unknown
c903525915 src: Add vk_format_utils.h to UtilityHeaders
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
2023-09-11 12:48:03 -06:00
unknown
b0712dfdb1 headers: Fix dispatch table formatting
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.
2023-08-25 14:35:36 -06:00
Charles Giessen
2bd0e0d438 util: Fixup and add Dispatch Table header
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.
2023-08-23 15:07:01 -06:00
Juan Ramos
8ea7803544 Remove clang-tidy comments from vk_enum_string_helper.h
Not needed. They only made sense in the context of VVL.
2023-08-23 12:31:35 -06:00
Juan Ramos
02d552db0c tests: Ensure vk_enum_string_helper.h is C compatible
Added ifdef checks for backcompat

Intended to properly address these issue(s):
- https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/3233
- https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/1211
2023-08-22 15:13:44 -06:00
Juan Ramos
6999ef9b82 Add testing for vk_enum_string_helper.h
Use magic_enum to test vk_enum_string_helper.h

closes #46
2023-08-16 09:45:31 -06:00
Juan Ramos
93ceaff579 Add REUSE to CI
Ensures proper copyright for the repo
2023-07-25 16:11:18 -06:00
spencer-lunarg
d8719df037 scripts: Add initial codegen scripts 2023-07-17 09:54:09 -06:00