Initial YUV and external memory support (#1467)

* vulkano: image: improve formatting

Ran cargo fmt --all.  Should we use clippy too ?

* vk_sys: add additional formats

This updates the vk formats enum to the header that's on my
system (vk 1.2-ish).

* vulkano: image: Add NV12 and YV12 support

These formats are commonly used as targets for hardware and
software video decode.  The common case is the swapchain allocator
(gralloc in the Android use case) allocates some memory, the video
stack decodes to it, and then memory can be composited by Vulkan
or sent directly to the display.

* vk_sys: update structure types

This updates the structure types to a VK 1.2-ish state.  Long term,
it makes a ton of sense to autogenerate vk-sys to make adding
additional features and enumerations easier [1].  For now, we can
hand edit.

[1] (https://github.com/vulkano-rs/vulkano/issues/89)

* vk_sys: add VK_KHR_external_memory_fd bindings

This adds some basic external memory features.  Most of these
features are core in VK1.1.

* vulkano: memory: add and use DeviceMemoryBuilder

We'll need to:

(a) Create exportable memory
(b) import from a OS descriptor to create DeviceMemory
(c) Also support dedicated allocations

The device memory API is becoming rather complicated.  Let's use
the common builder pattern to simplify this.

* vulkano: memory: implement some external features

This change is sufficient to create exportable memory and
export it.  It's only been tested on Linux platforms and depends
on Unix file descriptors, so enable it only there for now.

Import support will be added later.  Support for external buffers
and images can also be added later if someone needs it.
This commit is contained in:
gurchetansingh 2021-01-09 04:02:08 -08:00 committed by GitHub
parent 3113d1fea5
commit 2d60c08c10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 1510 additions and 121 deletions

View File

@ -1,5 +1,20 @@
# Unreleased # Unreleased
- Added support for VK1.2 formats.
- Added support for additional image aspect bits.
- Updated the structure type enum to match VK1.2.
- Added some `VK_KHR_external_memory` and `VK_KHR_external_memory_fd`
bindings:
+ enum `ExternalMemoryHandleTypeFlagBits`
+ struct `ExportMemoryAllocateInfo`
+ struct `ExternalMemoryBufferCreateInfo`
+ struct `ExternalMemoryImageCreateInfo`
+ struct `MemoryFdPropertiesKHR`
+ struct `MemoryGetFdInfoKHR`
+ struct `ImportMemoryFdInfoKHR`
+ function `GetMemoryFdKHR`
+ function `GetMemoryFdPropertiesKHR`
# Version 0.5.3 (2020-12-26) # Version 0.5.3 (2020-12-26)
- Added support for: - Added support for:

View File

@ -1,5 +1,8 @@
# Unreleased # Unreleased
- Added support for `ImageAspect` and YV12/NV12 formats, for use with the UnsafeImage API.
- Added basic VK_KHR_external_memory, VK_KHR_external_memory_fd, and VK_EXT_external_memory_dma_buf support.
# Version 0.20.0 (2020-12-26) # Version 0.20.0 (2020-12-26)
- **Breaking** The `ImmutableImage::from_iter` and `ImmutableImage::from_buffer` can build Mipmaps - **Breaking** The `ImmutableImage::from_iter` and `ImmutableImage::from_buffer` can build Mipmaps

View File

@ -66,6 +66,7 @@ pub const ATTACHMENT_UNUSED: u32 = 0xffffffff;
pub const TRUE: u32 = 1; pub const TRUE: u32 = 1;
pub const FALSE: u32 = 0; pub const FALSE: u32 = 0;
pub const QUEUE_FAMILY_IGNORED: u32 = 0xffffffff; pub const QUEUE_FAMILY_IGNORED: u32 = 0xffffffff;
pub const QUEUE_FAMILY_EXTERNAL: u32 = 0xfffffffe;
pub const SUBPASS_EXTERNAL: u32 = 0xffffffff; pub const SUBPASS_EXTERNAL: u32 = 0xffffffff;
pub const MAX_PHYSICAL_DEVICE_NAME_SIZE: u32 = 256; pub const MAX_PHYSICAL_DEVICE_NAME_SIZE: u32 = 256;
pub const UUID_SIZE: u32 = 16; pub const UUID_SIZE: u32 = 16;
@ -156,8 +157,129 @@ pub const STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER: u32 = 45;
pub const STRUCTURE_TYPE_MEMORY_BARRIER: u32 = 46; pub const STRUCTURE_TYPE_MEMORY_BARRIER: u32 = 46;
pub const STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO: u32 = 47; pub const STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO: u32 = 47;
pub const STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO: u32 = 48; pub const STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO: u32 = 48;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: u32 = 1000094000;
pub const STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO: u32 = 1000157000;
pub const STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO: u32 = 1000157001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: u32 = 1000083000;
pub const STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: u32 = 1000127000;
pub const STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO: u32 = 1000127001;
pub const STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO: u32 = 1000060000;
pub const STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: u32 = 1000060003;
pub const STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: u32 = 1000060004;
pub const STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: u32 = 1000060005;
pub const STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO: u32 = 1000060006;
pub const STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: u32 = 1000060013;
pub const STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: u32 = 1000060014;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES: u32 = 1000070000;
pub const STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: u32 = 1000070001;
pub const STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2: u32 = 1000146000;
pub const STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2: u32 = 1000146001;
pub const STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2: u32 = 1000146002;
pub const STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2: u32 = 1000146003;
pub const STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2: u32 = 1000146004;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: u32 = 1000059000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2: u32 = 1000059001;
pub const STRUCTURE_TYPE_FORMAT_PROPERTIES_2: u32 = 1000059002;
pub const STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2: u32 = 1000059003;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2: u32 = 1000059004;
pub const STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2: u32 = 1000059005;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2: u32 = 1000059006;
pub const STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2: u32 = 1000059007;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2: u32 = 1000059008;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: u32 = 1000117000;
pub const STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: u32 = 1000117001;
pub const STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: u32 = 1000117002;
pub const STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: u32 = 1000117003;
pub const STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO: u32 = 1000053000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: u32 = 1000053001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: u32 = 1000053002;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: u32 = 1000120000;
pub const STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO: u32 = 1000145000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: u32 = 1000145001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: u32 = 1000145002;
pub const STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2: u32 = 1000145003;
pub const STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO: u32 = 1000156000;
pub const STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: u32 = 1000156001;
pub const STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: u32 = 1000156002;
pub const STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: u32 = 1000156003;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: u32 = 1000156004;
pub const STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: u32 = 1000156005;
pub const STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO: u32 = 1000085000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: u32 = 1000071000;
pub const STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: u32 = 1000071001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO: u32 = 1000071002;
pub const STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES: u32 = 1000071003;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: u32 = 1000071004;
pub const STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO: u32 = 1000072000;
pub const STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: u32 = 1000072001;
pub const STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO: u32 = 1000072002;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO: u32 = 1000112000;
pub const STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES: u32 = 1000112001;
pub const STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO: u32 = 1000113000;
pub const STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: u32 = 1000077000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO: u32 = 1000076000;
pub const STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES: u32 = 1000076001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: u32 = 1000168000;
pub const STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT: u32 = 1000168001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: u32 = 1000063000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: u32 = 49;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: u32 = 50;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: u32 = 51;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: u32 = 52;
pub const STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: u32 = 1000147000;
pub const STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2: u32 = 1000109000;
pub const STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2: u32 = 1000109001;
pub const STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2: u32 = 1000109002;
pub const STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2: u32 = 1000109003;
pub const STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2: u32 = 1000109004;
pub const STRUCTURE_TYPE_SUBPASS_BEGIN_INFO: u32 = 1000109005;
pub const STRUCTURE_TYPE_SUBPASS_END_INFO: u32 = 1000109006;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: u32 = 1000177000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES: u32 = 1000196000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: u32 = 1000180000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: u32 = 1000082000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: u32 = 1000197000;
pub const STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: u32 = 1000161000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: u32 = 1000161001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: u32 = 1000161002;
pub const STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO: u32 = 1000161003;
pub const STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: u32 = 1000161004;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: u32 = 1000199000;
pub const STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE: u32 = 1000199001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: u32 = 1000221000;
pub const STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: u32 = 1000246000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: u32 = 1000130000;
pub const STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO: u32 = 1000130001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: u32 = 1000211000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: u32 = 1000108000;
pub const STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO: u32 = 1000108001;
pub const STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO: u32 = 1000108002;
pub const STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO: u32 = 1000108003;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: u32 = 1000253000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: u32 = 1000175000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: u32 = 1000241000;
pub const STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT: u32 = 1000241001;
pub const STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT: u32 = 1000241002;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: u32 = 1000261000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: u32 = 1000207000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: u32 = 1000207001;
pub const STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: u32 = 1000207002;
pub const STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO: u32 = 1000207003;
pub const STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO: u32 = 1000207004;
pub const STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO: u32 = 1000207005;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: u32 = 1000257000;
pub const STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO: u32 = 1000244001;
pub const STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO: u32 = 1000257002;
pub const STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO: u32 = 1000257003;
pub const STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO: u32 = 1000257004;
pub const STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR: u32 = 1000001000; pub const STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR: u32 = 1000001000;
pub const STRUCTURE_TYPE_PRESENT_INFO_KHR: u32 = 1000001001; pub const STRUCTURE_TYPE_PRESENT_INFO_KHR: u32 = 1000001001;
pub const STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR: u32 = 1000060007;
pub const STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR: u32 = 1000060008;
pub const STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR: u32 = 1000060009;
pub const STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR: u32 = 1000060010;
pub const STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR: u32 = 1000060011;
pub const STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR: u32 = 1000060012;
pub const STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR: u32 = 1000002000; pub const STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR: u32 = 1000002000;
pub const STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR: u32 = 1000002001; pub const STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR: u32 = 1000002001;
pub const STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR: u32 = 1000003000; pub const STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR: u32 = 1000003000;
@ -166,43 +288,527 @@ pub const STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR: u32 = 1000005000;
pub const STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR: u32 = 1000006000; pub const STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR: u32 = 1000006000;
pub const STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR: u32 = 1000008000; pub const STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR: u32 = 1000008000;
pub const STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR: u32 = 1000009000; pub const STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR: u32 = 1000009000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: u32 = 1000094000; pub const STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: u32 = 1000011000;
pub const STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK: u32 = 1000122000 + (122 * 1000); pub const STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD: u32 = 1000018000;
pub const STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK: u32 = 1000000000 + (123 * 1000); pub const STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT: u32 = 1000022000;
pub const STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT: u32 = 1000022001;
pub const STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT: u32 = 1000022002;
pub const STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV: u32 = 1000026000;
pub const STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV: u32 = 1000026001;
pub const STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV: u32 = 1000026002;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: u32 = 1000028000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: u32 = 1000028001;
pub const STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT: u32 = 1000028002;
pub const STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX: u32 = 1000030000;
pub const STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX: u32 = 1000030001;
pub const STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: u32 = 1000041000;
pub const STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP: u32 = 1000049000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: u32 = 1000050000;
pub const STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV: u32 = 1000056000;
pub const STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV: u32 = 1000056001;
pub const STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV: u32 = 1000057000;
pub const STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV: u32 = 1000057001;
pub const STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV: u32 = 1000058000;
pub const STRUCTURE_TYPE_VALIDATION_FLAGS_EXT: u32 = 1000061000;
pub const STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN: u32 = 1000062000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT: u32 =
1000066000;
pub const STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT: u32 = 1000067000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: u32 = 1000067001;
pub const STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR: u32 = 1000073000;
pub const STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR: u32 = 1000073001;
pub const STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR: u32 = 1000073002;
pub const STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR: u32 = 1000073003;
pub const STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR: u32 = 1000074000;
pub const STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR: u32 = 1000074001;
pub const STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR: u32 = 1000074002;
pub const STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR: u32 = 1000075000;
pub const STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR: u32 = 1000078000;
pub const STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR: u32 = 1000078001;
pub const STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR: u32 = 1000078002;
pub const STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR: u32 = 1000078003;
pub const STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR: u32 = 1000079000;
pub const STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR: u32 = 1000079001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: u32 = 1000080000;
pub const STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT: u32 =
1000081000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: u32 = 1000081001;
pub const STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT: u32 = 1000081002;
pub const STRUCTURE_TYPE_PRESENT_REGIONS_KHR: u32 = 1000084000;
pub const STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV: u32 = 1000087000;
pub const STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT: u32 = 1000090000;
pub const STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT: u32 = 1000091000;
pub const STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT: u32 = 1000091001;
pub const STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT: u32 = 1000091002;
pub const STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT: u32 = 1000091003;
pub const STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE: u32 = 1000092000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX: u32 =
1000097000;
pub const STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV: u32 = 1000098000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: u32 = 1000099000;
pub const STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: u32 = 1000099001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT: u32 =
1000101000;
pub const STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT: u32 =
1000101001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: u32 = 1000102000;
pub const STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: u32 = 1000102001;
pub const STRUCTURE_TYPE_HDR_METADATA_EXT: u32 = 1000105000;
pub const STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR: u32 = 1000111000;
pub const STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR: u32 = 1000114000;
pub const STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR: u32 = 1000114001;
pub const STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR: u32 = 1000114002;
pub const STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR: u32 = 1000115000;
pub const STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR: u32 = 1000115001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: u32 = 1000116000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR: u32 = 1000116001;
pub const STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR: u32 = 1000116002;
pub const STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: u32 = 1000116003;
pub const STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR: u32 = 1000116004;
pub const STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR: u32 = 1000116005;
pub const STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR: u32 = 1000116006;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR: u32 = 1000119000;
pub const STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR: u32 = 1000119001;
pub const STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR: u32 = 1000119002;
pub const STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR: u32 = 1000121000;
pub const STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR: u32 = 1000121001;
pub const STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR: u32 = 1000121002;
pub const STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR: u32 = 1000121003;
pub const STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR: u32 = 1000121004;
pub const STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK: u32 = 1000122000;
pub const STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK: u32 = 1000123000;
pub const STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT: u32 = 1000128000; pub const STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT: u32 = 1000128000;
pub const STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT: u32 = 1000128001; pub const STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT: u32 = 1000128001;
pub const STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT: u32 = 1000128002; pub const STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT: u32 = 1000128002;
pub const STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT: u32 = 1000128003; pub const STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT: u32 = 1000128003;
pub const STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: u32 = 1000128004; pub const STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: u32 = 1000128004;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR: u32 = 1000059000; pub const STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID: u32 = 1000129000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR: u32 = 1000059001; pub const STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID: u32 = 1000129001;
pub const STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR: u32 = 1000059002; pub const STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID: u32 = 1000129002;
pub const STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR: u32 = 1000059003; pub const STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID: u32 = 1000129003;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR: u32 = 1000059004; pub const STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID: u32 = 1000129004;
pub const STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR: u32 = 1000059005; pub const STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID: u32 = 1000129005;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR: u32 = 1000059006; pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: u32 = 1000138000;
pub const STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR: u32 = 1000059007; pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT: u32 = 1000138001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR: u32 = 1000059008; pub const STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: u32 = 1000138002;
pub const STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN: u32 = 1000062000; pub const STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT: u32 = 1000138003;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: u32 = 1000080000; pub const STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: u32 = 1000143000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR: u32 = 1000083000; pub const STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT: u32 = 1000143001;
pub const STRUCTURE_TYPE_PRESENT_REGIONS_KHR: u32 = 1000084000; pub const STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT: u32 = 1000143002;
pub const STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR: u32 = 1000085000; pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: u32 = 1000143003;
pub const STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR: u32 = 1000127000; pub const STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT: u32 = 1000143004;
pub const STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR: u32 = 1000127001; pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: u32 = 1000148000;
pub const STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR: u32 = 1000146000; pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: u32 = 1000148001;
pub const STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR: u32 = 1000146001; pub const STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: u32 = 1000148002;
pub const STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2_KHR: u32 = 1000146002; pub const STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV: u32 = 1000149000;
pub const STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR: u32 = 1000146003; pub const STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_KHR: u32 = 1000165006;
pub const STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2_KHR: u32 = 1000146004; pub const STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR: u32 = 1000165007;
pub const STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR: u32 = 1000150000;
pub const STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_GEOMETRY_TYPE_INFO_KHR: u32 = 1000150001;
pub const STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR: u32 = 1000150002;
pub const STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR: u32 = 1000150003;
pub const STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR: u32 = 1000150004;
pub const STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR: u32 = 1000150005;
pub const STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR: u32 = 1000150006;
pub const STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_KHR: u32 = 1000150008;
pub const STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_KHR: u32 = 1000150009;
pub const STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR: u32 = 1000150010;
pub const STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR: u32 = 1000150011;
pub const STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR: u32 = 1000150012;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_FEATURES_KHR: u32 = 1000150013;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_KHR: u32 = 1000150014;
pub const STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR: u32 = 1000150015;
pub const STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR: u32 = 1000150016;
pub const STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR: u32 = 1000150017;
pub const STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR: u32 = 1000150018;
pub const STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV: u32 = 1000152000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: u32 = 1000154000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: u32 = 1000154001;
pub const STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT: u32 = 1000158000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT: u32 = 1000158002;
pub const STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT: u32 = 1000158003;
pub const STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT: u32 = 1000158004;
pub const STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT: u32 = 1000158005;
pub const STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT: u32 = 1000160000;
pub const STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: u32 = 1000160001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR: u32 = 1000163000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR: u32 = 1000163001;
pub const STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV: u32 =
1000164000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: u32 = 1000164001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: u32 = 1000164002;
pub const STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV: u32 =
1000164005;
pub const STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV: u32 = 1000165000;
pub const STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV: u32 = 1000165001;
pub const STRUCTURE_TYPE_GEOMETRY_NV: u32 = 1000165003;
pub const STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV: u32 = 1000165004;
pub const STRUCTURE_TYPE_GEOMETRY_AABB_NV: u32 = 1000165005;
pub const STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV: u32 = 1000165008;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: u32 = 1000165009;
pub const STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV: u32 = 1000165011;
pub const STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV: u32 = 1000165012;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: u32 = 1000166000;
pub const STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: u32 =
1000166001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT: u32 = 1000170000;
pub const STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: u32 = 1000170001;
pub const STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT: u32 = 1000174000;
pub const STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT: u32 = 1000178000;
pub const STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT: u32 = 1000178001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: u32 = 1000178002;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: u32 = 1000181000;
pub const STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: u32 = 1000183000;
pub const STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT: u32 = 1000184000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: u32 = 1000185000;
pub const STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: u32 = 1000189000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: u32 = 1000190000;
pub const STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT: u32 = 1000190001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: u32 = 1000190002;
pub const STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP: u32 = 1000191000;
pub const STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT: u32 = 1000192000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: u32 = 1000201000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: u32 = 1000202000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: u32 = 1000202001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV: u32 = 1000203000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: u32 = 1000204000;
pub const STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV: u32 = 1000205000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: u32 = 1000205002;
pub const STRUCTURE_TYPE_CHECKPOINT_DATA_NV: u32 = 1000206000;
pub const STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: u32 = 1000206001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: u32 =
1000209000;
pub const STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL: u32 = 1000210000;
pub const STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL: u32 = 1000210001;
pub const STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL: u32 = 1000210002;
pub const STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL: u32 = 1000210003;
pub const STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL: u32 = 1000210004;
pub const STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL: u32 = 1000210005;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: u32 = 1000212000;
pub const STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD: u32 = 1000213000;
pub const STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD: u32 = 1000213001;
pub const STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA: u32 = 1000214000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR: u32 = 1000215000;
pub const STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT: u32 = 1000217000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: u32 = 1000218000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: u32 = 1000218001;
pub const STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: u32 = 1000218002;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT: u32 = 1000225000;
pub const STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT: u32 =
1000225001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT: u32 = 1000225002;
pub const STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: u32 = 1000226000;
pub const STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR: u32 = 1000226001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR: u32 = 1000226002;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: u32 = 1000226003;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR: u32 = 1000226004;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD: u32 = 1000227000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: u32 = 1000229000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: u32 = 1000234000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: u32 = 1000237000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: u32 = 1000238000;
pub const STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT: u32 = 1000238001;
pub const STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR: u32 = 1000239000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: u32 =
1000240000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: u32 = 1000244000;
pub const STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT: u32 = 1000244002;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES_EXT: u32 = 1000245000;
pub const STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: u32 = 1000247000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: u32 = 1000249000;
pub const STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV: u32 = 1000249001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: u32 = 1000249002;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: u32 = 1000250000;
pub const STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV: u32 = 1000250001;
pub const STRUCTURE_TYPE_FRAMEBUFFER_MIXED_SAMPLES_COMBINATION_NV: u32 = 1000250002;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: u32 = 1000251000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: u32 = 1000252000;
pub const STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT: u32 = 1000255000; pub const STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT: u32 = 1000255000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT: u32 = 1000244000; pub const STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT: u32 = 1000255002;
pub const STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO: u32 = 1000244001; pub const STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT: u32 = 1000255001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: u32 = 1000120000; pub const STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT: u32 = 1000256000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: u32 = 1000180000; pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: u32 = 1000259000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: u32 = 1000177000; pub const STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT: u32 = 1000259001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: u32 = 1000083000; pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: u32 = 1000259002;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: u32 = 1000082000; pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: u32 = 1000260000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: u32 = 1000265000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: u32 = 1000267000;
pub const STRUCTURE_TYPE_DEFERRED_OPERATION_INFO_KHR: u32 = 1000268000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: u32 =
1000269000;
pub const STRUCTURE_TYPE_PIPELINE_INFO_KHR: u32 = 1000269001;
pub const STRUCTURE_TYPE_PIPELINE_EXECUTABLE_PROPERTIES_KHR: u32 = 1000269002;
pub const STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR: u32 = 1000269003;
pub const STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR: u32 = 1000269004;
pub const STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR: u32 = 1000269005;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT: u32 =
1000276000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV: u32 = 1000277000;
pub const STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV: u32 = 1000277001;
pub const STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV: u32 = 1000277002;
pub const STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV: u32 = 1000277003;
pub const STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV: u32 = 1000277004;
pub const STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV: u32 = 1000277005;
pub const STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_NV: u32 = 1000277006;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: u32 = 1000277007;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: u32 = 1000281000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: u32 = 1000281001;
pub const STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM: u32 =
1000282000;
pub const STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM: u32 = 1000282001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT: u32 = 1000284000;
pub const STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT: u32 = 1000284001;
pub const STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT: u32 = 1000284002;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: u32 = 1000286000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: u32 = 1000286001;
pub const STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT: u32 = 1000287000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: u32 = 1000287001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: u32 = 1000287002;
pub const STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR: u32 = 1000290000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT: u32 = 1000295000;
pub const STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT: u32 = 1000295001;
pub const STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO_EXT: u32 = 1000295002;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT: u32 =
1000297000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: u32 = 1000300000;
pub const STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV: u32 = 1000300001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: u32 = 1000332000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT: u32 = 1000332001;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT: u32 = 1000335000;
pub const STRUCTURE_TYPE_COPY_BUFFER_INFO_2_KHR: u32 = 1000337000;
pub const STRUCTURE_TYPE_COPY_IMAGE_INFO_2_KHR: u32 = 1000337001;
pub const STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2_KHR: u32 = 1000337002;
pub const STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR: u32 = 1000337003;
pub const STRUCTURE_TYPE_BLIT_IMAGE_INFO_2_KHR: u32 = 1000337004;
pub const STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2_KHR: u32 = 1000337005;
pub const STRUCTURE_TYPE_BUFFER_COPY_2_KHR: u32 = 1000337006;
pub const STRUCTURE_TYPE_IMAGE_COPY_2_KHR: u32 = 1000337007;
pub const STRUCTURE_TYPE_IMAGE_BLIT_2_KHR: u32 = 1000337008;
pub const STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2_KHR: u32 = 1000337009;
pub const STRUCTURE_TYPE_IMAGE_RESOLVE_2_KHR: u32 = 1000337010;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: u32 = 1000340000;
pub const STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT: u32 = 1000346000;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES;
pub const STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT: u32 =
STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT;
pub const STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHR: u32 =
STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
pub const STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR: u32 = STRUCTURE_TYPE_FORMAT_PROPERTIES_2;
pub const STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR: u32 =
STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2;
pub const STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR: u32 =
STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2;
pub const STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR: u32 =
STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2;
pub const STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHR: u32 =
STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO;
pub const STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHR: u32 =
STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO;
pub const STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHR: u32 =
STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO;
pub const STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHR: u32 =
STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO;
pub const STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHR: u32 =
STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO;
pub const STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO_KHR: u32 =
STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO;
pub const STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR: u32 =
STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES;
pub const STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHR: u32 =
STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO;
pub const STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHR: u32 =
STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO;
pub const STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHR: u32 =
STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES;
pub const STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR: u32 =
STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO;
pub const STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR: u32 =
STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO;
pub const STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR: u32 =
STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO;
pub const STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHR: u32 =
STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES;
pub const STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHR: u32 =
STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES;
pub const STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR: u32 =
STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO;
pub const STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT: u32 = STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES;
pub const STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR: u32 =
STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO;
pub const STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO_KHR: u32 =
STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO;
pub const STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR: u32 =
STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO;
pub const STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2_KHR: u32 =
STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2;
pub const STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2_KHR: u32 = STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2;
pub const STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2_KHR: u32 = STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2;
pub const STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2_KHR: u32 = STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2;
pub const STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2_KHR: u32 =
STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2;
pub const STRUCTURE_TYPE_SUBPASS_BEGIN_INFO_KHR: u32 = STRUCTURE_TYPE_SUBPASS_BEGIN_INFO;
pub const STRUCTURE_TYPE_SUBPASS_END_INFO_KHR: u32 = STRUCTURE_TYPE_SUBPASS_END_INFO;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO;
pub const STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES_KHR: u32 =
STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES;
pub const STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO_KHR: u32 =
STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES;
pub const STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO_KHR: u32 =
STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO;
pub const STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO_KHR: u32 =
STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO;
pub const STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO_KHR: u32 =
STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES_KHR;
pub const STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR: u32 =
STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS;
pub const STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR: u32 =
STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES;
pub const STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT: u32 =
STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO;
pub const STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR: u32 =
STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2;
pub const STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR: u32 =
STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2;
pub const STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2_KHR: u32 =
STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2;
pub const STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR: u32 = STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2;
pub const STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2_KHR: u32 =
STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2;
pub const STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR: u32 =
STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO;
pub const STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_KHR: u32 =
STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO;
pub const STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR: u32 =
STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO;
pub const STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO_KHR: u32 =
STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO;
pub const STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO_KHR: u32 =
STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES;
pub const STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES_KHR: u32 =
STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES;
pub const STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR: u32 = STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO;
pub const STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR: u32 = STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO;
pub const STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT: u32 =
STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES;
pub const STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT: u32 =
STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO;
pub const STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT: u32 =
STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT;
pub const STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV: u32 =
STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_KHR;
pub const STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV: u32 =
STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES;
pub const STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT_KHR: u32 =
STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES;
pub const STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR: u32 =
STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES;
pub const STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO_KHR: u32 =
STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO;
pub const STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO_KHR: u32 =
STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO;
pub const STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO_KHR: u32 = STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO;
pub const STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO_KHR: u32 = STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO;
pub const STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO_INTEL: u32 =
STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES;
pub const STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT_KHR: u32 =
STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT;
pub const STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT_KHR: u32 =
STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT;
pub const STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT: u32 =
STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO;
pub const STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO_EXT: u32 =
STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES;
pub const STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_KHR: u32 =
STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO;
pub const STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO_KHR: u32 =
STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO;
pub const STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO_KHR: u32 =
STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO;
pub const STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO_KHR: u32 =
STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO;
pub const STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT: u32 =
STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES;
pub const STRUCTURE_TYPE_MAX_ENUM: u32 = 0x7FFFFFFF;
pub type SystemAllocationScope = u32; pub type SystemAllocationScope = u32;
pub const SYSTEM_ALLOCATION_SCOPE_COMMAND: u32 = 0; pub const SYSTEM_ALLOCATION_SCOPE_COMMAND: u32 = 0;
@ -401,6 +1007,115 @@ pub const FORMAT_ASTC_12x10_SRGB_BLOCK: u32 = 182;
pub const FORMAT_ASTC_12x12_UNORM_BLOCK: u32 = 183; pub const FORMAT_ASTC_12x12_UNORM_BLOCK: u32 = 183;
pub const FORMAT_ASTC_12x12_SRGB_BLOCK: u32 = 184; pub const FORMAT_ASTC_12x12_SRGB_BLOCK: u32 = 184;
pub const FORMAT_G8B8G8R8_422_UNORM: u32 = 1000156000;
pub const FORMAT_B8G8R8G8_422_UNORM: u32 = 1000156001;
pub const FORMAT_G8_B8_R8_3PLANE_420_UNORM: u32 = 1000156002;
pub const FORMAT_G8_B8R8_2PLANE_420_UNORM: u32 = 1000156003;
pub const FORMAT_G8_B8_R8_3PLANE_422_UNORM: u32 = 1000156004;
pub const FORMAT_G8_B8R8_2PLANE_422_UNORM: u32 = 1000156005;
pub const FORMAT_G8_B8_R8_3PLANE_444_UNORM: u32 = 1000156006;
pub const FORMAT_R10X6_UNORM_PACK16: u32 = 1000156007;
pub const FORMAT_R10X6G10X6_UNORM_2PACK16: u32 = 1000156008;
pub const FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16: u32 = 1000156009;
pub const FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16: u32 = 1000156010;
pub const FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16: u32 = 1000156011;
pub const FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: u32 = 1000156012;
pub const FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: u32 = 1000156013;
pub const FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: u32 = 1000156014;
pub const FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: u32 = 1000156015;
pub const FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: u32 = 1000156016;
pub const FORMAT_R12X4_UNORM_PACK16: u32 = 1000156017;
pub const FORMAT_R12X4G12X4_UNORM_2PACK16: u32 = 1000156018;
pub const FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16: u32 = 1000156019;
pub const FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16: u32 = 1000156020;
pub const FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16: u32 = 1000156021;
pub const FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: u32 = 1000156022;
pub const FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: u32 = 1000156023;
pub const FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: u32 = 1000156024;
pub const FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: u32 = 1000156025;
pub const FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: u32 = 1000156026;
pub const FORMAT_G16B16G16R16_422_UNORM: u32 = 1000156027;
pub const FORMAT_B16G16R16G16_422_UNORM: u32 = 1000156028;
pub const FORMAT_G16_B16_R16_3PLANE_420_UNORM: u32 = 1000156029;
pub const FORMAT_G16_B16R16_2PLANE_420_UNORM: u32 = 1000156030;
pub const FORMAT_G16_B16_R16_3PLANE_422_UNORM: u32 = 1000156031;
pub const FORMAT_G16_B16R16_2PLANE_422_UNORM: u32 = 1000156032;
pub const FORMAT_G16_B16_R16_3PLANE_444_UNORM: u32 = 1000156033;
pub const FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG: u32 = 1000054000;
pub const FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG: u32 = 1000054001;
pub const FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG: u32 = 1000054002;
pub const FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG: u32 = 1000054003;
pub const FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG: u32 = 1000054004;
pub const FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG: u32 = 1000054005;
pub const FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG: u32 = 1000054006;
pub const FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG: u32 = 1000054007;
pub const FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT: u32 = 1000066000;
pub const FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT: u32 = 1000066001;
pub const FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT: u32 = 1000066002;
pub const FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT: u32 = 1000066003;
pub const FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT: u32 = 1000066004;
pub const FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT: u32 = 1000066005;
pub const FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT: u32 = 1000066006;
pub const FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT: u32 = 1000066007;
pub const FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT: u32 = 1000066008;
pub const FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT: u32 = 1000066009;
pub const FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT: u32 = 1000066010;
pub const FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT: u32 = 1000066011;
pub const FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT: u32 = 1000066012;
pub const FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT: u32 = 1000066013;
pub const FORMAT_A4R4G4B4_UNORM_PACK16_EXT: u32 = 1000340000;
pub const FORMAT_A4B4G4R4_UNORM_PACK16_EXT: u32 = 1000340001;
pub const FORMAT_G8B8G8R8_422_UNORM_KHR: u32 = FORMAT_G8B8G8R8_422_UNORM;
pub const FORMAT_B8G8R8G8_422_UNORM_KHR: u32 = FORMAT_B8G8R8G8_422_UNORM;
pub const FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR: u32 = FORMAT_G8_B8_R8_3PLANE_420_UNORM;
pub const FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR: u32 = FORMAT_G8_B8R8_2PLANE_420_UNORM;
pub const FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR: u32 = FORMAT_G8_B8_R8_3PLANE_422_UNORM;
pub const FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR: u32 = FORMAT_G8_B8R8_2PLANE_422_UNORM;
pub const FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR: u32 = FORMAT_G8_B8_R8_3PLANE_444_UNORM;
pub const FORMAT_R10X6_UNORM_PACK16_KHR: u32 = FORMAT_R10X6_UNORM_PACK16;
pub const FORMAT_R10X6G10X6_UNORM_2PACK16_KHR: u32 = FORMAT_R10X6G10X6_UNORM_2PACK16;
pub const FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR: u32 =
FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16;
pub const FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR: u32 =
FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16;
pub const FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR: u32 =
FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16;
pub const FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR: u32 =
FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16;
pub const FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR: u32 =
FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16;
pub const FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR: u32 =
FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16;
pub const FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR: u32 =
FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16;
pub const FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR: u32 =
FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16;
pub const FORMAT_R12X4_UNORM_PACK16_KHR: u32 = FORMAT_R12X4_UNORM_PACK16;
pub const FORMAT_R12X4G12X4_UNORM_2PACK16_KHR: u32 = FORMAT_R12X4G12X4_UNORM_2PACK16;
pub const FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR: u32 =
FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16;
pub const FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR: u32 =
FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16;
pub const FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR: u32 =
FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16;
pub const FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR: u32 =
FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16;
pub const FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR: u32 =
FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16;
pub const FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR: u32 =
FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16;
pub const FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR: u32 =
FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16;
pub const FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR: u32 =
FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16;
pub const FORMAT_G16B16G16R16_422_UNORM_KHR: u32 = FORMAT_G16B16G16R16_422_UNORM;
pub const FORMAT_B16G16R16G16_422_UNORM_KHR: u32 = FORMAT_B16G16R16G16_422_UNORM;
pub const FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR: u32 = FORMAT_G16_B16_R16_3PLANE_420_UNORM;
pub const FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR: u32 = FORMAT_G16_B16R16_2PLANE_420_UNORM;
pub const FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR: u32 = FORMAT_G16_B16_R16_3PLANE_422_UNORM;
pub const FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR: u32 = FORMAT_G16_B16R16_2PLANE_422_UNORM;
pub const FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR: u32 = FORMAT_G16_B16_R16_3PLANE_444_UNORM;
pub type ImageType = u32; pub type ImageType = u32;
pub const IMAGE_TYPE_1D: u32 = 0; pub const IMAGE_TYPE_1D: u32 = 0;
pub const IMAGE_TYPE_2D: u32 = 1; pub const IMAGE_TYPE_2D: u32 = 1;
@ -749,6 +1464,17 @@ pub const IMAGE_ASPECT_COLOR_BIT: u32 = 0x00000001;
pub const IMAGE_ASPECT_DEPTH_BIT: u32 = 0x00000002; pub const IMAGE_ASPECT_DEPTH_BIT: u32 = 0x00000002;
pub const IMAGE_ASPECT_STENCIL_BIT: u32 = 0x00000004; pub const IMAGE_ASPECT_STENCIL_BIT: u32 = 0x00000004;
pub const IMAGE_ASPECT_METADATA_BIT: u32 = 0x00000008; pub const IMAGE_ASPECT_METADATA_BIT: u32 = 0x00000008;
pub const IMAGE_ASPECT_PLANE_0_BIT: u32 = 0x00000010;
pub const IMAGE_ASPECT_PLANE_1_BIT: u32 = 0x00000020;
pub const IMAGE_ASPECT_PLANE_2_BIT: u32 = 0x00000040;
pub const IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT: u32 = 0x00000080;
pub const IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT: u32 = 0x00000100;
pub const IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT: u32 = 0x00000200;
pub const IMAGE_ASPECT_MEMORY_PLANE_3_BIT_EXT: u32 = 0x00000400;
pub const IMAGE_ASPECT_PLANE_0_BIT_KHR: u32 = IMAGE_ASPECT_PLANE_0_BIT;
pub const IMAGE_ASPECT_PLANE_1_BIT_KHR: u32 = IMAGE_ASPECT_PLANE_1_BIT;
pub const IMAGE_ASPECT_PLANE_2_BIT_KHR: u32 = IMAGE_ASPECT_PLANE_2_BIT;
pub const IMAGE_ASPECT_FLAG_BITS_MAX_ENUM: u32 = 0x7FFFFFFF;
pub type ImageAspectFlags = Flags; pub type ImageAspectFlags = Flags;
pub type SparseImageFormatFlagBits = u32; pub type SparseImageFormatFlagBits = u32;
@ -976,6 +1702,34 @@ pub const COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR: u32 = 0x00000004;
pub const COMPOSITE_ALPHA_INHERIT_BIT_KHR: u32 = 0x00000008; pub const COMPOSITE_ALPHA_INHERIT_BIT_KHR: u32 = 0x00000008;
pub type CompositeAlphaFlagsKHR = Flags; pub type CompositeAlphaFlagsKHR = Flags;
pub type ExternalMemoryHandleTypeFlagBits = u32;
pub const EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT: u32 = 0x00000001;
pub const EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT: u32 = 0x00000002;
pub const EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT: u32 = 0x00000004;
pub const EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT: u32 = 0x00000008;
pub const EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT: u32 = 0x00000010;
pub const EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT: u32 = 0x00000020;
pub const EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT: u32 = 0x00000040;
pub const EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT: u32 = 0x00000200;
pub const EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID: u32 = 0x00000400;
pub const EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT: u32 = 0x00000080;
pub const EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT: u32 = 0x00000100;
pub const EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR: u32 =
EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT;
pub const EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR: u32 =
EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT;
pub const EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR: u32 =
EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT;
pub const EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR: u32 =
EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT;
pub const EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR: u32 =
EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT;
pub const EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR: u32 =
EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT;
pub const EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR: u32 =
EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT;
pub type ExternalMemoryHandleTypeFlags = Flags;
pub type ObjectType = u32; pub type ObjectType = u32;
pub const OBJECT_TYPE_UNKNOWN: u32 = 0; pub const OBJECT_TYPE_UNKNOWN: u32 = 0;
pub const OBJECT_TYPE_INSTANCE: u32 = 1; pub const OBJECT_TYPE_INSTANCE: u32 = 1;
@ -2807,6 +3561,51 @@ pub struct SurfaceFullScreenExclusiveInfoEXT {
pub fullScreenExclusive: FullScreenExclusiveEXT, pub fullScreenExclusive: FullScreenExclusiveEXT,
} }
#[repr(C)]
pub struct ExportMemoryAllocateInfo {
pub sType: StructureType,
pub pNext: *const c_void,
pub handleTypes: ExternalMemoryHandleTypeFlagBits,
}
#[repr(C)]
pub struct ExternalMemoryBufferCreateInfo {
pub sType: StructureType,
pub pNext: *const c_void,
pub handleTypes: ExternalMemoryHandleTypeFlagBits,
}
#[repr(C)]
pub struct ExternalMemoryImageCreateInfo {
pub sType: StructureType,
pub pNext: *const c_void,
pub handleTypes: ExternalMemoryHandleTypeFlagBits,
}
#[repr(C)]
pub struct MemoryFdPropertiesKHR {
pub sType: StructureType,
pub pNext: *const c_void,
pub handleType: ExternalMemoryHandleTypeFlagBits,
pub memoryTypeBits: u32,
}
#[repr(C)]
pub struct MemoryGetFdInfoKHR {
pub sType: StructureType,
pub pNext: *const c_void,
pub memory: DeviceMemory,
pub handleType: ExternalMemoryHandleTypeFlagBits,
}
#[repr(C)]
pub struct ImportMemoryFdInfoKHR {
pub sType: StructureType,
pub pNext: *const c_void,
pub handleType: ExternalMemoryHandleTypeFlagBits,
pub fd: i32,
}
macro_rules! ptrs { macro_rules! ptrs {
($struct_name:ident, { $($name:ident => ($($param_n:ident: $param_ty:ty),*) -> $ret:ty,)+ }) => ( ($struct_name:ident, { $($name:ident => ($($param_n:ident: $param_ty:ty),*) -> $ret:ty,)+ }) => (
pub struct $struct_name { pub struct $struct_name {
@ -3059,4 +3858,6 @@ ptrs!(DevicePointers, {
AcquireFullScreenExclusiveModeEXT => (device: Device, swapchain: SwapchainKHR) -> Result, AcquireFullScreenExclusiveModeEXT => (device: Device, swapchain: SwapchainKHR) -> Result,
ReleaseFullScreenExclusiveModeEXT => (device: Device, swapchain: SwapchainKHR) -> Result, ReleaseFullScreenExclusiveModeEXT => (device: Device, swapchain: SwapchainKHR) -> Result,
GetBufferDeviceAddressEXT => (device: Device, pInfo: *const BufferDeviceAddressInfo) -> DeviceAddress, GetBufferDeviceAddressEXT => (device: Device, pInfo: *const BufferDeviceAddressInfo) -> DeviceAddress,
GetMemoryFdKHR => (device: Device, pGetFdInfo: *const MemoryGetFdInfoKHR, pFd: *mut i32) -> Result,
GetMemoryFdPropertiesKHR => (device: Device, handleType: ExternalMemoryHandleTypeFlagBits, fd: i32, pMemoryFdProperties: *mut MemoryFdPropertiesKHR) -> Result,
}); });

View File

@ -119,6 +119,9 @@ device_extensions! {
ext_debug_utils => b"VK_EXT_debug_utils", ext_debug_utils => b"VK_EXT_debug_utils",
khr_multiview => b"VK_KHR_multiview", khr_multiview => b"VK_KHR_multiview",
ext_full_screen_exclusive => b"VK_EXT_full_screen_exclusive", ext_full_screen_exclusive => b"VK_EXT_full_screen_exclusive",
khr_external_memory => b"VK_KHR_external_memory",
khr_external_memory_fd => b"VK_KHR_external_memory_fd",
ext_external_memory_dmabuf => b"VK_EXT_external_memory_dma_buf",
} }
/// This helper type can only be instantiated inside this module. /// This helper type can only be instantiated inside this module.

View File

@ -206,7 +206,7 @@ macro_rules! formats {
} }
} }
/// Returns (width, heigh) of the dimensions for block based formats. For /// Returns (width, height) of the dimensions for block based formats. For
/// non block formats will return (1,1) /// non block formats will return (1,1)
#[inline] #[inline]
pub fn block_dimensions(&self) -> (u32, u32) { pub fn block_dimensions(&self) -> (u32, u32) {
@ -432,6 +432,27 @@ macro_rules! formats {
} }
}; };
(__inner_impl__ $name:ident ycbcr) => {
unsafe impl FormatDesc for $name {
type ClearValue = [f32; 4];
#[inline]
fn format(&self) -> Format {
Format::$name
}
#[inline]
fn decode_clear_value(&self, val: Self::ClearValue) -> ClearValue {
ClearValue::None
}
}
unsafe impl PossibleYcbcrFormatDesc for $name {
#[inline(always)]
fn is_ycbcr(&self) -> bool { true }
}
};
(__inner_ty__ $name:ident float=$num:tt) => { FormatTy::Float }; (__inner_ty__ $name:ident float=$num:tt) => { FormatTy::Float };
(__inner_ty__ $name:ident uint=$num:tt) => { FormatTy::Uint }; (__inner_ty__ $name:ident uint=$num:tt) => { FormatTy::Uint };
(__inner_ty__ $name:ident sint=$num:tt) => { FormatTy::Sint }; (__inner_ty__ $name:ident sint=$num:tt) => { FormatTy::Sint };
@ -439,6 +460,7 @@ macro_rules! formats {
(__inner_ty__ $name:ident stencil) => { FormatTy::Stencil }; (__inner_ty__ $name:ident stencil) => { FormatTy::Stencil };
(__inner_ty__ $name:ident depthstencil) => { FormatTy::DepthStencil }; (__inner_ty__ $name:ident depthstencil) => { FormatTy::DepthStencil };
(__inner_ty__ $name:ident compressed=$f:tt) => { FormatTy::Compressed }; (__inner_ty__ $name:ident compressed=$f:tt) => { FormatTy::Compressed };
(__inner_ty__ $name:ident ycbcr) => { FormatTy::Ycbcr };
(__inner_strongstorage__ $name:ident [$ty:ty; $dim:expr]) => { (__inner_strongstorage__ $name:ident [$ty:ty; $dim:expr]) => {
@ -648,6 +670,8 @@ formats! {
ASTC_12x10SrgbBlock => FORMAT_ASTC_12x10_SRGB_BLOCK [(12, 10)] [Some(16)] [compressed=texture_compression_astc_ldr] {u8}, ASTC_12x10SrgbBlock => FORMAT_ASTC_12x10_SRGB_BLOCK [(12, 10)] [Some(16)] [compressed=texture_compression_astc_ldr] {u8},
ASTC_12x12UnormBlock => FORMAT_ASTC_12x12_UNORM_BLOCK [(12, 12)] [Some(16)] [compressed=texture_compression_astc_ldr] {u8}, ASTC_12x12UnormBlock => FORMAT_ASTC_12x12_UNORM_BLOCK [(12, 12)] [Some(16)] [compressed=texture_compression_astc_ldr] {u8},
ASTC_12x12SrgbBlock => FORMAT_ASTC_12x12_SRGB_BLOCK [(12, 12)] [Some(16)] [compressed=texture_compression_astc_ldr] {u8}, ASTC_12x12SrgbBlock => FORMAT_ASTC_12x12_SRGB_BLOCK [(12, 12)] [Some(16)] [compressed=texture_compression_astc_ldr] {u8},
G8B8R8_3PLANE420Unorm => FORMAT_G8_B8_R8_3PLANE_420_UNORM [(1, 1)] [None] [ycbcr] {},
G8B8R8_2PLANE420Unorm => FORMAT_G8_B8R8_2PLANE_420_UNORM [(1, 1)] [None] [ycbcr] {},
} }
pub unsafe trait FormatDesc { pub unsafe trait FormatDesc {
@ -772,6 +796,19 @@ unsafe impl PossibleFloatOrCompressedFormatDesc for Format {
} }
} }
/// Trait for types that can possibly describe a Ycbcr format.
pub unsafe trait PossibleYcbcrFormatDesc: FormatDesc {
/// Trait for types that can possibly describe a Ycbcr format.
fn is_ycbcr(&self) -> bool;
}
unsafe impl PossibleYcbcrFormatDesc for Format {
#[inline]
fn is_ycbcr(&self) -> bool {
self.ty() == FormatTy::Ycbcr
}
}
macro_rules! impl_pixel { macro_rules! impl_pixel {
{$($ty:ty;)+} => { {$($ty:ty;)+} => {
$(impl_pixel!(inner $ty);)* $(impl_pixel!(inner $ty);)*
@ -818,6 +855,7 @@ pub enum FormatTy {
Stencil, Stencil,
DepthStencil, DepthStencil,
Compressed, Compressed,
Ycbcr,
} }
impl FormatTy { impl FormatTy {
@ -825,9 +863,7 @@ impl FormatTy {
#[inline] #[inline]
pub fn is_depth_and_or_stencil(&self) -> bool { pub fn is_depth_and_or_stencil(&self) -> bool {
match *self { match *self {
FormatTy::Depth => true, FormatTy::Depth | FormatTy::Stencil | FormatTy::DepthStencil => true,
FormatTy::Stencil => true,
FormatTy::DepthStencil => true,
_ => false, _ => false,
} }
} }

132
vulkano/src/image/aspect.rs Normal file
View File

@ -0,0 +1,132 @@
// Copyright (c) 2020 The vulkano developers
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or https://opensource.org/licenses/MIT>,
// at your option. All files in the project carrying such
// notice may not be copied, modified, or distributed except
// according to those terms.
use std::ops::BitOr;
use vk;
/// Describes how an aspect of the image that be used to query Vulkan. This is **not** just a suggestion.
/// Check out VkImageAspectFlagBits in the Vulkan spec.
///
/// If you specify an aspect of the image that doesn't exist (for example, depth for a YUV image), a panic
/// will happen.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct ImageAspect {
pub color: bool,
pub depth: bool,
pub stencil: bool,
pub metadata: bool,
pub plane0: bool,
pub plane1: bool,
pub plane2: bool,
pub memory_plane0: bool,
pub memory_plane1: bool,
pub memory_plane2: bool,
}
impl ImageAspect {
/// Builds a `ImageAspect` with all values set to false. Useful as a default value.
///
/// # Example
///
/// ```rust
/// use vulkano::image::ImageAspect as ImageAspect;
///
/// let _aspect = ImageAspect {
/// color: true,
/// depth: true,
/// .. ImageAspect::none()
/// };
/// ```
#[inline]
pub fn none() -> ImageAspect {
ImageAspect {
color: false,
depth: false,
stencil: false,
metadata: false,
plane0: false,
plane1: false,
plane2: false,
memory_plane0: false,
memory_plane1: false,
memory_plane2: false,
}
}
#[inline]
pub(crate) fn to_aspect_bits(&self) -> vk::ImageAspectFlagBits {
let mut result = 0;
if self.color {
result |= vk::IMAGE_ASPECT_COLOR_BIT;
}
if self.depth {
result |= vk::IMAGE_ASPECT_DEPTH_BIT;
}
if self.stencil {
result |= vk::IMAGE_ASPECT_STENCIL_BIT;
}
if self.metadata {
result |= vk::IMAGE_ASPECT_METADATA_BIT;
}
if self.plane0 {
result |= vk::IMAGE_ASPECT_PLANE_0_BIT;
}
if self.plane1 {
result |= vk::IMAGE_ASPECT_PLANE_1_BIT;
}
if self.plane2 {
result |= vk::IMAGE_ASPECT_PLANE_2_BIT;
}
if self.memory_plane0 {
result |= vk::IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT;
}
if self.memory_plane1 {
result |= vk::IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT;
}
if self.memory_plane2 {
result |= vk::IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT
}
result
}
pub(crate) fn from_bits(val: u32) -> ImageAspect {
ImageAspect {
color: (val & vk::IMAGE_ASPECT_COLOR_BIT) != 0,
depth: (val & vk::IMAGE_ASPECT_DEPTH_BIT) != 0,
stencil: (val & vk::IMAGE_ASPECT_STENCIL_BIT) != 0,
metadata: (val & vk::IMAGE_ASPECT_METADATA_BIT) != 0,
plane0: (val & vk::IMAGE_ASPECT_PLANE_0_BIT) != 0,
plane1: (val & vk::IMAGE_ASPECT_PLANE_1_BIT) != 0,
plane2: (val & vk::IMAGE_ASPECT_PLANE_2_BIT) != 0,
memory_plane0: (val & vk::IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT) != 0,
memory_plane1: (val & vk::IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT) != 0,
memory_plane2: (val & vk::IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT) != 0,
}
}
}
impl BitOr for ImageAspect {
type Output = Self;
#[inline]
fn bitor(self, rhs: Self) -> Self {
ImageAspect {
color: self.color || rhs.color,
depth: self.depth || rhs.depth,
stencil: self.stencil || rhs.stencil,
metadata: self.metadata || rhs.metadata,
plane0: self.plane0 || rhs.plane0,
plane1: self.plane1 || rhs.plane1,
plane2: self.plane2 || rhs.plane2,
memory_plane0: self.memory_plane0 || rhs.memory_plane0,
memory_plane1: self.memory_plane1 || rhs.memory_plane1,
memory_plane2: self.memory_plane2 || rhs.memory_plane2,
}
}
}

View File

@ -66,7 +66,6 @@ pub struct ImmutableImage<F, A = PotentialDedicatedAllocation<StdMemoryPoolAlloc
layout: ImageLayout, layout: ImageLayout,
} }
/// Image whose purpose is to access only a part of one image, for any kind of access /// Image whose purpose is to access only a part of one image, for any kind of access
/// We define a part of one image here by a level of mipmap, or a layer of an array /// We define a part of one image here by a level of mipmap, or a layer of an array
/// The image attribute must be an implementation of ImageAccess /// The image attribute must be an implementation of ImageAccess
@ -80,8 +79,7 @@ pub struct SubImage {
layout: ImageLayout, layout: ImageLayout,
} }
impl SubImage impl SubImage {
{
pub fn new( pub fn new(
image: Arc<dyn ImageAccess + Sync + Send>, image: Arc<dyn ImageAccess + Sync + Send>,
mip_level: u32, mip_level: u32,
@ -120,7 +118,7 @@ fn has_mipmaps(mipmaps: MipmapsCount) -> bool {
match mipmaps { match mipmaps {
MipmapsCount::One => false, MipmapsCount::One => false,
MipmapsCount::Log2 => true, MipmapsCount::Log2 => true,
MipmapsCount::Specific(x) => x > 1 MipmapsCount::Specific(x) => x > 1,
} }
} }
@ -422,7 +420,7 @@ impl<F> ImmutableImage<F> {
let future = match cb.execute(queue) { let future = match cb.execute(queue) {
Ok(f) => f, Ok(f) => f,
Err(e) => unreachable!("{:?}", e) Err(e) => unreachable!("{:?}", e),
}; };
image.initialized.store(true, Ordering::Relaxed); image.initialized.store(true, Ordering::Relaxed);
@ -583,8 +581,7 @@ where
} }
} }
unsafe impl ImageAccess for SubImage unsafe impl ImageAccess for SubImage {
{
#[inline] #[inline]
fn inner(&self) -> ImageInner { fn inner(&self) -> ImageInner {
self.image.inner() self.image.inner()

View File

@ -49,6 +49,7 @@
use std::cmp; use std::cmp;
use std::convert::TryFrom; use std::convert::TryFrom;
pub use self::aspect::ImageAspect;
pub use self::attachment::AttachmentImage; pub use self::attachment::AttachmentImage;
pub use self::immutable::ImmutableImage; pub use self::immutable::ImmutableImage;
pub use self::layout::ImageLayout; pub use self::layout::ImageLayout;
@ -60,6 +61,7 @@ pub use self::traits::ImageInner;
pub use self::traits::ImageViewAccess; pub use self::traits::ImageViewAccess;
pub use self::usage::ImageUsage; pub use self::usage::ImageUsage;
mod aspect;
pub mod attachment; // TODO: make private pub mod attachment; // TODO: make private
pub mod immutable; // TODO: make private pub mod immutable; // TODO: make private
mod layout; mod layout;
@ -684,11 +686,11 @@ impl ImageDimensions {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use format;
use image::Dimensions;
use image::ImageDimensions; use image::ImageDimensions;
use image::ImmutableImage; use image::ImmutableImage;
use image::Dimensions;
use image::MipmapsCount; use image::MipmapsCount;
use format;
#[test] #[test]
fn max_mipmaps() { fn max_mipmaps() {
@ -806,13 +808,23 @@ mod tests {
fn mipmap_working_immutable_image() { fn mipmap_working_immutable_image() {
let (device, queue) = gfx_dev_and_queue!(); let (device, queue) = gfx_dev_and_queue!();
let dimensions = Dimensions::Dim2d{width: 512, height: 512}; let dimensions = Dimensions::Dim2d {
width: 512,
height: 512,
};
{ {
let mut vec = Vec::new(); let mut vec = Vec::new();
vec.resize(512 * 512, 0u8); vec.resize(512 * 512, 0u8);
let (image, _) = ImmutableImage::from_iter(vec.into_iter(), dimensions, MipmapsCount::One, format::R8Unorm, queue.clone()).unwrap(); let (image, _) = ImmutableImage::from_iter(
vec.into_iter(),
dimensions,
MipmapsCount::One,
format::R8Unorm,
queue.clone(),
)
.unwrap();
assert_eq!(image.mipmap_levels(), 1); assert_eq!(image.mipmap_levels(), 1);
} }
{ {
@ -820,8 +832,15 @@ mod tests {
vec.resize(512 * 512, 0u8); vec.resize(512 * 512, 0u8);
let (image, _) = ImmutableImage::from_iter(vec.into_iter(), dimensions, MipmapsCount::Log2, format::R8Unorm, queue.clone()).unwrap(); let (image, _) = ImmutableImage::from_iter(
vec.into_iter(),
dimensions,
MipmapsCount::Log2,
format::R8Unorm,
queue.clone(),
)
.unwrap();
assert_eq!(image.mipmap_levels(), 10); assert_eq!(image.mipmap_levels(), 10);
} }
} }
} }

View File

@ -27,6 +27,8 @@ use std::sync::Arc;
use device::Device; use device::Device;
use format::Format; use format::Format;
use format::FormatTy; use format::FormatTy;
use format::PossibleYcbcrFormatDesc;
use image::ImageAspect;
use image::ImageDimensions; use image::ImageDimensions;
use image::ImageUsage; use image::ImageUsage;
use image::MipmapsCount; use image::MipmapsCount;
@ -286,6 +288,14 @@ impl UnsafeImage {
.limits() .limits()
.sampled_image_stencil_sample_counts(); .sampled_image_stencil_sample_counts();
} }
FormatTy::Ycbcr => {
/*
* VUID-VkImageCreateInfo-format-02562: If the image format is one of
* those formats requiring sampler ycbcr conversion, samples *must* be
* VK_SAMPLE_COUNT_1_BIT
*/
supported_samples &= vk::SAMPLE_COUNT_1_BIT;
}
} }
} }
@ -330,6 +340,13 @@ impl UnsafeImage {
.limits() .limits()
.framebuffer_stencil_sample_counts(); .framebuffer_stencil_sample_counts();
} }
FormatTy::Ycbcr => {
/*
* It's generally not possible to use a Ycbcr image as a framebuffer color
* attachment.
*/
return Err(ImageCreationError::UnsupportedUsage);
}
} }
} }
@ -737,6 +754,43 @@ impl UnsafeImage {
self.linear_layout_impl(mip_level, vk::IMAGE_ASPECT_STENCIL_BIT) self.linear_layout_impl(mip_level, vk::IMAGE_ASPECT_STENCIL_BIT)
} }
/// Same as `color_linear_layout`, except that it retrieves layout for the requested ycbcr
/// component too if the format is a YcbCr format.
///
/// # Panic
///
/// - Panics if plane aspect is out of range.
/// - Panics if the aspect is not a color or planar aspect.
/// - Panics if the number of mipmaps is not 1.
#[inline]
pub unsafe fn multiplane_color_layout(&self, aspect: ImageAspect) -> LinearLayout {
// This function only supports color and planar aspects currently.
let bits = aspect.to_aspect_bits();
let unsupported = bits
& !(vk::IMAGE_ASPECT_COLOR_BIT
| vk::IMAGE_ASPECT_PLANE_0_BIT
| vk::IMAGE_ASPECT_PLANE_1_BIT
| vk::IMAGE_ASPECT_PLANE_2_BIT);
assert!(unsupported == 0);
assert!(self.mipmaps == 1);
if bits
& (vk::IMAGE_ASPECT_PLANE_0_BIT
| vk::IMAGE_ASPECT_PLANE_1_BIT
| vk::IMAGE_ASPECT_PLANE_2_BIT)
!= 0
{
assert!(self.format.is_ycbcr());
if bits & vk::IMAGE_ASPECT_PLANE_2_BIT != 0 {
// Vulkano only supports NV12 and YV12 currently. If that changes, this will too.
assert!(self.format == Format::G8B8R8_3PLANE420Unorm);
}
}
self.linear_layout_impl(0, bits)
}
// Implementation of the `*_layout` functions. // Implementation of the `*_layout` functions.
unsafe fn linear_layout_impl(&self, mip_level: u32, aspect: u32) -> LinearLayout { unsafe fn linear_layout_impl(&self, mip_level: u32, aspect: u32) -> LinearLayout {
let vk = self.device.pointers(); let vk = self.device.pointers();
@ -1037,6 +1091,8 @@ impl UnsafeImageView {
FormatTy::Depth => vk::IMAGE_ASPECT_DEPTH_BIT, FormatTy::Depth => vk::IMAGE_ASPECT_DEPTH_BIT,
FormatTy::Stencil => vk::IMAGE_ASPECT_STENCIL_BIT, FormatTy::Stencil => vk::IMAGE_ASPECT_STENCIL_BIT,
FormatTy::DepthStencil => vk::IMAGE_ASPECT_DEPTH_BIT | vk::IMAGE_ASPECT_STENCIL_BIT, FormatTy::DepthStencil => vk::IMAGE_ASPECT_DEPTH_BIT | vk::IMAGE_ASPECT_STENCIL_BIT,
// Not yet supported --> would require changes to ImmutableImage API :-)
FormatTy::Ycbcr => panic!(),
}; };
let view_type = match ( let view_type = match (
@ -1132,7 +1188,8 @@ impl UnsafeImageView {
/// - Panics if trying to create a cubemap array with a number of array layers not a multiple /// - Panics if trying to create a cubemap array with a number of array layers not a multiple
/// of 6. /// of 6.
/// - Panics if the device or host ran out of memory. /// - Panics if the device or host ran out of memory.
/// /// - Panics if the image is a YcbCr image, since the Vulkano API is not yet flexible enough to
/// specify the aspect of image.
#[inline] #[inline]
pub unsafe fn new( pub unsafe fn new(
image: &UnsafeImage, image: &UnsafeImage,

View File

@ -17,12 +17,18 @@ use std::os::raw::c_void;
use std::ptr; use std::ptr;
use std::sync::Arc; use std::sync::Arc;
#[cfg(target_os = "linux")]
use std::fs::File;
#[cfg(target_os = "linux")]
use std::os::unix::io::FromRawFd;
use check_errors; use check_errors;
use device::Device; use device::Device;
use device::DeviceOwned; use device::DeviceOwned;
use instance::MemoryType; use instance::MemoryType;
use memory::Content; use memory::Content;
use memory::DedicatedAlloc; use memory::DedicatedAlloc;
use memory::ExternalMemoryHandleType;
use vk; use vk;
use Error; use Error;
use OomError; use OomError;
@ -48,6 +54,206 @@ pub struct DeviceMemory {
device: Arc<Device>, device: Arc<Device>,
size: usize, size: usize,
memory_type_index: u32, memory_type_index: u32,
handle_types: ExternalMemoryHandleType,
}
/// Represents a builder for the device memory object.
///
/// # Example
///
/// ```
/// use vulkano::memory::DeviceMemoryBuilder;
///
/// # let device: std::sync::Arc<vulkano::device::Device> = return;
/// let mem_ty = device.physical_device().memory_types().next().unwrap();
///
/// // Allocates 1KB of memory.
/// let memory = DeviceMemoryBuilder::new(device, mem_ty, 1024).build().unwrap();
/// ```
pub struct DeviceMemoryBuilder<'a> {
device: Arc<Device>,
memory_type: MemoryType<'a>,
allocate: vk::MemoryAllocateInfo,
dedicated_info: Option<vk::MemoryDedicatedAllocateInfoKHR>,
export_info: Option<vk::ExportMemoryAllocateInfo>,
import_info: Option<vk::ImportMemoryFdInfoKHR>,
handle_types: ExternalMemoryHandleType,
}
impl<'a> DeviceMemoryBuilder<'a> {
/// Returns a new `DeviceMemoryBuilder` given the required device, memory type and size fields.
///
/// # Panic
///
/// - Panics if `size` is 0.
/// - Panics if `memory_type` doesn't belong to the same physical device as `device`.
pub fn new(device: Arc<Device>, memory_type: MemoryType, size: usize) -> DeviceMemoryBuilder {
assert!(size > 0);
assert_eq!(
device.physical_device().internal_object(),
memory_type.physical_device().internal_object()
);
let allocate = vk::MemoryAllocateInfo {
sType: vk::STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
pNext: ptr::null(),
allocationSize: size as u64,
memoryTypeIndex: memory_type.id(),
};
DeviceMemoryBuilder {
device,
memory_type,
allocate,
dedicated_info: None,
export_info: None,
import_info: None,
handle_types: ExternalMemoryHandleType::none(),
}
}
/// Sets an optional field for dedicated allocations in the `DeviceMemoryBuilder`. To maintain
/// backwards compatibility, this function does nothing when dedicated allocation has not been
/// enabled on the device.
///
/// # Panic
///
/// - Panics if the dedicated allocation info has already been set.
pub fn dedicated_info(mut self, dedicated: DedicatedAlloc<'a>) -> DeviceMemoryBuilder {
assert!(self.dedicated_info.is_none());
if self.device.loaded_extensions().khr_dedicated_allocation {
self.dedicated_info = match dedicated {
DedicatedAlloc::Buffer(buffer) => Some(vk::MemoryDedicatedAllocateInfoKHR {
sType: vk::STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR,
pNext: ptr::null(),
image: 0,
buffer: buffer.internal_object(),
}),
DedicatedAlloc::Image(image) => Some(vk::MemoryDedicatedAllocateInfoKHR {
sType: vk::STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR,
pNext: ptr::null(),
image: image.internal_object(),
buffer: 0,
}),
DedicatedAlloc::None => return self,
};
let ptr = self
.dedicated_info
.as_ref()
.map(|i| i as *const vk::MemoryDedicatedAllocateInfoKHR)
.unwrap_or(ptr::null()) as *const _;
if let Some(ref mut export_info) = self.export_info {
export_info.pNext = ptr;
} else {
self.allocate.pNext = ptr;
}
}
self
}
/// Sets an optional field for exportable allocations in the `DeviceMemoryBuilder`.
///
/// # Panic
///
/// - Panics if the export info has already been set.
/// - Panics if the extensions associated with `handle_types` have not been loaded by the
/// by the device.
pub fn export_info(
mut self,
handle_types: ExternalMemoryHandleType,
) -> DeviceMemoryBuilder<'a> {
assert!(self.export_info.is_none());
// TODO: check exportFromImportedHandleTypes instead.
assert!(self.import_info.is_none());
// Only extensions tested with Vulkano so far.
assert!(self.device.loaded_extensions().khr_external_memory);
assert!(self.device.loaded_extensions().khr_external_memory_fd);
let handle_bits = handle_types.to_bits();
if handle_bits & vk::EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT == 0 {
assert!(self.device.loaded_extensions().ext_external_memory_dmabuf);
}
let unsupported = handle_bits
& !(vk::EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT
| vk::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT);
assert!(unsupported == 0);
let export_info = vk::ExportMemoryAllocateInfo {
sType: vk::STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO,
pNext: ptr::null(),
handleTypes: handle_bits,
};
self.export_info = Some(export_info);
let ptr = self
.export_info
.as_ref()
.map(|i| i as *const vk::ExportMemoryAllocateInfo)
.unwrap_or(ptr::null()) as *const _;
if let Some(ref mut dedicated_info) = self.dedicated_info {
dedicated_info.pNext = ptr;
} else {
self.allocate.pNext = ptr;
}
self.handle_types = handle_types;
self
}
/// Creates a `DeviceMemory` object on success, consuming the `DeviceMemoryBuilder`. An error
/// is returned if the requested allocation is too large or if the total number of allocations
/// would exceed per-device limits.
pub fn build(self) -> Result<DeviceMemory, DeviceMemoryAllocError> {
// Note: This check is disabled because MoltenVK doesn't report correct heap sizes yet.
// This check was re-enabled because Mesa aborts if `size` is Very Large.
//
// Conversions won't panic since it's based on `vkDeviceSize`, which is a u64 in the VK
// header. Not sure why we bother with usizes.
let reported_heap_size = self.memory_type.heap().size() as u64;
if reported_heap_size != 0 && self.allocate.allocationSize > reported_heap_size {
return Err(DeviceMemoryAllocError::OomError(
OomError::OutOfDeviceMemory,
));
}
let memory = unsafe {
let physical_device = self.device.physical_device();
let mut allocation_count = self
.device
.allocation_count()
.lock()
.expect("Poisoned mutex");
if *allocation_count >= physical_device.limits().max_memory_allocation_count() {
return Err(DeviceMemoryAllocError::TooManyObjects);
}
let vk = self.device.pointers();
let mut output = MaybeUninit::uninit();
check_errors(vk.AllocateMemory(
self.device.internal_object(),
&self.allocate,
ptr::null(),
output.as_mut_ptr(),
))?;
*allocation_count += 1;
output.assume_init()
};
Ok(DeviceMemory {
memory: memory,
device: self.device,
size: self.allocate.allocationSize as usize,
memory_type_index: self.memory_type.id(),
handle_types: self.handle_types,
})
}
} }
impl DeviceMemory { impl DeviceMemory {
@ -67,7 +273,7 @@ impl DeviceMemory {
memory_type: MemoryType, memory_type: MemoryType,
size: usize, size: usize,
) -> Result<DeviceMemory, DeviceMemoryAllocError> { ) -> Result<DeviceMemory, DeviceMemoryAllocError> {
DeviceMemory::dedicated_alloc(device, memory_type, size, DedicatedAlloc::None) DeviceMemoryBuilder::new(device, memory_type, size).build()
} }
/// Same as `alloc`, but allows specifying a resource that will be bound to the memory. /// Same as `alloc`, but allows specifying a resource that will be bound to the memory.
@ -84,77 +290,9 @@ impl DeviceMemory {
size: usize, size: usize,
resource: DedicatedAlloc, resource: DedicatedAlloc,
) -> Result<DeviceMemory, DeviceMemoryAllocError> { ) -> Result<DeviceMemory, DeviceMemoryAllocError> {
assert!(size >= 1); DeviceMemoryBuilder::new(device, memory_type, size)
assert_eq!( .dedicated_info(resource)
device.physical_device().internal_object(), .build()
memory_type.physical_device().internal_object()
);
// Note: This check is disabled because MoltenVK doesn't report correct heap sizes yet.
// This check was re-enabled because Mesa aborts if `size` is Very Large.
let reported_heap_size = memory_type.heap().size();
if reported_heap_size != 0 && size > reported_heap_size {
return Err(DeviceMemoryAllocError::OomError(
OomError::OutOfDeviceMemory,
));
}
let memory = unsafe {
let physical_device = device.physical_device();
let mut allocation_count = device.allocation_count().lock().expect("Poisoned mutex");
if *allocation_count >= physical_device.limits().max_memory_allocation_count() {
return Err(DeviceMemoryAllocError::TooManyObjects);
}
let vk = device.pointers();
// Decide whether we are going to pass a `vkMemoryDedicatedAllocateInfoKHR`.
let dedicated_alloc_info = if device.loaded_extensions().khr_dedicated_allocation {
match resource {
DedicatedAlloc::Buffer(buffer) => Some(vk::MemoryDedicatedAllocateInfoKHR {
sType: vk::STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR,
pNext: ptr::null(),
image: 0,
buffer: buffer.internal_object(),
}),
DedicatedAlloc::Image(image) => Some(vk::MemoryDedicatedAllocateInfoKHR {
sType: vk::STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR,
pNext: ptr::null(),
image: image.internal_object(),
buffer: 0,
}),
DedicatedAlloc::None => None,
}
} else {
None
};
let infos = vk::MemoryAllocateInfo {
sType: vk::STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
pNext: dedicated_alloc_info
.as_ref()
.map(|i| i as *const vk::MemoryDedicatedAllocateInfoKHR)
.unwrap_or(ptr::null()) as *const _,
allocationSize: size as u64,
memoryTypeIndex: memory_type.id(),
};
let mut output = MaybeUninit::uninit();
check_errors(vk.AllocateMemory(
device.internal_object(),
&infos,
ptr::null(),
output.as_mut_ptr(),
))?;
*allocation_count += 1;
output.assume_init()
};
Ok(DeviceMemory {
memory: memory,
device: device,
size: size,
memory_type_index: memory_type.id(),
})
} }
/// Allocates a chunk of memory and maps it. /// Allocates a chunk of memory and maps it.
@ -221,6 +359,48 @@ impl DeviceMemory {
pub fn size(&self) -> usize { pub fn size(&self) -> usize {
self.size self.size
} }
/// Exports the device memory into a Unix file descriptor. The caller retains ownership of the
/// file, as per the Vulkan spec.
///
/// # Panic
///
/// - Panics if the user requests an invalid handle type for this device memory object.
#[inline]
#[cfg(target_os = "linux")]
pub fn export_fd(
&self,
handle_type: ExternalMemoryHandleType,
) -> Result<File, DeviceMemoryAllocError> {
let vk = self.device.pointers();
let bits = handle_type.to_bits();
assert!(
bits == vk::EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT
|| bits == vk::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT
);
assert!(handle_type.to_bits() & self.handle_types.to_bits() != 0);
let fd = unsafe {
let info = vk::MemoryGetFdInfoKHR {
sType: vk::STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR,
pNext: ptr::null(),
memory: self.memory,
handleType: handle_type.to_bits(),
};
let mut output = MaybeUninit::uninit();
check_errors(vk.GetMemoryFdKHR(
self.device.internal_object(),
&info,
output.as_mut_ptr(),
))?;
output.assume_init()
};
let file = unsafe { File::from_raw_fd(fd) };
Ok(file)
}
} }
unsafe impl DeviceOwned for DeviceMemory { unsafe impl DeviceOwned for DeviceMemory {

View File

@ -0,0 +1,143 @@
// Copyright (c) 2020 The vulkano developers
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or https://opensource.org/licenses/MIT>,
// at your option. All files in the project carrying such
// notice may not be copied, modified, or distributed except
// according to those terms.
use std::ops::BitOr;
use vk;
/// Describes the handle type used for Vulkan external memory apis. This is **not** just a
/// suggestion. Check out vkExternalMemoryHandleTypeFlagBits in the Vulkan spec.
///
/// If you specify an handle type that doesnt make sense (for example, using a dma-buf handle type
/// on Windows) when using this handle, a panic will happen.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct ExternalMemoryHandleType {
pub opaque_fd: bool,
pub opaque_win32: bool,
pub opaque_win32_kmt: bool,
pub d3d11_texture: bool,
pub d3d11_texture_kmt: bool,
pub d3d12_heap: bool,
pub d3d12_resource: bool,
pub dma_buf: bool,
pub android_hardware_buffer: bool,
pub host_allocation: bool,
pub host_mapped_foreign_memory: bool,
}
impl ExternalMemoryHandleType {
/// Builds a `ExternalMemoryHandleType` with all values set to false. Useful as a default value.
///
/// # Example
///
/// ```rust
/// use vulkano::memory::ExternalMemoryHandleType as ExternalMemoryHandleType;
///
/// let _handle_type = ExternalMemoryHandleType {
/// opaque_fd: true,
/// .. ExternalMemoryHandleType::none()
/// };
/// ```
#[inline]
pub fn none() -> ExternalMemoryHandleType {
ExternalMemoryHandleType {
opaque_fd: false,
opaque_win32: false,
opaque_win32_kmt: false,
d3d11_texture: false,
d3d11_texture_kmt: false,
d3d12_heap: false,
d3d12_resource: false,
dma_buf: false,
android_hardware_buffer: false,
host_allocation: false,
host_mapped_foreign_memory: false,
}
}
#[inline]
pub(crate) fn to_bits(&self) -> vk::ExternalMemoryHandleTypeFlagBits {
let mut result = 0;
if self.opaque_fd {
result |= vk::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT;
}
if self.opaque_win32 {
result |= vk::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT;
}
if self.opaque_win32_kmt {
result |= vk::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT;
}
if self.d3d11_texture {
result |= vk::EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT;
}
if self.d3d11_texture_kmt {
result |= vk::EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT;
}
if self.d3d12_heap {
result |= vk::EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT;
}
if self.d3d12_resource {
result |= vk::EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT;
}
if self.dma_buf {
result |= vk::EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT;
}
if self.android_hardware_buffer {
result |= vk::EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID;
}
if self.host_allocation {
result |= vk::EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT;
}
if self.host_mapped_foreign_memory {
result |= vk::EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT
}
result
}
pub(crate) fn from_bits(val: u32) -> ExternalMemoryHandleType {
ExternalMemoryHandleType {
opaque_fd: (val & vk::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) != 0,
opaque_win32: (val & vk::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT) != 0,
opaque_win32_kmt: (val & vk::EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT) != 0,
d3d11_texture: (val & vk::EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT) != 0,
d3d11_texture_kmt: (val & vk::EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT) != 0,
d3d12_heap: (val & vk::EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT) != 0,
d3d12_resource: (val & vk::EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT) != 0,
dma_buf: (val & vk::EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT) != 0,
android_hardware_buffer: (val
& vk::EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID)
!= 0,
host_allocation: (val & vk::EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT) != 0,
host_mapped_foreign_memory: (val
& vk::EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT)
!= 0,
}
}
}
impl BitOr for ExternalMemoryHandleType {
type Output = Self;
#[inline]
fn bitor(self, rhs: Self) -> Self {
ExternalMemoryHandleType {
opaque_fd: self.opaque_fd || rhs.opaque_fd,
opaque_win32: self.opaque_win32 || rhs.opaque_win32,
opaque_win32_kmt: self.opaque_win32_kmt || rhs.opaque_win32_kmt,
d3d11_texture: self.d3d11_texture || rhs.d3d11_texture,
d3d11_texture_kmt: self.d3d11_texture_kmt || rhs.d3d11_texture_kmt,
d3d12_heap: self.d3d12_heap || rhs.d3d12_heap,
d3d12_resource: self.d3d12_resource || rhs.d3d12_resource,
dma_buf: self.dma_buf || rhs.dma_buf,
android_hardware_buffer: self.android_hardware_buffer || rhs.android_hardware_buffer,
host_allocation: self.host_allocation || rhs.host_allocation,
host_mapped_foreign_memory: self.host_mapped_foreign_memory
|| rhs.host_mapped_foreign_memory,
}
}
}

View File

@ -96,10 +96,13 @@ use vk;
pub use self::device_memory::CpuAccess; pub use self::device_memory::CpuAccess;
pub use self::device_memory::DeviceMemory; pub use self::device_memory::DeviceMemory;
pub use self::device_memory::DeviceMemoryAllocError; pub use self::device_memory::DeviceMemoryAllocError;
pub use self::device_memory::DeviceMemoryBuilder;
pub use self::device_memory::MappedDeviceMemory; pub use self::device_memory::MappedDeviceMemory;
pub use self::external_memory_handle_type::ExternalMemoryHandleType;
pub use self::pool::MemoryPool; pub use self::pool::MemoryPool;
mod device_memory; mod device_memory;
mod external_memory_handle_type;
pub mod pool; pub mod pool;
/// Represents requirements expressed by the Vulkan implementation when it comes to binding memory /// Represents requirements expressed by the Vulkan implementation when it comes to binding memory