pub enum Capability {
Show 24 variants
BufferFillZero,
ImageToImageCopy,
DepthImageCopy,
MsaaResolveAttachment,
StencilReference,
DrawIndirectCount,
IndirectArgumentPaddedStride,
MeshShading,
TaskShaderStage,
UpdateBindGroup,
PushConstants,
BindlessDescriptorArray,
StorageImageBinding,
PolygonModeLine,
DepthClamp,
SamplerAnisotropy,
TimestampQuery,
OcclusionQuery,
PipelineStatisticsQuery,
TimelineSemaphore,
BinarySemaphore,
CpuTimelineWait,
CpuTimelineSignal,
TimelineWaitBeforeSignal,
}Expand description
One seam behaviour a backend either performs or refuses.
Every variant exists because some backend refuses it. See the
module docs for what is deliberately not modelled, and
Device::supports for how a backend
answers.
Adding a variant is a compile error in every backend until it says
what it does — that is the whole point, and it is why this is an
enum and not another Features bit.
Variants§
BufferFillZero
Every backend answers Yes, and it is kept anyway. This enum covers
what the seam does rather than only what backends disagree about, so a
capability with no DIVERGENCES row is the shape a settled one takes —
and the agnostic suite still drives it, which is what would notice a
backend quietly dropping the call.
It had two valued siblings until 2026-08-19,
BufferFillRepeatedByte and BufferFillWord. They described how badly
each backend could keep a promise the seam should not have made: Metal’s
fill repeats a byte and WebGPU has no valued fill at all, so three of
five had to refuse most values. The verb lost its value instead — see
clear_buffer — and both rows
went with it.
ImageToImageCopy
Both sides are texture locations with their own subresource and region, which is a different call from the buffer↔image copies and is refused separately where it is refused at all.
DepthImageCopy
A buffer↔image copy —
copy_image_to_buffer or
copy_buffer_to_image —
whose image carries a depth or depth-stencil format and whose
subresource names ImageAspect::DEPTH.
Separate from the colour copies every backend performs, because a depth
image is not one plane of one type. An API that stores a sampled depth
texture typeless needs the plane and a fully typed footprint chosen at
the copy itself, and BufferImageCopy carries
neither — so a backend can copy every colour format and still have no
expression for this one.
It is what a shadow atlas is read back through, which is why it is worth declaring rather than discovering: without it there is no way to show that a shadow pass wrote anything, and a shadow pass that wrote nothing renders a frame in which every surface is lit and nothing looks wrong.
WHICH depth format and WHICH direction remains the API’s own rule.
This asks whether a backend has an expression for the copy at all; a
backend answering Support::Yes still refuses the pairs its API’s
format table withholds, by name and at the call. WebGPU is the one that
withholds any — and wgpu enforces the same table, so both backends on
it agree: the depth plane of Format::D32Float,
D32FloatS8Uint and
D16Unorm copies out to a buffer, only
D16Unorm’s copies back in, and
D24UnormS8Uint’s copies neither way,
because WebGPU’s depth24plus is whatever the driver chose to store and
so has no memory layout to lay a buffer out against. The readback a
shadow atlas needs is inside every one of those.
MsaaResolveAttachment
A ColorAttachment::resolve view: the
pass resolves its multisampled colour target into a single-sampled one as
it ends.
StencilReference
set_stencil_reference —
the dynamic stencil reference value subsequent draws compare against.
The claim is the whole rule, not just that the call is wired. A
backend declaring this says the reference is pass state that survives a
pipeline bind, and that a pass which never calls it draws against
stencil::INITIAL_REFERENCE; see
StencilState on why there is no pipeline-side
reference to compete with it.
DrawIndirectCount
draw_indirect_count and
its indexed sibling: the draw count is read from a GPU buffer, so the
CPU never learns how many draws a pass emits.
Features::DRAW_INDIRECT_COUNT
is the flag a caller requests; this is the backend’s answer about the two
encoder methods, which is not the same claim — a backend can report the
flag without having wired the calls up, and Metal reports it clear and
refuses the calls for a reason that is not about any one device.
IndirectArgumentPaddedStride
DrawIndirect::stride larger than the
argument structure: the arguments are padded in the buffer rather
than tightly packed.
Distinct from drawing indirectly at all. Vulkan’s vkCmdDrawIndirect
takes a stride and honours it, D3D12 builds an ID3D12CommandSignature
per stride, crcbl_mtl::indirect_count walks the structures itself, and
crcbl-webgpu’s replayer unrolls the draw into one drawIndirect per
structure at offset + i * stride — an API with no stride parameter can
still honour one, and the Yes says it does rather than that the
parameter exists.
The stride a caller may ask for is every API’s stride, not this
seam’s. All four want a multiple of 4 that is at least the argument
structure’s own width, because all four ultimately address the buffer in
words: Vulkan says so in vkCmdDrawIndirect’s own rule for a
drawCount above one, and WebGPU says so as indirectOffset being a
multiple of 4, which offset + i * stride only stays for a stride that
is one too. Nothing this declaration promises makes a stride of 14 legal
anywhere.
MeshShading
The mesh-shading path: a MeshPipelineDesc
can be created and
draw_mesh_tasks and
draw_mesh_tasks_indirect
recorded against it.
One capability rather than three, because the seam already states the
tie: draw_mesh_tasks_indirect “requires
Features::MESH_SHADER and nothing more
… a device that can launch this stage at all can launch it from memory”,
and no backend refuses the pipeline while admitting the draw or the
reverse.
TaskShaderStage
The amplification stage in front of a mesh shader —
MeshPipelineDesc::task is Some.
Separately optional from MeshShading for the same
reason Features::TASK_SHADER is a
separate flag: a mesh shader works with a workgroup count computed
elsewhere, and this stage is only what moves that decision into the draw.
UpdateBindGroup
update_bind_group: rewriting an
already-created bind group’s entries in place.
The update-after-bind model, and what a bindless texture table is restreamed through. WebGPU bind groups are immutable once created, so a backend on it can only rebuild the group.
A backend answers whether it has the operation at all. Vulkan
additionally requires the individual layout to carry
BindingFlags::UPDATE_AFTER_BIND,
which is a property of the layout the caller built rather than of the
device, and is refused per call.
PushConstants
push_constants and the
PipelineLayoutDesc::push_constants
range they are written through.
The seam requires the refusal at pipeline-layout creation, not at the write, so a caller finds out once rather than losing writes silently every frame.
BindlessDescriptorArray
A runtime-sized descriptor array — a
BindGroupLayoutEntry carrying
BindingFlags, and the
BindGroupDesc::variable_count
that chooses its length.
What BindingModel::Bindless is built
on. A backend binding flat argument tables has fixed-size arrays and no
way to express this, which is a different answer from having no arrays.
StorageImageBinding
A BindingKind::StorageImage entry
in a bind group layout.
Its own capability because some implementations need the texel format and view dimension in the layout, which the seam only carries on the image view — so the layout cannot be built at all, rather than the binding merely being slower.
PolygonModeLine
PolygonMode::Line — wireframe fill.
DepthClamp
Depth clamping rather than clipping, for shadow casters behind the near plane.
SamplerAnisotropy
A SamplerDesc with anisotropy above 1.0.
TimestampQuery
A QueryKind::Timestamp query set, the
PassTimestampWrites that fill it
and the query_results that read it.
OcclusionQuery
A QueryKind::Occlusion query set.
No backend has it, and the reason is the seam’s rather than any
API’s: NO_OCCLUSION_QUERY_VERB. Every GPU backend carries a
DivergenceKind::Unwritten row here, which is what it costs to say so
honestly.
PipelineStatisticsQuery
A QueryKind::PipelineStatistics
query set.
Three query variants rather than one, because the three are refused
separately: a device answers each of
Features::TIMESTAMP_QUERY,
OCCLUSION_QUERY and
PIPELINE_STATISTICS_QUERY
independently, and folding them would let a backend with only timestamps
claim the lot.
TimelineSemaphore
SemaphoreKind::Timeline: a monotonic
u64 counter a submission signals and both GPU and CPU can observe.
The claim is the observable one — that
semaphore_value reports the counter
advancing as submissions complete. A backend that hands out a handle
whose value never moves has not got this, whatever its return codes say.
BinarySemaphore
SemaphoreKind::Binary: the one-shot,
GPU-only signal WSI acquire/present needs.
Apart from TimelineSemaphore deliberately. A
device may have no timeline and must still hand out a binary one, because
the swapchain is where they come from — and a backend that refused both
would pass every test that only checks the timeline half.
CpuTimelineWait
wait_semaphores: the CPU blocking
until a timeline reaches a value.
Distinct from creating one. A backend can hand out a counter a submission signals while having no host-side wait to offer, which is what a fence-shaped API looks like before its wait half is wired up.
CpuTimelineSignal
signal_semaphore: the CPU
advancing a timeline, rather than a submission.
Its own capability for the same reason
CpuTimelineWait is: the two host-side halves
are separable. A backend that emulates a timeline over per-submission
completion could move a counter on demand and still have no queue-side
wait to pair it with, and one with a real semaphore object has both.
The claim is the observable one — that
semaphore_value reports the value the
host asked for, and that a value which would move the timeline backwards
is refused rather than accepted.
TimelineWaitBeforeSignal
Waiting — from the CPU, or in a SubmitInfo — on a
timeline value that nothing submitted so far will signal, expecting
a later signal to satisfy it.
A real semaphore object blocks until somebody signals it, and
CpuTimelineSignal is what lets the host be
the somebody. A backend that emulates timelines over per-submission
completion has no object for a future signal to arrive on, so such a wait
could only ever stop the queue; refusing is the honest answer and it is a
genuine behavioural divergence rather than a missing call.
Implementations§
Source§impl Capability
impl Capability
Source§impl Capability
impl Capability
Sourcepub const fn gating_feature(self) -> Option<Features>
pub const fn gating_feature(self) -> Option<Features>
The Features bit a caller consults before asking for this, if there
is one.
What makes the parity rule fair. A backend that refuses because the
device reports this flag clear has not diverged from anything — the
device is simply lesser, which is exactly what Features already
models and logs as a downgrade.
It is the claim to be in that position that this flag settles.
Support::granted is what puts a backend there, and
parity_verdict checks the claim against the device before excusing
it: a Support::NotOnThisDevice for a capability with no gate, or on a
device that reports the gate, is
ParityVerdict::FalseDeviceGate. What the flag no longer does is
excuse a refusal the backend made on its own account, which is how the
rule used to retire DIVERGENCES rows without anybody deciding to.
None means no flag governs it, so every refusal is the backend’s own.
That is the majority here, and it is the measurement this module was
built from: most refusal sites answer to no declared capability at all.