Translator: the resident-table domains' encoder-operation lowering goes; object words stay
What: lower/access/encode.rs goes. It lowered a function's indirect-command encoder operations
under the resident-table domains, writing the binder's records and their written flags. What it
held that is still used moves to lower/access/object.rs:
- an argument buffer's command-buffer or pipeline-state member read as its word (ObjectWord);
- the plan that admits such a load only as an encoder operand.
Every encoder operation is now refused, `Unsupported{GpuEncodedIndirectCommands,
NotImplemented}`, except those the identity domains' icb.rs lowers: a render command's buffer
setters, its indexed triangle draw and a reset. icb.rs is selected first, as before. The other
deletions follow from that:
- indirect_commands.rs drops CommandEncoderOperation's per-operation policy table;
- lower/access/dynamic.rs drops the resident-set search and address helpers only encode.rs
called (plan_search, plan_address, search_start, plain_base);
- the error doc of the depth-stencil argument names the setters' refusal;
- engine_indirect_commands.rs keeps two tests: every encoder operation refused under the
resident-table domains on every committed profile and Profile F, and a depth-stencil member
compiled unread and refused read. engine_handles.rs expects the refusal where a pipeline-state
member is a command's operand;
- the command-writes interface test now takes icbcut's indexed kernel (icb_indexed_16) under the
identity domains, plus the template that takes no command buffer;
- the authored census integration test expects the encoding case's refusal on both forms;
- docs/API.md's indirect-command section says which domain refuses what;
- docs/REFUSALS.md is regenerated.
Why: rule 4 (small) and rule 2 (one form). The runtime compiles under the identity domains, where
this lowering never ran. Under the resident-table domains, the validation executor's alone, it was
a second form of GPU-encoded commands that no consumer path takes.
No public item changes (indirect_commands is pub(crate); api_signatures.tsv is unchanged).
Versions: SEMANTICS_VERSION 2255 -> 2256 (a placeholder; the landing sets the number), because the
resident-table domains refuse what they lowered. Under the identity domains no output changes.
Verified (jobs at this commit's tree less the runtime README edit below it, 4606692494, or at the
next commit's, the runtime-sources pin, 4e9e857f8c):
- m3-max-63058 at the pin: fmt, clippy, clippy --cfg m2v_gpu, clippy --cfg m2v_cpu_icd, Rustdoc
-D warnings and scripts/api-docs, all rc 0 (peak 7.5 GiB);
- m3-max-63040, the validation suite at this commit: 1359 of 1360 passed, the one failure the
runtime guard, which the next commit pins;
- m3-max-63057, the metal2vulkan and metal2vulkan-runtime suites and doctests at the pin: 3349 of
3360 passed. The failures are the render key, the AIR printout and the golden table (bless due
at development's next pin) and the engine inventory's 8 parts: 2,142 cells moved, 0 rows new or
gone, of which 1,342 are the storage forms' removal below this commit (ilock, m3-max-63032) and
800 are this commit's, the resident-table encoder operations now refused: m3-max-63151, the
parts with every difference printed, names them as 50 entries on all 16 profiles, each
ok -> Unsupported{GpuEncodedIndirectCommands; NotImplemented}, in 31 fixtures, every entry a
kernel that encodes indirect commands (26 engine/icb_* and 3 kernel_icb_* fixtures,
resident_draws.ll's rd_encode and mesh_commands.ll's six enc_* kernels); the other 1,342 are
ilock's, class for class. The inventory compiles under RESIDENT_TABLES
(spirv::testing::committed_profiles), and its bless runs on macOS only (bless_engine_inventory
refuses without every assembler, m3-max-63084);
- docs/REFUSALS.md regenerated by scripts/refusal-surface/refusal_surface.py;
- no states-only play: the runtime compiles under the identity domains, whose output this commit is
expected not to change. That is read from the code: icb.rs, the identity lowering, is untouched
and still selected first. It is not measured, because the golden table's every cell is re-keyed
until development's bless. ilock and this commit report the same staleness: 29,792 cells,
m3-max-63032 and 63057.
This commit is contained in:
1 parent
cbb1922b4d
commit
20ae73f152
21 files changed
+419
-3967
No files matched your search
@@ -24,8 +24,7 @@ use crate::ir::{Call, Callee, Const, FuncId, InstKind, Module, ModuleParts, Valu
|
||||
/// A draw's primitive type (`draw_primitives` and `draw_indexed_primitives`) counts as the value
|
||||
/// its operand holds where that is a constant of Metal's five (`MTLPrimitiveType`'s raw values,
|
||||
/// bit `n` for value `n`), as a point draw where it is a constant past them (Metal's encoding
|
||||
/// writes one so: the translator's `lower::access::encode`), and as all five where it is anything
|
||||
/// else. A call the walk cannot see
|
||||
/// writes one so), and as all five where it is anything else. A call the walk cannot see
|
||||
/// into (an indirect call, an intrinsic outside the closed set, a call to a declaration other
|
||||
/// than the entry's control-point functions) may write anything: [`CommandWrites::ANY`].
|
||||
/// Records the function does not write are not its own fact: a command buffer's other writers
|
||||
|
||||
@@ -112,8 +112,7 @@ impl CommandEncoderOperation {
|
||||
// A draw needs a render descriptor whose records hold its kind: primitives every render
|
||||
// buffer's, indexed draws an indexed or a patch buffer's, patch and indexed patch draws a
|
||||
// patch buffer's, mesh draws a buffer of either mesh kind's. A draw of primitives on a
|
||||
// buffer of mesh draws alone writes too: Metal draws nothing for it, and the product's
|
||||
// lowering drops it (`dropped_on`).
|
||||
// buffer of mesh draws alone writes too: Metal draws nothing for it.
|
||||
let patch_records = DRAW_PATCHES | DRAW_INDEXED_PATCHES;
|
||||
let mesh_records = DRAW_MESH_THREADGROUPS | DRAW_MESH_THREADS;
|
||||
let draw = |any| Policy {
|
||||
@@ -267,15 +266,15 @@ fn header_field_of(body: &mut String, records: &str, name: &str, word: usize, ty
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
/// A copy's checks beyond the destination's policy, as the product's lowering makes them
|
||||
/// (`lower::access::encode`), into `%valid4` from `valid`: the source command (`%source_command`)
|
||||
/// is below the capacity of the source's header (`%source_records`), and either the two headers
|
||||
/// A copy's checks beyond the destination's policy, into `%valid4` from `valid`: the source
|
||||
/// command (`%source_command`) is below the capacity of the source's header (`%source_records`),
|
||||
/// and either the two headers
|
||||
/// are of equal descriptors (policy bits and binding counts), or the destination inherits its
|
||||
/// pipeline and buffers from a source that inherits neither, of the same descriptor otherwise,
|
||||
/// the destination binding no kernel buffer, onto a command other than 0. Metal's copy between
|
||||
/// any other descriptors depends on its private record layout, and its copy onto an inheriting
|
||||
/// buffer's command 0 runs that command with zero grid sizes (M3 Max and M4), so the guard faults
|
||||
/// them as the lowering does.
|
||||
/// them.
|
||||
fn emit_copy_checks(body: &mut String, typed: bool, valid: &str) {
|
||||
use std::fmt::Write;
|
||||
let pointer = if typed {
|
||||
|
||||
@@ -262,11 +262,12 @@ fn corpus_with_templates(name: &str) -> (ScratchDir, metal2vulkan_validation::ca
|
||||
}
|
||||
|
||||
/// The executor's requests for a case whose executed compute command buffer the device replay
|
||||
/// runs: on a profile with device addresses, the case's pipeline and each registered variant
|
||||
/// compile in the worker; on one without, the command buffer is host-replayed and only the case's
|
||||
/// own pipeline is compiled. A render command buffer is always host-replayed. Both devices take
|
||||
/// the resident-table domains, the executor's own context's, which run the command buffers the
|
||||
/// identity domains refuse.
|
||||
/// runs: on a profile with device addresses, the case's pipeline and each registered variant; on
|
||||
/// one without, the command buffer is host-replayed and only the case's own pipeline. A render
|
||||
/// command buffer is always host-replayed. Both devices take the resident-table domains, the
|
||||
/// executor's own context's, which runs the command buffers. The case's kernel encodes commands,
|
||||
/// which no device lowers (`GpuEncodedIndirectCommands`), so its cell is that refusal on both, with
|
||||
/// no digest.
|
||||
#[test]
|
||||
fn case_compiles_lists_the_replay_variants_where_the_device_replay_runs() {
|
||||
use metal2vulkan_validation::authored_compile::compile_prepared;
|
||||
@@ -320,23 +321,17 @@ fn case_compiles_lists_the_replay_variants_where_the_device_replay_runs() {
|
||||
assert!(on_device.compiles[1..]
|
||||
.iter()
|
||||
.all(|compile| matches!(compile.subject, CompileSubject::ReplayVariant { .. })));
|
||||
let refused = Ok(CellOutcome::Refused(
|
||||
"not_supported{unsupported:not_implemented GpuEncodedIndirectCommands}".into(),
|
||||
));
|
||||
let cell = compile_prepared(&compute, &worker, &lavapipe);
|
||||
assert_eq!(cell.outcome, Ok(CellOutcome::Compiled), "{cell:?}");
|
||||
assert_eq!(cell.compiles, on_device.compiles.len());
|
||||
// What a run executes there is digested: the case, each variant, and the preprocess module; the
|
||||
// same compiles digest the same.
|
||||
let digest = cell
|
||||
.artifact
|
||||
.clone()
|
||||
.expect("a device-replayed case's digest");
|
||||
let again = compile_prepared(&compute, &worker, &lavapipe);
|
||||
assert_eq!(again.artifact, Some(digest));
|
||||
assert_eq!(cell.outcome, refused, "{cell:?}");
|
||||
assert_eq!(cell.artifact, None, "{cell:?}");
|
||||
let on_host = case_compiles(&compute, &floor).unwrap();
|
||||
assert_eq!(on_host.host_replayed, 1);
|
||||
assert_eq!(on_host.compiles.len(), 1);
|
||||
// Where the host replay runs a command buffer, the census compiles less than the run does:
|
||||
// no digest.
|
||||
let host = compile_prepared(&compute, &worker, &floor);
|
||||
assert_eq!(host.outcome, refused, "{host:?}");
|
||||
assert_eq!(host.artifact, None, "{host:?}");
|
||||
|
||||
let (scratch, case) =
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
//! The indirect-command record format: what a translated kernel's command encoders
|
||||
//! (`compute_command`, `render_command`) write into an indirect command buffer's storage, and what
|
||||
//! a CPU encoder writes, a header and one fixed-size record per command.
|
||||
//! The indirect-command record format: what a CPU encoder writes into an indirect command
|
||||
//! buffer's storage, a header and one fixed-size record per command. No translated function
|
||||
//! writes it: a function's command encoders (`compute_command`, `render_command`) are refused,
|
||||
//! `Unsupported{GpuEncodedIndirectCommands, NotImplemented}`.
|
||||
//!
|
||||
//! A consumer that runs its own runtime on the compile layer needs it to execute and read back
|
||||
//! indirect command buffers: [`CommandBuffer::initialize`] writes the header a
|
||||
//! [`CommandDescriptor`] and an [`Inheritance`] fix and resets every record,
|
||||
//! [`CommandRecord::encode_into`] writes one command as the CPU's encoder sets it, and
|
||||
//! [`CommandBuffer::decode`] checks storage a kernel wrote (its sticky encoding fault, the header,
|
||||
//! [`CommandBuffer::decode`] checks the storage (its sticky encoding fault, the header,
|
||||
//! every record against the descriptor) before [`CommandBuffer::records`] reads a range back as
|
||||
//! [`CommandRecord`]s. [`CommandRecord::resolve_bindings`] picks each command's pipeline and
|
||||
//! buffers from itself or from the executing encoder, and [`BufferBinding::resolve_buffer`] finds
|
||||
//! the [`RegisteredBuffer`] whose interval holds a buffer's address. The device replay (`replay_preprocess`)
|
||||
//! reads the same records on the GPU. Storage may hold a written flag per command past the
|
||||
//! records ([`written_flag_offset`]), which a kernel's writes of a record set, so a reset need
|
||||
//! records ([`written_flag_offset`]), which the consumer's writes of a record set, so a reset need
|
||||
//! touch only the flagged records.
|
||||
|
||||
pub use crate::indirect_commands::records_address;
|
||||
|
||||
@@ -1511,8 +1511,7 @@ pub fn typed_module(limits: [u32; 3]) -> BResult<TypedModule> {
|
||||
// A command that sets any buffer while inheriting buffers: a slot no setter set holds an
|
||||
// address and a stride of 0. Only its kernel buffers below the descriptor's count are read
|
||||
// (the header's byte 0, `layout::COUNTS`): every other binding of a compute record is zero,
|
||||
// as the storage is made zero, an encoder's write past the count faults and writes nothing
|
||||
// (`lower::access::encode`), the CPU's setter refuses one, a compute command has no other
|
||||
// as the storage is made zero, the CPU's setter refuses one, a compute command has no other
|
||||
// stage's setter, and a copy takes a source of the same descriptor. So a command reads the
|
||||
// bindings its descriptor counts, not the record's 128, 2 KiB.
|
||||
let counts_at = at(fb, records, layout::COUNTS)?;
|
||||
|
||||
@@ -1116,9 +1116,9 @@ pub fn typed_module() -> BResult<TypedModule> {
|
||||
// fragment and object stages): one bound with a dynamic stride where the descriptor allows
|
||||
// none or the stage takes none (fragment, object) is a record the host's validation refuses;
|
||||
// one set while the commands inherit buffers refuses the command. A binding past its stage's
|
||||
// count is not read. It is zero in every record: the storage is made zero, an encoder's write
|
||||
// past the count faults and writes nothing (`lower::access::encode`), the CPU's setter refuses
|
||||
// one, and a copy takes a source of the same descriptor. So the host's refusal of a binding set
|
||||
// count is not read. It is zero in every record: the storage is made zero, the CPU's setter
|
||||
// refuses one, and a copy takes a source of the same descriptor. So the host's refusal of a
|
||||
// binding set
|
||||
// there never applies, and a command's reads of the record's 128 bindings, 2 KiB, shrink to
|
||||
// those its descriptor counts.
|
||||
let inherit_bit = k32(fb, INHERIT_BUFFERS)?;
|
||||
|
||||
Vendored
+1
-1
@@ -61,7 +61,7 @@ mod tests;
|
||||
/// unchanged version, and its bless records the version. Independent of the crate's version and of
|
||||
/// [`ARTIFACT_FORMAT_VERSION`]. The commit that bumps it says what changed; this comment keeps no
|
||||
/// history.
|
||||
pub const SEMANTICS_VERSION: u32 = 2255;
|
||||
pub const SEMANTICS_VERSION: u32 = 2256;
|
||||
|
||||
/// The byte-layout version of encoded artifacts (`CompiledFunction::to_bytes` and the
|
||||
/// [`PipelineArtifact`] encodings). Every encoded artifact carries it, and a decode under another
|
||||
|
||||
@@ -953,13 +953,12 @@ pub enum Feature {
|
||||
/// (`Capability::Limit` names `MaxFramebufferWidth`, `MaxFramebufferHeight` or
|
||||
/// `MaxFramebufferLayers`). Metal renders passes up to 16384 pixels a side and 2048 layers.
|
||||
RenderTargetSize,
|
||||
/// A render state a function sets on an indirect render command
|
||||
/// (`render_command::set_cull_mode`, `set_front_facing_winding`, `set_triangle_fill_mode`,
|
||||
/// `set_depth_bias`, `set_depth_clip_mode`, `set_depth_stencil_state`), or a
|
||||
/// `depth_stencil_state` it reads from an argument buffer: the record holds no render state.
|
||||
/// Metal's Apple10 family alone lists the feature, and Metal's compiler refuses such a
|
||||
/// function on an Apple9 GPU, so the runtime answers it as that compiler does on a device that
|
||||
/// does not claim Apple10 ([`Needs::MetalGpuFamily`]).
|
||||
/// A `depth_stencil_state` a function reads from an argument buffer or takes as a parameter,
|
||||
/// the state of an indirect render command, which no record holds. (A render command's state
|
||||
/// setters, `render_command::set_cull_mode` and the rest, are `GpuEncodedIndirectCommands`, as
|
||||
/// every encoder operation is.) Metal's Apple10 family alone lists the feature, and Metal's
|
||||
/// compiler refuses such a function on an Apple9 GPU, so the runtime answers it as that
|
||||
/// compiler does on a device that does not claim Apple10 ([`Needs::MetalGpuFamily`]).
|
||||
IndirectRenderState,
|
||||
/// A fragment function's read of a Metal 3.1 program-scope built-in variable that Metal does
|
||||
/// not lower there: a global `thread_index_in_quadgroup` (`air.get_thread_index_in_quadgroup`),
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
//! The indirect-command record format: what a translated kernel's command encoders write, what the
|
||||
//! CPU's do, and what a replay reads (`bind::indirect_commands` is the public path).
|
||||
//! The indirect-command record format: what the CPU's command encoders write and what a replay
|
||||
//! reads (`bind::indirect_commands` is the public path). No translated function writes it: every
|
||||
//! encoder operation is `Unsupported{GpuEncodedIndirectCommands, NotImplemented}`
|
||||
//! (`lower::access::object`).
|
||||
//!
|
||||
//! The records are ordinary buffer storage, a header and one fixed-size record per command; they
|
||||
//! are not Vulkan command buffers or device-generated-command tokens.
|
||||
@@ -25,52 +27,6 @@ pub enum BufferStage {
|
||||
Mesh,
|
||||
}
|
||||
|
||||
/// Recognized command-encoder operation; recognition does not establish lowering support.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub enum CommandEncoderOperation {
|
||||
Buffer {
|
||||
stage: BufferStage,
|
||||
address_space: u32,
|
||||
},
|
||||
Dispatch {
|
||||
exact_threads: bool,
|
||||
},
|
||||
Pipeline {
|
||||
render: bool,
|
||||
},
|
||||
Barrier {
|
||||
render: bool,
|
||||
enabled: bool,
|
||||
},
|
||||
ThreadgroupMemory,
|
||||
Draw,
|
||||
/// `set_stage_in_region`: the six words of the region.
|
||||
StageInRegion,
|
||||
/// `set_imageblock_size`: the two `u16`s of the size.
|
||||
ImageblockSize,
|
||||
/// `reset`: the record restored to [`CommandRecord::default`], of a render command where
|
||||
/// `render`, else a compute command.
|
||||
Reset {
|
||||
render: bool,
|
||||
},
|
||||
/// `draw_indexed_primitives`: an indexed draw's arguments.
|
||||
DrawIndexed,
|
||||
/// `draw_patches`: a patch draw's arguments.
|
||||
DrawPatches,
|
||||
/// `copy_command`: a compute command's record from a source command, whose buffer's header
|
||||
/// the lowering checks against the destination's (`lower::access::encode`).
|
||||
Copy,
|
||||
/// `draw_indexed_patches`: an indexed patch draw's arguments, a patch draw's and its
|
||||
/// control-point index buffer's address ([`Action::DrawIndexedPatches`]).
|
||||
DrawIndexedPatches,
|
||||
/// `draw_mesh_threadgroups` (`threads` false) or `draw_mesh_threads`: a mesh draw's grid and
|
||||
/// its object and mesh threadgroups' threads ([`Action::DrawMeshThreadgroups`],
|
||||
/// [`Action::DrawMeshThreads`]).
|
||||
DrawMesh {
|
||||
threads: bool,
|
||||
},
|
||||
}
|
||||
|
||||
/// Number of buffer slots represented in a command.
|
||||
pub const BINDING_COUNT: usize = 32;
|
||||
/// Number of threadgroup-buffer argument-table entries exposed by the Metal ABI
|
||||
@@ -96,13 +52,10 @@ pub const COMMAND_BUFFER_HEADER_BYTES: usize = 16;
|
||||
pub const WRITTEN_FLAG_BYTES: usize = 4;
|
||||
|
||||
/// The byte offset of command `index`'s written flag in the storage of a buffer of `capacity`
|
||||
/// commands: the flags follow the records, one `u32` a command. Each encoder operation that
|
||||
/// writes a command's record (one the header's policy takes, `lower::access::encode`) stores 1
|
||||
/// at its flag, contained as the record's fields are: storage that ends at its records takes no
|
||||
/// flag, and its records are written as before. A consumer whose storage holds the flags, and
|
||||
/// whose own writes of the records set them as well, knows a record whose flag is clear to hold
|
||||
/// what it last reset it to, and may reset only the flagged ones, clearing each flag with its
|
||||
/// record.
|
||||
/// commands: the flags follow the records, one `u32` a command. No translated function writes a
|
||||
/// record or its flag. A consumer whose storage holds the flags, and whose own writes of the
|
||||
/// records set them, knows a record whose flag is clear to hold what it last reset it to, and may
|
||||
/// reset only the flagged ones, clearing each flag with its record.
|
||||
pub const fn written_flag_offset(capacity: u32, index: u32) -> u64 {
|
||||
COMMAND_BUFFER_HEADER_BYTES as u64
|
||||
+ capacity as u64 * COMMAND_BYTES as u64
|
||||
@@ -114,8 +67,7 @@ pub const fn written_flag_offset(capacity: u32, index: u32) -> u64 {
|
||||
pub const RECORDS_ADDRESS_BASE: u64 = 1 << 63;
|
||||
/// How far an indirect command buffer's resource ID is shifted to give the guest address its
|
||||
/// records start at past [`RECORDS_ADDRESS_BASE`] ([`records_address`]): 2^31 bytes from one ID's
|
||||
/// start to the next's. Records of more bytes run past the next IDs' starts, which a search for
|
||||
/// those IDs' records still tells apart: it finds an ID's records only at their start.
|
||||
/// start to the next's. Records of more bytes run past the next IDs' starts.
|
||||
pub(crate) const RECORDS_ADDRESS_SHIFT: u32 = 31;
|
||||
/// The first resource ID whose records [`records_address`] cannot place, 2^31: the IDs of indirect
|
||||
/// command buffers run from 1 below it, as Metal's do (on an M3 Max, a reservation of 2^31 - 2
|
||||
@@ -127,19 +79,18 @@ pub const RECORDS_ID_LIMIT: u64 = 1 << 31;
|
||||
/// [`RECORDS_ID_LIMIT`]) start at: `2^63 + id * 2^31`. An argument buffer's command-buffer member
|
||||
/// holds the ID, as Metal's `gpuResourceID` and `setIndirectCommandBuffer:atIndex:` give it (small
|
||||
/// integers from 1, measured on an M3 Max and an M4, or the IDs a reservation leaves next, up to
|
||||
/// 2^31 - 1 on an M3 Max), and a translated kernel that encodes through it reaches the records
|
||||
/// that start at this address in its resident set, and no other: records of more than 2^31 bytes
|
||||
/// run past the next IDs' starts, and the resident set keeps each records range whole
|
||||
/// (`ResidentSet`). So a consumer that makes an indirect command buffer with ID `id` makes its
|
||||
/// record buffer resident at `records_address(id)`, a range no Metal buffer reaches (each lies
|
||||
/// below 2^63). The null ID 0 gives an address no records start at, so an encoder operation
|
||||
/// through it is contained as one through an ID whose records are not resident is.
|
||||
/// 2^31 - 1 on an M3 Max). Records of more than 2^31 bytes run past the next IDs' starts, and the
|
||||
/// resident set keeps each records range whole (`ResidentSet`). So a consumer that makes an
|
||||
/// indirect command buffer with ID `id` makes its record buffer resident at `records_address(id)`,
|
||||
/// a range no Metal buffer reaches (each lies below 2^63). The null ID 0 gives an address no
|
||||
/// records start at. No translated function reaches the records through it: every encoder
|
||||
/// operation is refused (`GpuEncodedIndirectCommands`).
|
||||
pub const fn records_address(id: u64) -> u64 {
|
||||
RECORDS_ADDRESS_BASE | (id << RECORDS_ADDRESS_SHIFT)
|
||||
}
|
||||
|
||||
/// The byte offsets the lowering of the encoder operations writes through device addresses
|
||||
/// (`lower::access::encode`), with the header checks of [`Policy`].
|
||||
/// The byte offsets of the header's and a record's fields, which the CPU's encoder writes and the
|
||||
/// device replay reads (`bind::replay`).
|
||||
pub(crate) mod layout {
|
||||
use super::{
|
||||
BufferStage, BINDING_COUNT, BUFFER_STAGES, BUFFER_WORDS, HEADER_WORDS, THREADGROUP_COUNT,
|
||||
@@ -156,8 +107,6 @@ pub(crate) mod layout {
|
||||
/// kernel buffers in byte 0 and threadgroup lengths in byte 3; a render descriptor's object,
|
||||
/// vertex, fragment and mesh buffers in bytes 0 to 3.
|
||||
pub(crate) const COUNTS: u64 = 12;
|
||||
/// The first record.
|
||||
pub(crate) const RECORDS: u64 = super::COMMAND_BUFFER_HEADER_BYTES as u64;
|
||||
/// Bytes of one record.
|
||||
pub(crate) const RECORD: u64 = super::COMMAND_BYTES as u64;
|
||||
/// A record's action tag (`u32`).
|
||||
@@ -220,30 +169,6 @@ pub(crate) mod layout {
|
||||
pub(crate) const STATE_BITS: u32 = RETAINED | KERNEL_PIPELINE;
|
||||
}
|
||||
|
||||
/// The descriptor policy an encoder operation's write requires of the record header: its
|
||||
/// policy bits masked with `required | forbidden` equal `required`, and hold one of `any` where
|
||||
/// `any` is not 0, the command index is below the capacity, a binding index is below its count,
|
||||
/// and a dynamic stride is all ones unless the descriptor enables dynamic strides. A write that
|
||||
/// fails any of them sets the fault flag instead and writes nothing, but a draw on a buffer of
|
||||
/// `dropped_on` alone, which writes nothing and sets no fault. A threadgroup length is kept as
|
||||
/// set, a multiple of 16 or not, as Metal keeps it.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub(crate) struct Policy {
|
||||
pub(crate) required: u32,
|
||||
pub(crate) forbidden: u32,
|
||||
/// The kinds of which the descriptor must allow one (0: no such check): those whose Metal
|
||||
/// record holds the operation's draw ([`DrawKind::holders`]).
|
||||
pub(crate) any: u32,
|
||||
/// The byte of the header's packed counts that bounds the operation's binding index, where
|
||||
/// it binds one.
|
||||
pub(crate) binding: Option<u8>,
|
||||
pub(crate) dynamic_stride: bool,
|
||||
/// The kinds on a buffer of which, allowing none of `any`, a draw that is otherwise valid is
|
||||
/// dropped: it writes nothing and sets no fault (0: none). A kernel's draw of primitives on
|
||||
/// a buffer of mesh draws alone draws nothing on Metal, without a fault (a Metal probe).
|
||||
pub(crate) dropped_on: u32,
|
||||
}
|
||||
|
||||
/// A draw's kind, as the command types Metal's records are made for order them: a buffer's
|
||||
/// records hold a draw of a kind its types allow, or of a kind whose record a kind it allows
|
||||
/// holds. Draws of primitives fit every render buffer's records but those of mesh draws alone,
|
||||
@@ -276,7 +201,7 @@ impl DrawKind {
|
||||
}
|
||||
|
||||
// The header's policy bits, which a command-buffer descriptor sets at initialization and the
|
||||
// encoder operations' lowering checks ([`Policy`]).
|
||||
// device replay reads.
|
||||
pub(crate) const COMPUTE: u32 = 1;
|
||||
pub(crate) const RENDER: u32 = 2;
|
||||
pub(crate) const GROUPS: u32 = 4;
|
||||
@@ -1082,63 +1007,5 @@ fn arguments<const N: usize>(words: [u32; N]) -> [u32; layout::DRAW_ARGUMENT_WOR
|
||||
all
|
||||
}
|
||||
|
||||
impl CommandEncoderOperation {
|
||||
/// The descriptor policy this operation's write requires of the header ([`Policy`]).
|
||||
pub(crate) fn policy(self) -> Policy {
|
||||
let family = |render: bool| if render { RENDER } else { COMPUTE };
|
||||
let plain = |required| Policy {
|
||||
required,
|
||||
forbidden: 0,
|
||||
any: 0,
|
||||
binding: None,
|
||||
dynamic_stride: false,
|
||||
dropped_on: 0,
|
||||
};
|
||||
// A draw needs a render descriptor whose records hold its kind.
|
||||
let draw = |kind: DrawKind| Policy {
|
||||
any: kind.holders(),
|
||||
..plain(RENDER)
|
||||
};
|
||||
match self {
|
||||
Self::Buffer { stage, .. } => Policy {
|
||||
required: family(stage != BufferStage::Kernel),
|
||||
forbidden: INHERIT_BUFFERS,
|
||||
any: 0,
|
||||
binding: Some(match stage {
|
||||
BufferStage::Kernel => 0,
|
||||
BufferStage::Vertex => 1,
|
||||
BufferStage::Fragment => 2,
|
||||
// A render descriptor's object and mesh counts take the bytes of the kernel
|
||||
// and threadgroup counts, which a compute descriptor's alone hold.
|
||||
BufferStage::Object => 0,
|
||||
BufferStage::Mesh => 3,
|
||||
}),
|
||||
dynamic_stride: matches!(stage, BufferStage::Kernel | BufferStage::Vertex),
|
||||
dropped_on: 0,
|
||||
},
|
||||
// Every compute descriptor allows a dispatch kind, and its records hold either.
|
||||
Self::Dispatch { .. } => plain(COMPUTE),
|
||||
Self::Pipeline { render } => Policy {
|
||||
forbidden: INHERIT_PIPELINE,
|
||||
..plain(family(render))
|
||||
},
|
||||
Self::Barrier { render, .. } => plain(family(render)),
|
||||
Self::ThreadgroupMemory => Policy {
|
||||
binding: Some(3),
|
||||
..plain(COMPUTE)
|
||||
},
|
||||
Self::Draw => Policy {
|
||||
dropped_on: DRAW_MESH_THREADGROUPS | DRAW_MESH_THREADS,
|
||||
..draw(DrawKind::Primitives)
|
||||
},
|
||||
Self::DrawIndexed => draw(DrawKind::Indexed),
|
||||
Self::DrawPatches | Self::DrawIndexedPatches => draw(DrawKind::Patches),
|
||||
Self::DrawMesh { .. } => draw(DrawKind::Mesh),
|
||||
Self::Reset { render } => plain(family(render)),
|
||||
Self::StageInRegion | Self::ImageblockSize | Self::Copy => plain(COMPUTE),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
@@ -1572,7 +1572,7 @@ pub fn emit(
|
||||
/// Plan a load of the 8-byte word at buffer pointer `ptr` (of AIR type `ty`, aligned `align`) as
|
||||
/// data, a `u64`: through a static root (a descriptor view or a static device-address slot), or
|
||||
/// a wide pointer's root entry. An indirect-command object's handle load reads its field this
|
||||
/// way (`access::encode`).
|
||||
/// way (`access::object`).
|
||||
pub(super) fn plan_word(
|
||||
cx: &mut SelectCx<'_>,
|
||||
ptr: Value,
|
||||
@@ -1596,21 +1596,6 @@ pub(super) fn plan_word(
|
||||
})
|
||||
}
|
||||
|
||||
/// Plan a resident-set search outside a pointer value (an encoder's record buffer): the function
|
||||
/// reads the root table, searches it once more, and under isolation counts an access through
|
||||
/// root 0. The caller checked the profile's device addresses and the stage's store feature.
|
||||
pub(super) fn plan_search(cx: &mut SelectCx<'_>) -> Result<(), Error> {
|
||||
require_addresses(cx)?;
|
||||
plan_resolve(cx);
|
||||
plan_misses(cx)
|
||||
}
|
||||
|
||||
/// Plan the guest address of buffer pointer `v` written as data: the null constant, or a wide
|
||||
/// pointer (every root whose pointer escapes is wide on a profile with device addresses).
|
||||
pub(super) fn plan_address(cx: &mut SelectCx<'_>, v: Value) -> Result<Side, Error> {
|
||||
stored(cx, v)
|
||||
}
|
||||
|
||||
/// The 8-byte word `s` reads ([`plan_word`]), a `u64`.
|
||||
pub(super) fn emit_word(
|
||||
cx: &mut EmitCx<'_>,
|
||||
@@ -1628,60 +1613,3 @@ pub(super) fn emit_word(
|
||||
};
|
||||
word.ok_or_else(|| cx.fail("an object word without a value"))
|
||||
}
|
||||
|
||||
/// The wide pointer of the resident allocation that starts at guest address `guest` (a `u64`):
|
||||
/// the resident-set search ([`resolve`]), its hit kept only at the allocation's start, any other
|
||||
/// address a miss, `(0, guest)`. Indirect command buffers' records are searched so: records longer
|
||||
/// than the distance between two IDs' starts run past the next IDs' starts
|
||||
/// (`indirect_commands::records_address`), and an ID whose own records are not resident then
|
||||
/// misses rather than reaching into another's.
|
||||
pub(super) fn search_start(
|
||||
cx: &mut EmitCx<'_>,
|
||||
fb: &mut FunctionBuilder<'_>,
|
||||
guest: SValue,
|
||||
) -> BResult<SValue> {
|
||||
let p = resolve(cx, fb, guest)?;
|
||||
let [root, off, host, size] = fields(fb, p)?;
|
||||
let zero = k64(fb, 0)?;
|
||||
let at_start = fb.binary(BinOp::IEqual, off, zero)?;
|
||||
let root = fb.select(at_start, root, zero)?;
|
||||
let off = fb.select(at_start, off, guest)?;
|
||||
let host = fb.select(at_start, host, zero)?;
|
||||
let size = fb.select(at_start, size, zero)?;
|
||||
fat(fb, [root, off, host, size])
|
||||
}
|
||||
|
||||
/// The allocation of wide pointer `p` resolved for plain accesses in the function's coherence,
|
||||
/// an access through root 0 counted under isolation ([`wide_base`]).
|
||||
pub(super) fn plain_base(
|
||||
cx: &mut EmitCx<'_>,
|
||||
fb: &mut FunctionBuilder<'_>,
|
||||
p: SValue,
|
||||
) -> BResult<WideBase> {
|
||||
base_with(cx, fb, p, (None, false), None)
|
||||
}
|
||||
|
||||
/// A `PhysicalStorageBuffer` pointer to the `u32` at `d` bytes (a `u64`, 4-aligned past a
|
||||
/// 4-aligned base) past `b`, contained: out of bounds, the sink's first word.
|
||||
pub(super) fn word_place(fb: &mut FunctionBuilder<'_>, b: WideBase, d: SValue) -> BResult<SValue> {
|
||||
let at = fb.binary(BinOp::IAdd, b.at, d)?;
|
||||
let mut addr = fb.binary(BinOp::IAdd, b.host, at)?;
|
||||
if let Some((size, sink)) = b.bounds {
|
||||
let inb = contain::in_bounds(fb, at, size, 4)?;
|
||||
addr = fb.select(inb, addr, sink)?;
|
||||
}
|
||||
let u32_ = fb.module().ty(SType::Int {
|
||||
width: 32,
|
||||
signed: false,
|
||||
})?;
|
||||
fb.device_place(addr, u32_)
|
||||
}
|
||||
|
||||
/// The Metal address of `side` ([`plan_address`]): a wide pointer's guest address, or 0.
|
||||
pub(super) fn address_of(
|
||||
cx: &mut EmitCx<'_>,
|
||||
fb: &mut FunctionBuilder<'_>,
|
||||
side: Side,
|
||||
) -> BResult<SValue> {
|
||||
metal_address(cx, fb, side)
|
||||
}
|
||||
@@ -698,7 +698,7 @@ pub fn emit(
|
||||
AccessStrategy::Value(p) => super::pointer::emit(cx, fb, vid, p),
|
||||
AccessStrategy::Cell(c) => super::cell::emit(cx, fb, vid, c),
|
||||
AccessStrategy::Imageblock(i) => super::imageblock::emit(cx, fb, vid, i),
|
||||
AccessStrategy::Encode(e) => super::encode::emit(cx, fb, vid, e),
|
||||
AccessStrategy::Object(o) => super::object::emit(cx, fb, vid, o),
|
||||
AccessStrategy::Commands(c) => super::icb::emit(cx, fb, c),
|
||||
AccessStrategy::FunctionTable(t) => super::function_table::emit(cx, fb, vid, t),
|
||||
AccessStrategy::AbsentRead(a) => super::absent::emit(cx, fb, vid, a),
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,7 +1,7 @@
|
||||
//! GPU-encoded indexed draws under the identity domains: a function's `render_command` buffer
|
||||
//! setters, indexed draw and reset write the records of an indirect command buffer
|
||||
//! (`pipeline::IndirectDrawLayout`) through its `gpuResourceID`, the records' device address,
|
||||
//! which an argument buffer's `command_buffer` member holds (its handle load is `encode`'s object
|
||||
//! which an argument buffer's `command_buffer` member holds (its handle load is `object`'s
|
||||
//! word, a `u64`).
|
||||
//!
|
||||
//! Each operation reads the header's capacity, slot counts and stride, and writes only where the
|
||||
|
||||
@@ -101,13 +101,13 @@ pub mod cell;
|
||||
pub mod copy;
|
||||
pub mod dynamic;
|
||||
mod emit;
|
||||
pub mod encode;
|
||||
pub mod function_table;
|
||||
pub mod handle;
|
||||
pub mod icb;
|
||||
pub mod imageblock;
|
||||
pub mod index;
|
||||
pub mod local;
|
||||
pub mod object;
|
||||
pub(crate) mod phis;
|
||||
pub mod pointer;
|
||||
pub(crate) mod psb;
|
||||
@@ -189,8 +189,8 @@ pub enum AccessStrategy {
|
||||
Cell(cell::CellStrategy),
|
||||
/// A kernel imageblock's cell pointer or extent.
|
||||
Imageblock(imageblock::ImageblockStrategy),
|
||||
/// An indirect-command object's word, or an encoder operation's record writes.
|
||||
Encode(encode::EncodeStrategy),
|
||||
/// An indirect-command object's word.
|
||||
Object(object::ObjectWord),
|
||||
/// An indirect-command operation's writes into its command's records under the identity
|
||||
/// domains.
|
||||
Commands(icb::Command),
|
||||
@@ -540,7 +540,7 @@ impl FamilyStrategy for AccessStrategy {
|
||||
AccessStrategy::Value(p) => p.name(slots),
|
||||
AccessStrategy::Cell(c) => c.name().into(),
|
||||
AccessStrategy::Imageblock(i) => i.name().into(),
|
||||
AccessStrategy::Encode(e) => e.name(slots),
|
||||
AccessStrategy::Object(o) => o.name(slots),
|
||||
AccessStrategy::Commands(c) => c.name(),
|
||||
AccessStrategy::FunctionTable(t) => t.name(),
|
||||
AccessStrategy::AbsentRead(a) => a.name().into(),
|
||||
@@ -565,7 +565,7 @@ impl FamilyStrategy for AccessStrategy {
|
||||
AccessStrategy::Value(p) => p.words(),
|
||||
AccessStrategy::Cell(c) => c.words(),
|
||||
AccessStrategy::Imageblock(i) => i.words(),
|
||||
AccessStrategy::Encode(e) => e.words(),
|
||||
AccessStrategy::Object(o) => o.words(),
|
||||
AccessStrategy::Commands(c) => c.words(),
|
||||
AccessStrategy::FunctionTable(t) => t.words(),
|
||||
AccessStrategy::AbsentRead(a) => a.words(),
|
||||
@@ -634,7 +634,7 @@ fn held(s: &root_sets::Statics, m: &mut Meter) -> Result<Vec<Target>, Error> {
|
||||
/// materializes (`pointer::phi_incoming`); any other constant incoming pointer, and a blob offset
|
||||
/// (which would need a conversion on its edge), is refused.
|
||||
pub fn lowered_pointer(cx: &SelectCx<'_>, v: Value) -> Result<DemoteTy, Error> {
|
||||
if let Some(d) = encode::lowered_pointer(cx, v) {
|
||||
if let Some(d) = object::lowered_pointer(cx, v) {
|
||||
return Ok(d);
|
||||
}
|
||||
if let Some(d) = handle::lowered_pointer(cx, v)? {
|
||||
@@ -789,7 +789,7 @@ pub struct AccessPlan {
|
||||
/// A tile function's attachments and the ones it stages ([`tile`]).
|
||||
pub tile: Option<tile::TilePlan>,
|
||||
/// The handle loads of indirect-command objects whose every use is an encoder operand
|
||||
/// ([`encode::plan_objects`]): each is its field's word, a `u64`.
|
||||
/// ([`object::plan_objects`]): each is its field's word, a `u64`.
|
||||
pub objects: BTreeSet<InstId>,
|
||||
/// The typed loads and stores whose access chain takes its defining `getelementptr`'s own
|
||||
/// index operands ([`local`]'s line-up rule), each with those operands: the access reads them
|
||||
@@ -2494,12 +2494,12 @@ pub fn select(
|
||||
return Ok(AccessStrategy::Imageblock(s));
|
||||
}
|
||||
// Under the identity domains an indirect-command operation is `icb`'s; its object word's
|
||||
// handle load stays `encode`'s.
|
||||
// handle load stays `object`'s.
|
||||
if let Some(c) = icb::select(cx, inst, m)? {
|
||||
return Ok(AccessStrategy::Commands(c));
|
||||
}
|
||||
if let Some(s) = encode::select(cx, at, inst, m)? {
|
||||
return Ok(AccessStrategy::Encode(s));
|
||||
if let Some(s) = object::select(cx, at, inst, m)? {
|
||||
return Ok(AccessStrategy::Object(s));
|
||||
}
|
||||
if let Some(s) = cell::select(cx, at, inst)? {
|
||||
return Ok(AccessStrategy::Cell(s));
|
||||
|
||||
@@ -0,0 +1,199 @@
|
||||
//! Indirect-command objects: an argument buffer's command-buffer or pipeline-state member, and the
|
||||
//! encoder operations that take one.
|
||||
//!
|
||||
//! **Object words.** An object's handle load (`memory::provenance::object_handle_load`) reads the
|
||||
//! member's field, 8 bytes, as data ([`ObjectWord`], a `u64`): a command buffer's word is its
|
||||
//! resource ID, Metal's `gpuResourceID`; a pipeline state's word is the template's token. A handle
|
||||
//! load is admitted only when every use of its value is an encoder operand of its class
|
||||
//! ([`plan_objects`]): the command operand of an encoder operation, the pipeline operand of
|
||||
//! `air.set_pipeline_state_{compute,render}_command`, or a copy's source command buffer. Any other
|
||||
//! use (an integer, a compare, a store, a merge) leaves the load refused
|
||||
//! (`ArgumentBufferObjects`, `pointer::select`), so no other instruction observes the word.
|
||||
//!
|
||||
//! **Encoder operations** ([`select`]). This module lowers none. Under the identity domains the
|
||||
//! operations `icb` lowers (a render command's buffer setters, its indexed triangle draw and a
|
||||
//! reset) are selected there, before this module; every other encoder operation, and every one
|
||||
//! under the resident-table domains, is `Unsupported{GpuEncodedIndirectCommands, NotImplemented}`,
|
||||
//! and one whose command is not an object word is `Unsupported{ArgumentBufferObjects,
|
||||
//! NotImplemented}`.
|
||||
|
||||
use std::borrow::Cow;
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
|
||||
use crate::air::intrinsics::{AirIntrinsic, IndirectCommand};
|
||||
use crate::air::ir::{Callee, Inst, InstId, InstKind, Value, ValueId};
|
||||
use crate::budget::{tree_bytes, Meter};
|
||||
use crate::error::{Error, Feature, Unsupported};
|
||||
use crate::lower::emit::EmitCx;
|
||||
use crate::lower::select::SelectCx;
|
||||
use crate::memory::provenance::{self, HandleClass, Repr};
|
||||
use crate::spirv::builder::FunctionBuilder;
|
||||
use crate::spirv::error::BResult;
|
||||
use crate::spirv::ids::{DemoteTy, ScalarTy};
|
||||
|
||||
use super::dynamic::{self, Source};
|
||||
use super::AccessPlan;
|
||||
|
||||
/// The handle load of an indirect-command object: its field's word, a `u64`.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct ObjectWord(pub Source);
|
||||
|
||||
impl ObjectWord {
|
||||
/// The census name (`access.object.word`) in the finished plan `slots`, qualified by what the
|
||||
/// object's load reaches ([`super::SideReach`]).
|
||||
pub fn name(&self, slots: &AccessPlan) -> Cow<'static, str> {
|
||||
self.0.reach(slots).qualify("access.object.word")
|
||||
}
|
||||
|
||||
/// An upper estimate of the SPIR-V words one use emits: a leaf access.
|
||||
pub fn words(&self) -> u32 {
|
||||
self.0.words()
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether `class` is an indirect-command object's.
|
||||
fn object_class(class: HandleClass) -> bool {
|
||||
matches!(
|
||||
class,
|
||||
HandleClass::Command | HandleClass::ComputePipelineState | HandleClass::RenderPipelineState
|
||||
)
|
||||
}
|
||||
|
||||
/// The encoder operation of call `call`, if it is one.
|
||||
fn encoder(call: &crate::air::ir::Call) -> Option<IndirectCommand> {
|
||||
match call.callee {
|
||||
Callee::Air {
|
||||
op: AirIntrinsic::IndirectCommand(op),
|
||||
..
|
||||
} => Some(op),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether operand `i` of encoder `op` may be an object word of `class`: the command operand,
|
||||
/// the pipeline operand of a compute or render pipeline setter, or a copy's source command
|
||||
/// buffer.
|
||||
fn encoder_operand(op: IndirectCommand, i: usize, class: HandleClass) -> bool {
|
||||
match (i, class) {
|
||||
(0, HandleClass::Command) => true,
|
||||
(2, HandleClass::ComputePipelineState) => op == IndirectCommand::SetComputePipeline,
|
||||
(2, HandleClass::RenderPipelineState) => op == IndirectCommand::SetRenderPipeline,
|
||||
(2, HandleClass::Command) => op == IndirectCommand::CopyComputeCommand,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Plan the function's object words, before any instruction is selected: each handle load of an
|
||||
/// indirect-command object (`provenance::object_handle_load`) whose every use is an encoder operand
|
||||
/// of its class (`encoder_operand`).
|
||||
pub fn plan_objects(cx: &mut SelectCx<'_>, m: &mut Meter) -> Result<(), Error> {
|
||||
let body = cx.body;
|
||||
let entry = tree_bytes(1, std::mem::size_of::<(InstId, HandleClass)>());
|
||||
let mut words: BTreeMap<InstId, HandleClass> = BTreeMap::new();
|
||||
for (id, inst) in body.insts.iter() {
|
||||
m.tick(1)?;
|
||||
let InstKind::Load {
|
||||
ptr,
|
||||
volatile: false,
|
||||
atomic: None,
|
||||
..
|
||||
} = &inst.kind
|
||||
else {
|
||||
continue;
|
||||
};
|
||||
let Some(Repr::Handle { class, .. }) = cx.memory.repr(Value::Inst(id)) else {
|
||||
continue;
|
||||
};
|
||||
if !object_class(class) {
|
||||
continue;
|
||||
}
|
||||
let (Some(roots), Some(range), Some(bytes)) = (
|
||||
cx.memory.roots_of(*ptr),
|
||||
cx.memory.offset(*ptr),
|
||||
cx.memory.layouts.store_size(inst.ty),
|
||||
) else {
|
||||
continue;
|
||||
};
|
||||
if provenance::object_handle_load(cx.entry, &cx.memory.abi, roots, range, bytes).is_some() {
|
||||
m.charge(entry)?;
|
||||
words.insert(id, class);
|
||||
}
|
||||
}
|
||||
if words.is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
for (_, inst) in body.insts.iter() {
|
||||
m.tick(1)?;
|
||||
match &inst.kind {
|
||||
InstKind::Call(call) if encoder(call).is_some() => {
|
||||
let op = encoder(call).ok_or_else(|| cx.invariant("an encoder vanished"))?;
|
||||
for (i, a) in call.args.iter().enumerate() {
|
||||
if let Value::Inst(l) = a {
|
||||
if words.get(l).is_some_and(|c| !encoder_operand(op, i, *c)) {
|
||||
words.remove(l);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
kind => kind.for_each_value(|v| {
|
||||
if let Value::Inst(l) = v {
|
||||
words.remove(&l);
|
||||
}
|
||||
}),
|
||||
}
|
||||
}
|
||||
cx.families.access.objects = words.into_keys().collect::<BTreeSet<_>>();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// The lowered representation of an object word ([`plan_objects`]): a `u64`; `None` for any
|
||||
/// other value.
|
||||
pub fn lowered_pointer(cx: &SelectCx<'_>, v: Value) -> Option<DemoteTy> {
|
||||
match v {
|
||||
Value::Inst(i) if cx.families.access.objects.contains(&i) => {
|
||||
Some(DemoteTy::Scalar(ScalarTy::Int { bits: 64 }))
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Select the strategy of `inst`: an object word's handle load, or the refusal of an encoder
|
||||
/// operation (see the module docs); `None` for any other instruction.
|
||||
pub fn select(
|
||||
cx: &mut SelectCx<'_>,
|
||||
at: InstId,
|
||||
inst: &Inst,
|
||||
m: &mut Meter,
|
||||
) -> Result<Option<ObjectWord>, Error> {
|
||||
match &inst.kind {
|
||||
InstKind::Load {
|
||||
ptr,
|
||||
align,
|
||||
volatile: false,
|
||||
atomic: None,
|
||||
..
|
||||
} if cx.families.access.objects.contains(&at) => Ok(Some(ObjectWord(dynamic::plan_word(
|
||||
cx, *ptr, inst.ty, *align, m,
|
||||
)?))),
|
||||
InstKind::Call(call) if encoder(call).is_some() => {
|
||||
let command = call.args.first();
|
||||
if !matches!(command, Some(Value::Inst(i)) if cx.families.access.objects.contains(i)) {
|
||||
return Err(Unsupported::not_implemented(Feature::ArgumentBufferObjects).into());
|
||||
}
|
||||
Err(Unsupported::not_implemented(Feature::GpuEncodedIndirectCommands).into())
|
||||
}
|
||||
_ => Ok(None),
|
||||
}
|
||||
}
|
||||
|
||||
/// Emit object word `w`, defining value `vid`.
|
||||
pub fn emit(
|
||||
cx: &mut EmitCx<'_>,
|
||||
fb: &mut FunctionBuilder<'_>,
|
||||
vid: ValueId,
|
||||
w: &ObjectWord,
|
||||
) -> BResult<()> {
|
||||
let word = dynamic::emit_word(cx, fb, &w.0)?;
|
||||
cx.define(vid, word);
|
||||
Ok(())
|
||||
}
|
||||
@@ -872,7 +872,7 @@ fn route_air(cx: &SelectCx<'_>, op: &AirIntrinsic, decl: FuncId) -> Route {
|
||||
.into(),
|
||||
),
|
||||
A::Tensor(_) => Route::Refuse(Unsupported::not_implemented(Feature::Tensors).into()),
|
||||
// An encoder operation writes its command's record through device addresses.
|
||||
// An encoder operation is the access family's (`access::object`).
|
||||
A::IndirectCommand(_) => Route::Family(LowerFamily::Access),
|
||||
A::Mesh(_) => Route::Family(LowerFamily::Mesh),
|
||||
// Canonicalization makes every vector data call its element accesses.
|
||||
@@ -1410,7 +1410,7 @@ fn select_body(
|
||||
// The spin reads, before any atomic is selected.
|
||||
access::atomic::spin::plan(cx, m)?;
|
||||
// The indirect-command object words, before any use of one is selected.
|
||||
access::encode::plan_objects(cx, m)?;
|
||||
access::object::plan_objects(cx, m)?;
|
||||
// The encodings each pointer-cell slot group's loads read, before any store.
|
||||
access::cell::plan_reads(cx, m)?;
|
||||
// The primitive-data stores nothing reads back, before any store.
|
||||
|
||||
@@ -2873,9 +2873,9 @@ fn a_compute_pipeline_states_whether_its_kernel_writes_memory() {
|
||||
|
||||
/// The interface states whether the function takes an indirect command buffer, from the AIR's
|
||||
/// metadata: an argument buffer's `command_buffer` member the kernel never encodes through
|
||||
/// (`kernel_icb_declared_handle_is_inert`), and one it encodes compute commands through
|
||||
/// (`icb_replay_encode`), count; a kernel that takes none (`icb_replay_template`, which a
|
||||
/// command runs) does not. A pipeline's interface states it where one of its stages does.
|
||||
/// (`kernel_icb_declared_handle_is_inert`) counts; a kernel that takes none
|
||||
/// (`icb_replay_template`, which a command runs) does not. A pipeline's interface states it where
|
||||
/// one of its stages does.
|
||||
#[test]
|
||||
fn the_interface_states_whether_the_function_takes_a_command_buffer() {
|
||||
let p = crate::pipeline::testing::profile("lavapipe", DevicePolicy::RESIDENT_TABLES)
|
||||
@@ -2888,7 +2888,6 @@ fn the_interface_states_whether_the_function_takes_a_command_buffer() {
|
||||
"kernel_icb_declared_handle_is_inert",
|
||||
true,
|
||||
),
|
||||
(&dirs[1], "icb_replay_encode", "icb_replay_encode", true),
|
||||
(
|
||||
&dirs[1],
|
||||
"icb_replay_template",
|
||||
@@ -2918,44 +2917,33 @@ fn the_interface_states_whether_the_function_takes_a_command_buffer() {
|
||||
}
|
||||
|
||||
/// The interface states what the function may write into indirect command buffers, from its
|
||||
/// AIR: a kernel that encodes compute commands (`icb_replay_encode`) its operations' bits, no
|
||||
/// primitive type and the compute kind; kernels that draw (`icb_render_replay_encode_draw_only`,
|
||||
/// `icb_render_indexed_encode`) their draws' bits, the constant primitive type they pass
|
||||
/// (points) and the render kind; a kernel that takes no command buffer (`icb_replay_template`)
|
||||
/// nothing. A pipeline's interface holds its stages' together.
|
||||
/// AIR: a kernel that binds each command's buffers and draws indexed triangles into it
|
||||
/// (`icb_indexed_16`, under the identity domains, which lower such a kernel) its operations'
|
||||
/// bits, the constant primitive type it passes (triangles) and the render kind; a kernel that
|
||||
/// takes no command buffer (`icb_replay_template`) nothing. A pipeline's interface holds its
|
||||
/// stages' together.
|
||||
#[test]
|
||||
fn the_interface_states_what_the_function_may_write_into_command_buffers() {
|
||||
use crate::pipeline::interface::CommandWrites as W;
|
||||
let p = crate::pipeline::testing::profile("lavapipe", DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("profile");
|
||||
for (entry, operations, primitive_types, kinds) in [
|
||||
let p =
|
||||
crate::pipeline::testing::profile("lavapipe", DevicePolicy::default()).expect("profile");
|
||||
for (fixture, entry, operations, primitive_types, kinds) in [
|
||||
(
|
||||
"icb_replay_encode",
|
||||
W::PIPELINE | W::BUFFER | W::THREADGROUP_MEMORY | W::DISPATCH | W::BARRIER,
|
||||
0,
|
||||
W::COMPUTE_COMMANDS,
|
||||
),
|
||||
(
|
||||
"icb_render_replay_encode_draw_only",
|
||||
W::DRAW,
|
||||
0b1,
|
||||
"icb_merged_indexed",
|
||||
"icb_indexed_16",
|
||||
W::BUFFER | W::DRAW_INDEXED,
|
||||
1 << 3,
|
||||
W::RENDER_COMMANDS,
|
||||
),
|
||||
(
|
||||
"icb_render_indexed_encode",
|
||||
W::DRAW_INDEXED,
|
||||
0b1,
|
||||
W::RENDER_COMMANDS,
|
||||
),
|
||||
("icb_replay_template", 0, 0, 0),
|
||||
("icb_replay_template", "icb_replay_template", 0, 0, 0),
|
||||
] {
|
||||
let bc = match llvm_assemble(&engine_dir().join(format!("{entry}.ll"))) {
|
||||
let bc = match llvm_assemble(&engine_dir().join(format!("{fixture}.ll"))) {
|
||||
Ok(b) => b,
|
||||
Err(AssembleError::Missing(why)) => {
|
||||
eprintln!("SKIPPED: {why}");
|
||||
return;
|
||||
}
|
||||
Err(AssembleError::Rejected(why)) => panic!("llvm-as rejected {entry}.ll: {why}"),
|
||||
Err(AssembleError::Rejected(why)) => panic!("llvm-as rejected {fixture}.ll: {why}"),
|
||||
};
|
||||
let a = crate::pipeline::testing::compile(&bc, entry, &p)
|
||||
.unwrap_or_else(|e| panic!("{entry}: {e}"));
|
||||
|
||||
@@ -3444,10 +3444,9 @@ declare void @air.concurrent_dispatch_threadgroups_compute_command(ptr addrspace
|
||||
|
||||
/// `air.set_pipeline_state_compute_command`'s pipeline operand is a `compute_pipeline_state`
|
||||
/// handle, the class of the argument-buffer member it is loaded from, so a GPU-encoded compute
|
||||
/// command is no class conflict: with device addresses it translates (the member words are the
|
||||
/// record buffer's guest address and the template's token), and without them it is its family's
|
||||
/// refusal, `GpuEncodedIndirectCommands`, naming what the profile lacks. The same pipeline state
|
||||
/// also read as bytes still conflicts: `HandleAsPointer`, not representable.
|
||||
/// command is no class conflict: it is its family's refusal, `GpuEncodedIndirectCommands`, not
|
||||
/// implemented, on every committed profile. The same pipeline state also read as bytes still
|
||||
/// conflicts: `HandleAsPointer`, not representable.
|
||||
#[test]
|
||||
fn a_command_set_to_an_argument_buffer_pipeline_state_is_its_family_refusal() {
|
||||
let Some(bc) = assemble(
|
||||
@@ -3457,31 +3456,12 @@ fn a_command_set_to_an_argument_buffer_pipeline_state_is_its_family_refusal() {
|
||||
return;
|
||||
};
|
||||
for (stem, p) in committed_profiles().expect("profiles") {
|
||||
match compile(&bc, "set_pipeline", &p) {
|
||||
Ok(a) => {
|
||||
assert_eq!(
|
||||
p.fields().buffer_access,
|
||||
crate::device::profile::BufferAccess::Addressed,
|
||||
"{stem}"
|
||||
);
|
||||
link_and_validate(&a, &p).unwrap_or_else(|e| panic!("{stem}: L3: {e}"));
|
||||
}
|
||||
Err(e) => {
|
||||
let u = unsupported(e);
|
||||
assert_eq!(
|
||||
(u.feature, u.needs),
|
||||
(
|
||||
Feature::GpuEncodedIndirectCommands,
|
||||
Unsupported::needs_any_of(
|
||||
Feature::GpuEncodedIndirectCommands,
|
||||
vec![p.addressed_needs()]
|
||||
)
|
||||
.needs
|
||||
),
|
||||
"{stem}"
|
||||
);
|
||||
}
|
||||
}
|
||||
let u = unsupported(compile(&bc, "set_pipeline", &p).expect_err(&stem));
|
||||
assert_eq!(
|
||||
(u.feature, u.needs),
|
||||
(Feature::GpuEncodedIndirectCommands, Needs::NotImplemented),
|
||||
"{stem}"
|
||||
);
|
||||
}
|
||||
let Some(bc) = assemble(
|
||||
"icb_pipeline_bytes",
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
+11
-9
@@ -1484,7 +1484,11 @@ and the lowest constant level of detail). A sample's level is its sampler's to b
|
||||
### Indirect command buffers
|
||||
|
||||
An indirect command buffer's commands are records in ordinary buffer storage
|
||||
(`bind::indirect_commands`): one format whatever the descriptor, written by the CPU or by a kernel.
|
||||
(`bind::indirect_commands`): one format whatever the descriptor, written by the CPU. Under the
|
||||
resident-table domains a function's encoder operations are refused,
|
||||
`Unsupported{GpuEncodedIndirectCommands, NotImplemented}`; under the identity domains a function
|
||||
writes the render commands section 1 names, into the records `pipeline::IndirectDrawLayout`
|
||||
states, and is refused the same way for any other operation.
|
||||
The binder replays records into dispatches and draws: on the host, or on the device through a
|
||||
preprocessing kernel (`replay_preprocess`), and through `VK_EXT_device_generated_commands` where
|
||||
the device has it (`replay_preprocess_generated`). Draws of primitives under the encoder's
|
||||
@@ -1501,14 +1505,12 @@ reads no buffer and no `[[primitive_id]]` may instead merge into one draw (`Draw
|
||||
two merge passes (`draw_merge_module`) write each command's first vertex in the merged draw, and
|
||||
the vertex function, compiled as its merged variant (`VariantKey::merged_draws`), finds its
|
||||
command by that prefix and runs the command's vertex, instance and buffers, in the commands'
|
||||
order. A kernel that encodes commands writes the records that start at
|
||||
`bind::indirect_commands::records_address` of the buffer's ID, outside every Metal address, and
|
||||
finds them only at their start: records may run past later IDs' starts, and a resident set
|
||||
(`bind::ResidentSet`) keeps each records range whole. Each of the kernel's writes of a command's
|
||||
record also stores 1 at the command's written flag, a `u32` a command past the records
|
||||
(`bind::indirect_commands::written_flag_offset`), where the storage holds them; storage that ends
|
||||
at its records takes none. A consumer whose own writes of the records set the flags too may reset
|
||||
only the flagged records of a run of commands, clearing each flag with its record.
|
||||
order. A buffer's records start at `bind::indirect_commands::records_address` of its ID, outside
|
||||
every Metal address; records may run past later IDs' starts, and a resident set
|
||||
(`bind::ResidentSet`) keeps each records range whole. Storage may hold a written flag per command,
|
||||
a `u32` a command past the records (`bind::indirect_commands::written_flag_offset`): a consumer
|
||||
whose own writes of the records set the flags may reset only the flagged records of a run of
|
||||
commands, clearing each flag with its record.
|
||||
|
||||
## 7. Caching
|
||||
|
||||
|
||||
+7
-7
@@ -40,7 +40,7 @@ Columns:
|
||||
|
||||
| Kind | `metal-measured` | `metal-documented` | `metal-takes` | `device` | `ours` | `unknown` | `delegated` | `-` |
|
||||
|---|---|---|---|---|---|---|---|---|
|
||||
| Translator and front-end refusals | 0 | 0 | 0 | 44 | 55 | 0 | 0 | 36 |
|
||||
| Translator and front-end refusals | 0 | 0 | 0 | 44 | 54 | 0 | 0 | 37 |
|
||||
| Binder refusals at a device limit | 0 | 0 | 0 | 9 | 0 | 0 | 0 | 0 |
|
||||
| Translation caps | 0 | 0 | 0 | 0 | 14 | 0 | 0 | 0 |
|
||||
| Rate maps the compile layer does not compile | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
|
||||
@@ -78,7 +78,7 @@ Columns:
|
||||
| `SimdgroupMatrix16x16x16` | A 16x16x16 simdgroup matrix product (`air.simdgroup_matrix_16x16x16_[widening_]multiply_accumulate`), in any stage | every device (not implemented) | `ours` | 1: `crates/metal2vulkan/src/lower/simd/matrix.rs (select)` | `rare`: 16x16x16 simdgroup matrix products (Metal: Apple10 GPUs and later) |
|
||||
| `ArgumentBufferPointers` | Argument buffers holding buffer pointers (dynamic roots) | devices without buffer device addresses (`addressed_needs`) | `device` | 1: `crates/metal2vulkan/src/device/metal.rs (unsupported_features)` | `app`: argument buffers holding buffer pointers |
|
||||
| `ArgumentBufferTextures` | Argument buffers holding textures or samplers (handle domain) | devices without a capability the site computes (`gaps`); devices without a capability the site computes (`missing`); every device (not implemented) | `ours` | 15: `crates/metal2vulkan/src/bind/heap.rs (array)`, `crates/metal2vulkan/src/bind/heap.rs (member_texel_view, 2 sites)` (+8) | `app`: argument buffers holding textures and samplers (bindless) |
|
||||
| `ArgumentBufferObjects` | Argument-buffer members that are pipeline states, ICBs, function tables, or acceleration structures | every device (not implemented) | `ours` | 6: `crates/metal2vulkan/src/lower/access/encode.rs (select_command, 3 sites)`, `crates/metal2vulkan/src/lower/access/icb.rs (select)` (+2) | `rare`: pipeline states and ICBs in argument buffers |
|
||||
| `ArgumentBufferObjects` | Argument-buffer members that are pipeline states, ICBs, function tables, or acceleration structures | every device (not implemented) | `ours` | 4: `crates/metal2vulkan/src/lower/access/icb.rs (select)`, `crates/metal2vulkan/src/lower/access/object.rs (select)` (+2) | `rare`: pipeline states and ICBs in argument buffers |
|
||||
| `DereferenceLoadedPointer` | Dereferencing a pointer loaded from memory or made from an integer | devices short of a Vulkan feature the site names; devices without buffer device addresses (`addressed_needs`); every device (no Vulkan mechanism) | `device` | 4: `crates/metal2vulkan/src/lower/access/dynamic.rs (plan_misses)`, `crates/metal2vulkan/src/lower/access/local.rs (access_ptr)` (+2) | `app`: pointers loaded from argument buffers |
|
||||
| `PointerToInteger` | Storing a pointer or converting it to an integer | - | `-` | via a helper: 1: `crates/metal2vulkan/src/lower/access/dynamic.rs (require_addresses)` | `rare`: pointer to integer casts |
|
||||
| `PointerCompare` | Comparing pointers with different roots | - | `-` | via a helper: 1: `crates/metal2vulkan/src/lower/access/copy.rs (addressed)` | `rare`: comparing pointers of different roots |
|
||||
@@ -136,7 +136,7 @@ Columns:
|
||||
| `RayTracing` | | devices without a capability the site computes (`missing`); every device (no Vulkan mechanism); every device (not implemented) | `ours` | 12: `crates/metal2vulkan/src/bind/acceleration.rs (instance_record, 2 sites)`, `crates/metal2vulkan/src/lower/raytracing/mod.rs (instance_count)` (+5) | `rare`: ray tracing (out of scope by ruling) |
|
||||
| `Tensors` | | every device (not implemented) | `ours` | 2: `crates/metal2vulkan-air/src/canon/matmul2d/synth.rs (refuse)`, `crates/metal2vulkan/src/lower/select.rs (route_air)` | `rare`: shader tensors |
|
||||
| `RasterizationRateMap` | | devices without VkFeature::MultiViewport; devices without VkFeature::ShaderDrawParameters; devices without VkFeature::ShaderOutputViewportIndex; every device (not implemented) | `ours` | 2: `crates/metal2vulkan/src/lower/stage_io/plan.rs (region_viewport, 2 sites)` | `rare`: rasterization rate maps |
|
||||
| `GpuEncodedIndirectCommands` | | devices short of a Vulkan feature the site names; devices without buffer device addresses (`addressed_needs`); every device (no Vulkan mechanism); every device (not implemented) | `ours` | 25: `crates/metal2vulkan/src/bind/replay.rs (preprocess)`, `crates/metal2vulkan/src/bind/replay.rs (replay_preprocess_module)` (+15) | `rare`: indirect command buffers encoded by a kernel |
|
||||
| `GpuEncodedIndirectCommands` | | devices short of a Vulkan feature the site names; devices without buffer device addresses (`addressed_needs`); every device (no Vulkan mechanism); every device (not implemented) | `ours` | 22: `crates/metal2vulkan/src/bind/replay.rs (preprocess)`, `crates/metal2vulkan/src/bind/replay.rs (replay_preprocess_module)` (+14) | `rare`: indirect command buffers encoded by a kernel |
|
||||
| `VulkanVersion` | The device's Vulkan version is below the 1.2 floor | devices without ApiVersion::V1_2 | `device` | 2: `crates/metal2vulkan/src/ash_interop/query.rs (query)`, `crates/metal2vulkan/src/device/derive.rs (from_queries)` | `none`: a device below Vulkan 1.2 |
|
||||
| `PushWindow` | The device's `maxPushConstantsSize` is below the 256 bytes of the push window every stage is lowered for | devices without VkLimit::MaxPushConstantsSize | `device` | 1: `crates/metal2vulkan/src/device/derive.rs (from_queries)` | `none`: a device whose maxPushConstantsSize is below 256 bytes |
|
||||
| `IdentityDomains` | The identity pointer and handle domains (`PointerDomain::Identity`, `HandleDomain::Identity`) | devices without a capability the site computes (`all`); every device (not implemented) | `ours` | 7: `crates/metal2vulkan/src/device/derive.rs (identity_domains)`, `crates/metal2vulkan/src/lower/sampler/anisotropic.rs (select)` (+5) | `none`: the identity domains, which the runtime alone takes and which lower only kernels over buffer slots, textures in slots or argument buffers, and runtime samplers, so far |
|
||||
@@ -180,7 +180,7 @@ Columns:
|
||||
| `HeapTextureTiling` | A texture of a heap whose memory the device's optimal images do not take (a `Shared` heap on a device whose optimal images take no host-visible... | - | `-` | 0 | `app`: textures in Shared heaps on a device whose optimal images take no host memory |
|
||||
| `UndeclaredTextureUsage` | A shader write to a texture made without `ShaderWrite` (or `ShaderAtomic`), or a read of one made without `ShaderRead`, which plain Metal runs,... | - | `-` | 0 | `app`: a shader write to a texture made without ShaderWrite, which plain Metal runs |
|
||||
| `RenderTargetSize` | A render pass whose render area or layers are past the device's framebuffer limits (`Capability::Limit` names `MaxFramebufferWidth`,... | - | `-` | 0 | `rare`: a render area past a device's framebuffer limits |
|
||||
| `IndirectRenderState` | A render state a function sets on an indirect render command (`render_command::set_cull_mode`, `set_front_facing_winding`,... | every device (not implemented) | `ours` | 1: `crates/metal2vulkan/src/lower/access/encode.rs (select_command)` | `rare`: render state set by a kernel on an indirect command |
|
||||
| `IndirectRenderState` | A `depth_stencil_state` a function reads from an argument buffer or takes as a parameter, the state of an indirect render command, which no record... | - | `-` | via a helper: 2: `crates/metal2vulkan/src/lower/access/pointer.rs (unlowered)`, `crates/metal2vulkan/src/lower/select.rs (param_family)` | `rare`: render state set by a kernel on an indirect command |
|
||||
| `GlobalBuiltinInFragment` | A fragment function's read of a Metal 3.1 program-scope built-in variable that Metal does not lower there | every device (not implemented) | `ours` | 1: `crates/metal2vulkan/src/lower/select.rs (route_air)` | `rare`: Metal 3.1 global built-ins in fragment functions |
|
||||
| `PrivateRenderState` | A private fixed-function property of Metal's pipeline descriptor (Apple SPI, OpenGL on Metal's) set to a value whose effect the translation has... | devices without VkFeature::LogicOp; devices without VkFeature::RasterizationOrderColorAttachmentAccess; every device (not implemented) | `ours` | 7: `crates/metal2vulkan/src/bind/heap.rs (array)`, `crates/metal2vulkan/src/bind/plan/resources.rs (write_rounding)` (+5) | `none`: Apple-private pipeline fields of OpenGL on Metal (no public header) |
|
||||
| `ExtendedRangeBlend` | A blend the function computes in the shader, into an extended-range attachment (`BGRA10_XR`, `BGR10_XR`, `RGB10A8_2P_XR10` and their `_sRGB`... | every device (not implemented) | `ours` | 2: `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs (refused)`, `crates/metal2vulkan/src/lower/fragment/fetch.rs (extended_range_output)` | `system`: an extended-range (XR10) attachment blended from an output other than four half or float lanes; a 16-bit float attachment's storage-form blend of a second-source factor or a one-color-channel mask under fast math; the consumer's guests blend RGB10A8_2P_XR10 attachments |
|
||||
@@ -419,7 +419,7 @@ Each refusal's sites, with the function that builds it.
|
||||
- `feature::SimdgroupMatrix16x16x16`: `crates/metal2vulkan/src/lower/simd/matrix.rs (select)`
|
||||
- `feature::ArgumentBufferPointers`: `crates/metal2vulkan/src/device/metal.rs (unsupported_features)`
|
||||
- `feature::ArgumentBufferTextures`: `crates/metal2vulkan/src/bind/heap.rs (array)`; `crates/metal2vulkan/src/bind/heap.rs (member_texel_view, 2 sites)`; `crates/metal2vulkan/src/bind/heap.rs (member_view, 4 sites)`; `crates/metal2vulkan/src/bind/heap.rs (new)`; `crates/metal2vulkan/src/lower/access/handle.rs (select)`; `crates/metal2vulkan/src/lower/sampler/select.rs (select_one)`; `crates/metal2vulkan/src/lower/sampler/select.rs (select_sampling)`; `crates/metal2vulkan/src/lower/texture/atomic.rs (select)`; `crates/metal2vulkan/src/lower/texture/slot.rs (declare_heap, 2 sites)`; `crates/metal2vulkan/src/pipeline/link.rs (heap_set)`
|
||||
- `feature::ArgumentBufferObjects`: `crates/metal2vulkan/src/lower/access/encode.rs (select_command, 3 sites)`; `crates/metal2vulkan/src/lower/access/icb.rs (select)`; `crates/metal2vulkan/src/memory/provenance.rs (access)`; `crates/metal2vulkan/src/memory/provenance.rs (classify)`
|
||||
- `feature::ArgumentBufferObjects`: `crates/metal2vulkan/src/lower/access/icb.rs (select)`; `crates/metal2vulkan/src/lower/access/object.rs (select)`; `crates/metal2vulkan/src/memory/provenance.rs (access)`; `crates/metal2vulkan/src/memory/provenance.rs (classify)`
|
||||
- `feature::DereferenceLoadedPointer`: `crates/metal2vulkan/src/lower/access/dynamic.rs (plan_misses)`; `crates/metal2vulkan/src/lower/access/local.rs (access_ptr)`; `crates/metal2vulkan/src/lower/access/local.rs (threadgroup_constant_refusal)`; `crates/metal2vulkan/src/memory/plan.rs (analyze)`
|
||||
- `feature::PointerToInteger`: `crates/metal2vulkan/src/lower/access/dynamic.rs (require_addresses)`
|
||||
- `feature::PointerCompare`: `crates/metal2vulkan/src/lower/access/copy.rs (addressed)`
|
||||
@@ -476,7 +476,7 @@ Each refusal's sites, with the function that builds it.
|
||||
- `feature::RayTracing`: `crates/metal2vulkan/src/bind/acceleration.rs (instance_record, 2 sites)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs (instance_count)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs (intersect, 5 sites)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs (primitive_data_read)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs (select_param)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs (slot_of)`; `crates/metal2vulkan/src/lower/select.rs (route_air)`
|
||||
- `feature::Tensors`: `crates/metal2vulkan-air/src/canon/matmul2d/synth.rs (refuse)`; `crates/metal2vulkan/src/lower/select.rs (route_air)`
|
||||
- `feature::RasterizationRateMap`: `crates/metal2vulkan/src/lower/stage_io/plan.rs (region_viewport, 2 sites)`
|
||||
- `feature::GpuEncodedIndirectCommands`: `crates/metal2vulkan/src/bind/replay.rs (preprocess)`; `crates/metal2vulkan/src/bind/replay.rs (replay_preprocess_module)`; `crates/metal2vulkan/src/bind/replay/draws.rs (draw_replay_module)`; `crates/metal2vulkan/src/bind/replay/draws.rs (draw_replay_preprocess)`; `crates/metal2vulkan/src/bind/replay/merged.rs (draw_merge_module)`; `crates/metal2vulkan/src/lower/access/encode.rs (needs, 3 sites)`; `crates/metal2vulkan/src/lower/access/encode.rs (select_command)`; `crates/metal2vulkan/src/lower/access/icb.rs (needs, 2 sites)`; `crates/metal2vulkan/src/lower/access/icb.rs (select, 2 sites)`; `crates/metal2vulkan/src/lower/access/mod.rs (plan_replay, 3 sites)`; `crates/metal2vulkan/src/lower/mesh/mod.rs (plan_partial_groups)`; `crates/metal2vulkan/src/lower/select.rs (finish, 2 sites)`; `crates/metal2vulkan/src/lower/simd/divergent.rs (barriers)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs (indirect_range)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs (merged)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs (param)`; `crates/metal2vulkan/src/pipeline/compile.rs (analyze_one, 2 sites)`
|
||||
- `feature::GpuEncodedIndirectCommands`: `crates/metal2vulkan/src/bind/replay.rs (preprocess)`; `crates/metal2vulkan/src/bind/replay.rs (replay_preprocess_module)`; `crates/metal2vulkan/src/bind/replay/draws.rs (draw_replay_module)`; `crates/metal2vulkan/src/bind/replay/draws.rs (draw_replay_preprocess)`; `crates/metal2vulkan/src/bind/replay/merged.rs (draw_merge_module)`; `crates/metal2vulkan/src/lower/access/icb.rs (needs, 2 sites)`; `crates/metal2vulkan/src/lower/access/icb.rs (select, 2 sites)`; `crates/metal2vulkan/src/lower/access/mod.rs (plan_replay, 3 sites)`; `crates/metal2vulkan/src/lower/access/object.rs (select)`; `crates/metal2vulkan/src/lower/mesh/mod.rs (plan_partial_groups)`; `crates/metal2vulkan/src/lower/select.rs (finish, 2 sites)`; `crates/metal2vulkan/src/lower/simd/divergent.rs (barriers)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs (indirect_range)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs (merged)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs (param)`; `crates/metal2vulkan/src/pipeline/compile.rs (analyze_one, 2 sites)`
|
||||
- `feature::VulkanVersion`: `crates/metal2vulkan/src/ash_interop/query.rs (query)`; `crates/metal2vulkan/src/device/derive.rs (from_queries)`
|
||||
- `feature::PushWindow`: `crates/metal2vulkan/src/device/derive.rs (from_queries)`
|
||||
- `feature::IdentityDomains`: `crates/metal2vulkan/src/device/derive.rs (identity_domains)`; `crates/metal2vulkan/src/lower/sampler/anisotropic.rs (select)`; `crates/metal2vulkan/src/lower/sampler/mod.rs (finish)`; `crates/metal2vulkan/src/lower/select.rs (identity_admits)`; `crates/metal2vulkan/src/lower/sync/barrier.rs (require_seq_cst)`; `crates/metal2vulkan/src/lower/texture/slot.rs (storage_format)`; `crates/metal2vulkan/src/pipeline/link.rs (identity_set)`
|
||||
@@ -506,7 +506,7 @@ Each refusal's sites, with the function that builds it.
|
||||
- `feature::TextureSwizzle`: `crates/metal2vulkan/src/bind/heap.rs (member_texel_view)`; `crates/metal2vulkan/src/bind/plan/resources.rs (plain_texture)`; `crates/metal2vulkan/src/lower/sampler/select.rs (select_one)`; `crates/metal2vulkan/src/lower/texture/mod.rs (select_read_as)`; `crates/metal2vulkan/src/lower/texture/mod.rs (select_write)`; `crates/metal2vulkan/src/lower/texture/slice.rs (select)`
|
||||
- `feature::PrivateMemory`: `crates/metal2vulkan/src/lower/access/local.rs (device_arena)`
|
||||
- `feature::Reflection`: `crates/metal2vulkan/src/reflection/derive.rs (gap_at)`; `crates/metal2vulkan/src/reflection/derive.rs (read_attributes)`; `crates/metal2vulkan/src/reflection/derive.rs (specialized_reads)`; `crates/metal2vulkan/src/reflection/function.rs (attribute)`; `crates/metal2vulkan/src/reflection/function.rs (module_constants)`; `crates/metal2vulkan/src/reflection/function.rs (unmeasured)`; `crates/metal2vulkan/src/reflection/linked.rs (function)`; `crates/metal2vulkan/src/reflection/mod.rs (kernel_stage)`
|
||||
- `feature::IndirectRenderState`: `crates/metal2vulkan/src/lower/access/encode.rs (select_command)`
|
||||
- `feature::IndirectRenderState`: `crates/metal2vulkan/src/lower/access/pointer.rs (unlowered)`; `crates/metal2vulkan/src/lower/select.rs (param_family)`
|
||||
- `feature::GlobalBuiltinInFragment`: `crates/metal2vulkan/src/lower/select.rs (route_air)`
|
||||
- `feature::PrivateRenderState`: `crates/metal2vulkan/src/bind/heap.rs (array)`; `crates/metal2vulkan/src/bind/plan/resources.rs (write_rounding)`; `crates/metal2vulkan/src/lower/sampler/select.rs (clamps_reference)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs (alpha_test_refused)`; `crates/metal2vulkan/src/lower/texture/mod.rs (mode_rounded_write)`; `crates/metal2vulkan/src/pipeline/private_state.rs (logic_operation)`; `crates/metal2vulkan/src/pipeline/private_state.rs (refused)`
|
||||
- `feature::ExtendedRangeBlend`: `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs (refused)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs (extended_range_output)`
|
||||
|
||||
Reference in new issue
Block a user