pub enum Capability {
AdvancedBlend,
FloatRenderTargets,
}Expand description
A capability a context can be asked to do without.
One variant per Capabilities field it withholds, named for that field.
Exists so a test can obtain a context that lacks something the device has,
and so exercise a refusal on any machine rather than only on hardware that
happens to lack it. Several tests here could previously only run where the
capability was genuinely absent, and one of them said so: “on a machine where
both have it there is nothing here to check”.
Withholding only. There is no way to grant a capability a device has not
got, and that is a soundness property rather than a matter of taste: a Vulkan
device is created without
VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT when the capability is
false, so a granted flag would have pipelines built with advanced blend
operations against a device that never enabled the feature. See Withheld,
whose name is the other half of saying this.
Deliberately not #[non_exhaustive]. Each backend maps this with an
exhaustive match, and since the backends are separate crates a wildcard arm
would let them drift apart – one honoring a new variant and the other
silently ignoring it. The cost is that adding a variant is a breaking change
for anything downstream that matches on it, which is accepted because this is
test-support vocabulary.