Skip to content

vkprofiles: Add the capability block 'depends' condition - #1111

Closed
christophe-lunarg wants to merge 14 commits into
mainfrom
capability-block-depends
Closed

christophe-lunarg wants to merge 14 commits into
mainfrom
capability-block-depends

Conversation

@christophe-lunarg

Copy link
Copy Markdown
Collaborator

Support the 'depends' condition of capability blocks of the profiles schema 0.8.3 (#1090). The capability block requirements only apply to the devices satisfying the condition, written with the vk.xml 'depends' expression syntax.

  • vkprofiles: validate the conditions, keep the capability blocks with a condition separate in transform, extract and consolidate, skip them in combine, and download the schemas from the Khronos-Schemas 'capability-block-depends' branch until it is merged
  • Library: evaluate the conditions on the physical device for the device support checks and vpCreateDevice
  • Layer: load the capability blocks with a condition satisfied by the simulated device, after the other capability blocks
  • Roadmap 2026: require pipelineProtectedAccess when protectedMemory is supported
  • Document the conditions and add TODO.md for the remaining work

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build queued with queue ID 202774.

1 similar comment
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build queued with queue ID 202774.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build # 4809 running.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build # 4809 passed.

@christophe-lunarg
christophe-lunarg marked this pull request as draft November 17, 2026 21:36
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build queued with queue ID 203501.

1 similar comment
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build queued with queue ID 203501.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build # 4815 running.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build # 4815 passed.

@christophe-lunarg
christophe-lunarg marked this pull request as ready for review November 18, 2026 14:58
@christophe-lunarg christophe-lunarg linked an issue Nov 18, 2026 that may be closed by this pull request
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build queued with queue ID 205444.

1 similar comment
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build queued with queue ID 205444.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build # 4818 running.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build # 4818 failed.

Support the 'depends' condition of capability blocks of the profiles
schema 0.8.3 (#1090). The capability block requirements only apply to the
devices satisfying the condition, written with the vk.xml 'depends'
expression syntax.

- vkprofiles: validate the conditions, keep the capability blocks with a
  condition separate in transform, extract and consolidate, skip them in
  combine, and download the schemas from the Khronos-Schemas
  'capability-block-depends' branch until it is merged
- Library: evaluate the conditions on the physical device for the device
  support checks and vpCreateDevice
- Layer: load the capability blocks with a condition satisfied by the
  simulated device, after the other capability blocks
- Roadmap 2026: require pipelineProtectedAccess when protectedMemory is
  supported
- Document the conditions and add TODO.md for the remaining work
…l depends

Add the 'depends' pull bit: with 'requirements', the properties of the
unconditional capability blocks contradicting a Vulkan core requirement
of the devices not supporting a capability the profile doesn't require
are extracted into capability blocks with a 'depends' condition on that
capability. The unconditional property keeps the value of the devices
not supporting the capability. Use it to generate the desktop and
Android profiles.

Compare the capability blocks with the same 'depends' condition with
combine --mode difference.

Convert VP_LUNARG_minimum_requirements_1_4 to capability blocks with a
'depends' condition, checked against the VulkanObject conditional
requirements.

Document that the Roadmap profiles come from the Vulkan-Headers registry
in profiles/CMakeLists.txt.
…condition

Add the 'depends' strip bit: the capability blocks with a 'depends'
condition the profile doesn't satisfy are removed, and the features and
properties whose Vulkan core requirement depends on a condition the
profile doesn't satisfy are set to the value of the devices not
satisfying it, the Vulkan core value of these devices or the value of
an unsupported capability, or removed without such a value. Strip the
desktop profiles with it.

Without a Vulkan core value for the devices not supporting a capability,
--pull depends uses the value of an unsupported property, e.g. false for
the 'max' shaderSignedZeroInfNanPreserveFloat16 property which depends
on shaderFloat16.

Report the properties contradicting the value of the devices not
supporting a capability the profile doesn't require with validate
--analyse depends, and analyse the combined desktop baseline profiles
with all the analysis checks before transforming them.

Document the 'depends' condition, the checking of the GPUInfo.org device
reports, and the Android and Roadmap profiles in the whitepaper.
…sues

Fix the known issues of the GPUInfo.org device reports with validate
--apply-workarounds, in place or in copies written to the --output
directory, leaving the input reports unchanged. Each workaround has its
own value, and --apply-workarounds without values applies all of them:
- driver-id: sets the driverID from the driverName for the drivers
  unknown to the exporter, and removes the '_KHR' suffix of the driver
  IDs without a '_KHR' alias, e.g. VK_DRIVER_ID_MOLTENVK_KHR.
- 64-bit-strings: converts to numbers the 64-bit integers written as
  strings.
- flags-as-numbers: converts to flag bit names the flags written as
  numbers or numeric strings.
- enums-as-numbers: converts to enum value names the extension enum
  values written as numbers, e.g. the image layouts of
  VkPhysicalDeviceHostImageCopyPropertiesEXT.

Each applied change is logged at the info level. With --output, the
--analyse checks run on the copies after the workarounds.

The validate_desktop_baseline_*_reports graph nodes write the fixed
copies of the device reports to profiles/build/reports, validate them,
and run all the analysis checks except 'unratified' to discover the
issues without a workaround yet.
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build # 4819 passed.

…--analyse aliases

The aliases check compared the member values as JSON values, so an enum
value name and its alias, e.g. VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE
in VkPhysicalDeviceVulkan12Properties and
VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE_KHR in
VkPhysicalDeviceFloatControlsPropertiesKHR, were reported as mismatching.

Resolve the enum value names and the flag bit names to their integer
values in vk.xml, using the member type of the structure, including the
aliased types and value names, and compare these integers. The names
which aren't values of the member type are still compared as JSON
values.
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build queued with queue ID 205777.

1 similar comment
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build queued with queue ID 205777.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build # 4820 running.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build # 4820 passed.

…able value

The aliased property members of some device reports have mismatching
values, e.g. every integerDotProduct*Accelerated member true in
VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR while most are
false in VkPhysicalDeviceVulkan13Properties, including on GPUs without
dot product instructions, in the 2022 to 2024 reports.

Add the 'mismatching-aliases' workaround, which sets these members to
their least capable value following their limittype in vk.xml,
considering the capability not reliable enough to be supported: false
or the smallest value for 'max', the largest value for 'min', the flag
bits set in every member for 'bitmask', and the intersection for
'range'. The members with an 'exact' or 'noauto' limittype are ignored.
It runs last, so that the values are compared once written as expected.

Add the 'mismatching-aliases-extra' workaround, which sets to false the
mismatching VkBool32 members with an 'exact' limittype, e.g.
uniformTexelBufferOffsetSingleTexelAlignment.
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build queued with queue ID 205926.

1 similar comment
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build queued with queue ID 205926.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build # 4821 running.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build # 4821 passed.

…ore value

Some device reports have the properties of a feature the device doesn't
support, e.g. the geometry shader limits of Apple and llvmpipe devices
without geometryShader, or the descriptor indexing limits of older GPUs
without descriptorIndexing.

Only report with validate --analyse depends the properties with a Vulkan
core value for the devices not supporting the feature, a '!condition'
requirement, e.g. 0 for maxGeometryShaderInvocations without
geometryShader. The value of an unsupported property derived from its
limittype, e.g. false for shaderSignedZeroInfNanPreserveFloat16 without
shaderFloat16, isn't a requirement of these devices. transform --pull
depends still uses it.

Add the 'unsupported-feature-properties' workaround, which sets the
properties that validate --analyse depends reports to that core value.
It runs after the 'mismatching-aliases' workaround, so that the aliased
properties have a single value.
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build queued with queue ID 205977.

1 similar comment
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build queued with queue ID 205977.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build # 4822 running.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build # 4822 passed.

…tersection

combine --mode union and --mode intersection skipped the capability
blocks with a 'depends' condition with a warning.

Combine them by condition, into a capability block with the same
condition. For the devices satisfying a condition, the requirements of
a profile are its unconditional blocks merged with its blocks with that
condition, or only its unconditional blocks without such a block. These
requirements are combined like the unconditional blocks, the least
capable values for an intersection and the most capable values for a
union, and the values which differ from the combined unconditional
block are written to the block. When the combined unconditional
features satisfy the condition, the values are merged into the
unconditional block instead.

An intersection also combines the requirements for the devices
satisfying several conditions, in a block with the conjunction of the
conditions, e.g. 'A+B' for the condition 'A' of a profile and 'B' of
another profile. A union keeps a block per condition: a device
satisfying only one condition doesn't have to satisfy the requirements
of the other condition, so the disjunction of the conditions would
require too much.

The conditions are compared once their feature structures are
canonicalized for the profile API version.
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build queued with queue ID 206036.

1 similar comment
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build queued with queue ID 206036.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build # 4823 running.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build # 4823 passed.

GetFeatureValue now reads the structure TransferValue keeps after loading:
a condition naming a promoted structure reads VkPhysicalDeviceVulkan1XFeatures
when the profile wrote it, and a condition naming
VkPhysicalDeviceVulkan1XFeatures reads the promoted structures otherwise.

Also transfer the core VkPhysicalDeviceProtectedMemoryFeatures and
VkPhysicalDeviceShaderDrawParametersFeatures structures, which were never
synchronized with VkPhysicalDeviceVulkan11Features.
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build queued with queue ID 206643.

1 similar comment
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build queued with queue ID 206643.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build queued with queue ID 206655.

1 similar comment
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build queued with queue ID 206655.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build # 4825 running.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI VulkanProfiles build # 4825 passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vkprofiles: Add "depends" support

2 participants