Skip to content

Commit

Permalink
generator: Do not generate code for "disabled" extensions
Browse files Browse the repository at this point in the history
It is unlikely that disabled, reserved extensions (without naming
whatsoever) are used through Ash bindings generated from Vulkan-Headers
releases, and are best ignored to reduce diff noise and spurious issues
[1] with unfinished extension definitions.

This approach matches what is defined in the registry spec for
`supported="disabled"` [2]:

    use `supported="disabled"` to indicate this extension should never
    be processed.

[1]: KhronosGroup/Vulkan-Docs#1549
[2]: https://github.com/KhronosGroup/Vulkan-Docs/blob/b4e8cd820b2487bc892b391fb26b49501473a6a6/registry.txt#L1302-L1306
  • Loading branch information
MarijnS95 committed Jun 7, 2021
1 parent 06b4f8e commit e660827
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 3,278 deletions.
102 changes: 11 additions & 91 deletions ash/src/vk/const_debugs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,10 @@ impl fmt::Debug for AccelerationStructureCompatibilityKHR {
}
impl fmt::Debug for AccelerationStructureCreateFlagsKHR {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
(
AccelerationStructureCreateFlagsKHR::DEVICE_ADDRESS_CAPTURE_REPLAY.0,
"DEVICE_ADDRESS_CAPTURE_REPLAY",
),
(
AccelerationStructureCreateFlagsKHR::RESERVED_2_NV.0,
"RESERVED_2_NV",
),
];
const KNOWN: &[(Flags, &str)] = &[(
AccelerationStructureCreateFlagsKHR::DEVICE_ADDRESS_CAPTURE_REPLAY.0,
"DEVICE_ADDRESS_CAPTURE_REPLAY",
)];
debug_flags(f, KNOWN, self.0)
}
}
Expand Down Expand Up @@ -481,7 +475,6 @@ impl fmt::Debug for BufferCreateFlags {
(BufferCreateFlags::SPARSE_BINDING.0, "SPARSE_BINDING"),
(BufferCreateFlags::SPARSE_RESIDENCY.0, "SPARSE_RESIDENCY"),
(BufferCreateFlags::SPARSE_ALIASED.0, "SPARSE_ALIASED"),
(BufferCreateFlags::RESERVED_5_NV.0, "RESERVED_5_NV"),
(BufferCreateFlags::PROTECTED.0, "PROTECTED"),
(
BufferCreateFlags::DEVICE_ADDRESS_CAPTURE_REPLAY.0,
Expand Down Expand Up @@ -549,7 +542,6 @@ impl fmt::Debug for BufferUsageFlags {
BufferUsageFlags::SHADER_BINDING_TABLE_KHR.0,
"SHADER_BINDING_TABLE_KHR",
),
(BufferUsageFlags::RESERVED_18_QCOM.0, "RESERVED_18_QCOM"),
(
BufferUsageFlags::SHADER_DEVICE_ADDRESS.0,
"SHADER_DEVICE_ADDRESS",
Expand Down Expand Up @@ -587,10 +579,6 @@ impl fmt::Debug for BuildAccelerationStructureFlagsKHR {
BuildAccelerationStructureFlagsKHR::LOW_MEMORY.0,
"LOW_MEMORY",
),
(
BuildAccelerationStructureFlagsKHR::RESERVED_5_NV.0,
"RESERVED_5_NV",
),
];
debug_flags(f, KNOWN, self.0)
}
Expand Down Expand Up @@ -1021,7 +1009,6 @@ impl fmt::Debug for DescriptorBindingFlags {
DescriptorBindingFlags::VARIABLE_DESCRIPTOR_COUNT.0,
"VARIABLE_DESCRIPTOR_COUNT",
),
(DescriptorBindingFlags::RESERVED_4_QCOM.0, "RESERVED_4_QCOM"),
];
debug_flags(f, KNOWN, self.0)
}
Expand Down Expand Up @@ -1370,14 +1357,6 @@ impl fmt::Debug for ExternalFenceHandleTypeFlags {
"OPAQUE_WIN32_KMT",
),
(ExternalFenceHandleTypeFlags::SYNC_FD.0, "SYNC_FD"),
(
ExternalFenceHandleTypeFlags::RESERVED_4_NV.0,
"RESERVED_4_NV",
),
(
ExternalFenceHandleTypeFlags::RESERVED_5_NV.0,
"RESERVED_5_NV",
),
];
debug_flags(f, KNOWN, self.0)
}
Expand Down Expand Up @@ -1507,14 +1486,6 @@ impl fmt::Debug for ExternalSemaphoreHandleTypeFlags {
ExternalSemaphoreHandleTypeFlags::ZIRCON_EVENT_FUCHSIA.0,
"ZIRCON_EVENT_FUCHSIA",
),
(
ExternalSemaphoreHandleTypeFlags::RESERVED_5_NV.0,
"RESERVED_5_NV",
),
(
ExternalSemaphoreHandleTypeFlags::RESERVED_6_NV.0,
"RESERVED_6_NV",
),
];
debug_flags(f, KNOWN, self.0)
}
Expand Down Expand Up @@ -1756,36 +1727,6 @@ impl fmt::Debug for Format {
Self::ASTC_10X10_SFLOAT_BLOCK_EXT => Some("ASTC_10X10_SFLOAT_BLOCK_EXT"),
Self::ASTC_12X10_SFLOAT_BLOCK_EXT => Some("ASTC_12X10_SFLOAT_BLOCK_EXT"),
Self::ASTC_12X12_SFLOAT_BLOCK_EXT => Some("ASTC_12X12_SFLOAT_BLOCK_EXT"),
Self::ASTC_3X3X3_UNORM_BLOCK_EXT => Some("ASTC_3X3X3_UNORM_BLOCK_EXT"),
Self::ASTC_3X3X3_SRGB_BLOCK_EXT => Some("ASTC_3X3X3_SRGB_BLOCK_EXT"),
Self::ASTC_3X3X3_SFLOAT_BLOCK_EXT => Some("ASTC_3X3X3_SFLOAT_BLOCK_EXT"),
Self::ASTC_4X3X3_UNORM_BLOCK_EXT => Some("ASTC_4X3X3_UNORM_BLOCK_EXT"),
Self::ASTC_4X3X3_SRGB_BLOCK_EXT => Some("ASTC_4X3X3_SRGB_BLOCK_EXT"),
Self::ASTC_4X3X3_SFLOAT_BLOCK_EXT => Some("ASTC_4X3X3_SFLOAT_BLOCK_EXT"),
Self::ASTC_4X4X3_UNORM_BLOCK_EXT => Some("ASTC_4X4X3_UNORM_BLOCK_EXT"),
Self::ASTC_4X4X3_SRGB_BLOCK_EXT => Some("ASTC_4X4X3_SRGB_BLOCK_EXT"),
Self::ASTC_4X4X3_SFLOAT_BLOCK_EXT => Some("ASTC_4X4X3_SFLOAT_BLOCK_EXT"),
Self::ASTC_4X4X4_UNORM_BLOCK_EXT => Some("ASTC_4X4X4_UNORM_BLOCK_EXT"),
Self::ASTC_4X4X4_SRGB_BLOCK_EXT => Some("ASTC_4X4X4_SRGB_BLOCK_EXT"),
Self::ASTC_4X4X4_SFLOAT_BLOCK_EXT => Some("ASTC_4X4X4_SFLOAT_BLOCK_EXT"),
Self::ASTC_5X4X4_UNORM_BLOCK_EXT => Some("ASTC_5X4X4_UNORM_BLOCK_EXT"),
Self::ASTC_5X4X4_SRGB_BLOCK_EXT => Some("ASTC_5X4X4_SRGB_BLOCK_EXT"),
Self::ASTC_5X4X4_SFLOAT_BLOCK_EXT => Some("ASTC_5X4X4_SFLOAT_BLOCK_EXT"),
Self::ASTC_5X5X4_UNORM_BLOCK_EXT => Some("ASTC_5X5X4_UNORM_BLOCK_EXT"),
Self::ASTC_5X5X4_SRGB_BLOCK_EXT => Some("ASTC_5X5X4_SRGB_BLOCK_EXT"),
Self::ASTC_5X5X4_SFLOAT_BLOCK_EXT => Some("ASTC_5X5X4_SFLOAT_BLOCK_EXT"),
Self::ASTC_5X5X5_UNORM_BLOCK_EXT => Some("ASTC_5X5X5_UNORM_BLOCK_EXT"),
Self::ASTC_5X5X5_SRGB_BLOCK_EXT => Some("ASTC_5X5X5_SRGB_BLOCK_EXT"),
Self::ASTC_5X5X5_SFLOAT_BLOCK_EXT => Some("ASTC_5X5X5_SFLOAT_BLOCK_EXT"),
Self::ASTC_6X5X5_UNORM_BLOCK_EXT => Some("ASTC_6X5X5_UNORM_BLOCK_EXT"),
Self::ASTC_6X5X5_SRGB_BLOCK_EXT => Some("ASTC_6X5X5_SRGB_BLOCK_EXT"),
Self::ASTC_6X5X5_SFLOAT_BLOCK_EXT => Some("ASTC_6X5X5_SFLOAT_BLOCK_EXT"),
Self::ASTC_6X6X5_UNORM_BLOCK_EXT => Some("ASTC_6X6X5_UNORM_BLOCK_EXT"),
Self::ASTC_6X6X5_SRGB_BLOCK_EXT => Some("ASTC_6X6X5_SRGB_BLOCK_EXT"),
Self::ASTC_6X6X5_SFLOAT_BLOCK_EXT => Some("ASTC_6X6X5_SFLOAT_BLOCK_EXT"),
Self::ASTC_6X6X6_UNORM_BLOCK_EXT => Some("ASTC_6X6X6_UNORM_BLOCK_EXT"),
Self::ASTC_6X6X6_SRGB_BLOCK_EXT => Some("ASTC_6X6X6_SRGB_BLOCK_EXT"),
Self::ASTC_6X6X6_SFLOAT_BLOCK_EXT => Some("ASTC_6X6X6_SFLOAT_BLOCK_EXT"),
Self::G8_B8R8_2PLANE_444_UNORM_EXT => Some("G8_B8R8_2PLANE_444_UNORM_EXT"),
Self::G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT => {
Some("G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT")
Expand Down Expand Up @@ -2055,7 +1996,6 @@ impl fmt::Debug for ImageCreateFlags {
"SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_EXT",
),
(ImageCreateFlags::SUBSAMPLED_EXT.0, "SUBSAMPLED_EXT"),
(ImageCreateFlags::RESERVED_15_NV.0, "RESERVED_15_NV"),
(ImageCreateFlags::ALIAS.0, "ALIAS"),
(
ImageCreateFlags::SPLIT_INSTANCE_BIND_REGIONS.0,
Expand Down Expand Up @@ -2200,8 +2140,6 @@ impl fmt::Debug for ImageUsageFlags {
ImageUsageFlags::SHADING_RATE_IMAGE_NV.0,
"SHADING_RATE_IMAGE_NV",
),
(ImageUsageFlags::RESERVED_16_QCOM.0, "RESERVED_16_QCOM"),
(ImageUsageFlags::RESERVED_17_QCOM.0, "RESERVED_17_QCOM"),
(
ImageUsageFlags::FRAGMENT_DENSITY_MAP_EXT.0,
"FRAGMENT_DENSITY_MAP_EXT",
Expand Down Expand Up @@ -2392,7 +2330,6 @@ impl fmt::Debug for MemoryHeapFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
(MemoryHeapFlags::DEVICE_LOCAL.0, "DEVICE_LOCAL"),
(MemoryHeapFlags::RESERVED_2_KHR.0, "RESERVED_2_KHR"),
(MemoryHeapFlags::MULTI_INSTANCE.0, "MULTI_INSTANCE"),
];
debug_flags(f, KNOWN, self.0)
Expand Down Expand Up @@ -2677,14 +2614,10 @@ impl fmt::Debug for PipelineBindPoint {
}
impl fmt::Debug for PipelineCacheCreateFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
(PipelineCacheCreateFlags::RESERVED_1_EXT.0, "RESERVED_1_EXT"),
(
PipelineCacheCreateFlags::EXTERNALLY_SYNCHRONIZED_EXT.0,
"EXTERNALLY_SYNCHRONIZED_EXT",
),
(PipelineCacheCreateFlags::RESERVED_2_EXT.0, "RESERVED_2_EXT"),
];
const KNOWN: &[(Flags, &str)] = &[(
PipelineCacheCreateFlags::EXTERNALLY_SYNCHRONIZED_EXT.0,
"EXTERNALLY_SYNCHRONIZED_EXT",
)];
debug_flags(f, KNOWN, self.0)
}
}
Expand Down Expand Up @@ -2793,7 +2726,6 @@ impl fmt::Debug for PipelineCreateFlags {
PipelineCreateFlags::EARLY_RETURN_ON_FAILURE_EXT.0,
"EARLY_RETURN_ON_FAILURE_EXT",
),
(PipelineCreateFlags::RESERVED_20_NV.0, "RESERVED_20_NV"),
(
PipelineCreateFlags::VIEW_INDEX_FROM_DEVICE_INDEX.0,
"VIEW_INDEX_FROM_DEVICE_INDEX",
Expand Down Expand Up @@ -2898,10 +2830,6 @@ impl fmt::Debug for PipelineRasterizationStateStreamCreateFlagsEXT {
impl fmt::Debug for PipelineShaderStageCreateFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
(
PipelineShaderStageCreateFlags::RESERVED_2_NV.0,
"RESERVED_2_NV",
),
(
PipelineShaderStageCreateFlags::ALLOW_VARYING_SUBGROUP_SIZE_EXT.0,
"ALLOW_VARYING_SUBGROUP_SIZE_EXT",
Expand All @@ -2910,10 +2838,6 @@ impl fmt::Debug for PipelineShaderStageCreateFlags {
PipelineShaderStageCreateFlags::REQUIRE_FULL_SUBGROUPS_EXT.0,
"REQUIRE_FULL_SUBGROUPS_EXT",
),
(
PipelineShaderStageCreateFlags::RESERVED_3_KHR.0,
"RESERVED_3_KHR",
),
];
debug_flags(f, KNOWN, self.0)
}
Expand Down Expand Up @@ -3369,10 +3293,8 @@ impl fmt::Debug for RayTracingShaderGroupTypeKHR {
}
impl fmt::Debug for RenderPassCreateFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
(RenderPassCreateFlags::RESERVED_0_KHR.0, "RESERVED_0_KHR"),
(RenderPassCreateFlags::TRANSFORM_QCOM.0, "TRANSFORM_QCOM"),
];
const KNOWN: &[(Flags, &str)] =
&[(RenderPassCreateFlags::TRANSFORM_QCOM.0, "TRANSFORM_QCOM")];
debug_flags(f, KNOWN, self.0)
}
}
Expand Down Expand Up @@ -3655,8 +3577,7 @@ impl fmt::Debug for ShaderInfoTypeAMD {
}
impl fmt::Debug for ShaderModuleCreateFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] =
&[(ShaderModuleCreateFlags::RESERVED_0_NV.0, "RESERVED_0_NV")];
const KNOWN: &[(Flags, &str)] = &[];
debug_flags(f, KNOWN, self.0)
}
}
Expand Down Expand Up @@ -4628,7 +4549,6 @@ impl fmt::Debug for StructureType {
Self::DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV => {
Some("DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV")
}
Self::RESERVED_QCOM => Some("RESERVED_QCOM"),
Self::MEMORY_BARRIER_2_KHR => Some("MEMORY_BARRIER_2_KHR"),
Self::BUFFER_MEMORY_BARRIER_2_KHR => Some("BUFFER_MEMORY_BARRIER_2_KHR"),
Self::IMAGE_MEMORY_BARRIER_2_KHR => Some("IMAGE_MEMORY_BARRIER_2_KHR"),
Expand Down
Loading

0 comments on commit e660827

Please sign in to comment.