The fan-out probe counts each draw's flagged triangles
A flagged draw drawn in parts draws its triangles from the first the
probe flagged to the last region by region
(rate_map_parted_region_triangles), but nothing said how many of those
are flagged themselves: the probe kept only the first and the last.
That density decides whether drawing blocks of flagged triangles apart
would cut the region-by-region triangles.
The probe's geometry stage now adds one, for a flagged triangle, into
the word its PrimitiveId picks of a fifth set of PROBE_COUNT_WORDS after
the flag (PROBE_SETS = 5, PROBE_DRAW_WORDS = 1 + PROBE_SETS *
PROBE_COUNT_WORDS, the only place the word count is stated). The
runtime sums that set (Probed::flagged_triangles) and counts it at the
probe: WorkCounts::rate_map_flagged_triangles. The pieces lane prints
it beside the parted draws' region-by-region triangles and checks it
is non-zero exactly where draws were flagged, and no more than those
triangles.
Tests: the probe's link test counts two atomic adds (the copies', the
flagged count's); the probe words' unit test sums the fifth set; the
fan-out device test checks its four flagged triangles.
The probe's GPU time, verified on lavapipe (LP_NUM_THREADS=1, as CI)
by the fan-out device test (rate_mapped_fan_out::a_host_step_fans_out_
the_commands_the_probe_does_not_flag, one probe of 8 draws, 4 flagged),
release runtime binaries under --cfg m2v_cpu_icd at 44eda17f1d (before)
and this change on that base (after, 44665e1bce), taking turns on msi,
rate_map_probe_gpu_nanos:
before 20.63, 3.44, 2.43 ms; after 16.36, 2.60, 1.79 ms (the first
round of each cold). No growth past the noise: each round's after is
below its before.
Also, from the landed device-local replay scratch (RUNTIME 2220): its
resident root table now lies at a multiple of 32 bytes, which fixes the
internal refusal (RootTable::resident_fields, a moved resident set)
that the old scratch could meet where the upload alignment is 16
(RADV, lavapipe), read from the code, not observed; the compute replay's
scratch (gpu_execute.rs) is upload_aligned to 32 with its table at
slots * SLOT_TABLE_BYTES + PARAMS_BYTES, a multiple of 32, so it has
none.
This commit is contained in:
1 parent
47fb2942e5
commit
758ed9348b
16 files changed
+87
-36
No files matched your search
@@ -204,7 +204,8 @@
|
||||
//! last triangle it flags, and counts the copies of the others. The probe is submitted on its
|
||||
//! own and waited for (`WorkCounts::rate_map_probes`, its GPU time
|
||||
//! `WorkCounts::rate_map_probe_gpu_nanos`, the host's wait `rate_map_probe_wait_nanos`); then a
|
||||
//! flagged draw (`WorkCounts::rate_map_flagged_draws`) is drawn in parts where it is a list of
|
||||
//! flagged draw (`WorkCounts::rate_map_flagged_draws`, its flagged triangles
|
||||
//! `rate_map_flagged_triangles`) is drawn in parts where it is a list of
|
||||
//! triangles of one instance whose pipeline reads no `[[primitive_id]]` and writes no memory
|
||||
//! (`render/fan_out.rs`, **Parts**, `WorkCounts::rate_map_parted_draws`): its triangles from the
|
||||
//! first flagged to the last region by region (`rate_map_parted_region_triangles`), those
|
||||
|
||||
@@ -4278,7 +4278,8 @@ impl DeferredPass {
|
||||
.map(Probed::of)
|
||||
.collect();
|
||||
let flagged = draws.iter().filter(|draw| draw.flagged.is_some()).count();
|
||||
device.shared().counts.rate_map_probe(flagged as u64);
|
||||
let triangles = draws.iter().map(|d| u64::from(d.flagged_triangles));
|
||||
(device.shared().counts).rate_map_probe(flagged as u64, triangles.sum());
|
||||
found_draws = draws.into();
|
||||
}
|
||||
probed = Some(recorded);
|
||||
|
||||
@@ -56,13 +56,15 @@ pub(super) struct FanOutDraw {
|
||||
|
||||
/// What the probe found of a draw it probed, from its words (`bind::fan_out::PROBE_DRAW_WORDS`):
|
||||
/// the copies its triangles emit (its counts summed), whether a triangle it does not flag is too
|
||||
/// wide for few copies (`bind::fan_out::FEW_COPIES`, a wide word marked), and the first and the
|
||||
/// last of its triangles it flagged, where it flagged one.
|
||||
/// wide for few copies (`bind::fan_out::FEW_COPIES`, a wide word marked), the first and the
|
||||
/// last of its triangles it flagged, where it flagged one, and how many it flagged (its flagged
|
||||
/// counts summed), each of each instance once.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub(super) struct Probed {
|
||||
pub(super) copies: u32,
|
||||
pub(super) wide: bool,
|
||||
pub(super) flagged: Option<(u32, u32)>,
|
||||
pub(super) flagged_triangles: u32,
|
||||
}
|
||||
|
||||
impl Probed {
|
||||
@@ -77,6 +79,7 @@ impl Probed {
|
||||
wide: set(1).any(|w| w != 0),
|
||||
flagged: (words.first().is_some_and(|&flag| flag != 0))
|
||||
.then(|| (u32::MAX - first, last.saturating_sub(1))),
|
||||
flagged_triangles: set(4).fold(0u32, u32::saturating_add),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,8 +53,8 @@ fn a_flagged_draw_s_parts_take_each_triangle_once_in_order() {
|
||||
}
|
||||
}
|
||||
|
||||
/// A probed draw's words: the counts summed, a wide mark, and the first and last flagged triangle
|
||||
/// from the least and the greatest of their raised words.
|
||||
/// A probed draw's words: the counts summed, a wide mark, the first and last flagged triangle
|
||||
/// from the least and the greatest of their raised words, and the flagged counts summed.
|
||||
#[test]
|
||||
fn a_probed_draw_s_words_name_its_first_and_last_flagged_triangle() {
|
||||
let lanes = PROBE_COUNT_WORDS as usize;
|
||||
@@ -67,6 +67,7 @@ fn a_probed_draw_s_words_name_its_first_and_last_flagged_triangle() {
|
||||
copies: 7,
|
||||
wide: false,
|
||||
flagged: None,
|
||||
flagged_triangles: 0,
|
||||
}
|
||||
);
|
||||
words[0] = 1;
|
||||
@@ -76,12 +77,16 @@ fn a_probed_draw_s_words_name_its_first_and_last_flagged_triangle() {
|
||||
words[1 + 2 * lanes + 8] = u32::MAX - 40;
|
||||
words[1 + 3 * lanes + 9] = 10;
|
||||
words[1 + 3 * lanes + 8] = 41;
|
||||
// Their counts, and a third flagged triangle's in triangle 9's lane.
|
||||
words[1 + 4 * lanes + 9] = 2;
|
||||
words[1 + 4 * lanes + 8] = 1;
|
||||
assert_eq!(
|
||||
Probed::of(&words),
|
||||
Probed {
|
||||
copies: 7,
|
||||
wide: true,
|
||||
flagged: Some((9, 40)),
|
||||
flagged_triangles: 3,
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -403,8 +403,10 @@ fn a_host_step_fans_out_the_commands_the_probe_does_not_flag() {
|
||||
let by_regions =
|
||||
after.rate_map_parted_region_triangles - before.rate_map_parted_region_triangles;
|
||||
let wait = after.rate_map_probe_wait_nanos - before.rate_map_probe_wait_nanos;
|
||||
let flagged = after.rate_map_flagged_triangles - before.rate_map_flagged_triangles;
|
||||
eprintln!(
|
||||
"RATE-MAP-FAN-OUT counts {counts:?} probe_gpu_nanos {probe_nanos}, waited {wait} ns; \
|
||||
{flagged} flagged triangles; \
|
||||
fan-out pipelines {ready} ready, {waited} waited for; {made} made at the step; {tables} \
|
||||
region tables uploaded; {few} drawn of few copies; {by_regions} triangles of draws in \
|
||||
parts region by region"
|
||||
@@ -423,6 +425,7 @@ fn a_host_step_fans_out_the_commands_the_probe_does_not_flag() {
|
||||
by_regions, 4,
|
||||
"triangles of draws in parts region by region"
|
||||
);
|
||||
assert_eq!(flagged, 4, "the triangles the probe flagged");
|
||||
assert!(wait > 0, "the host's wait for the probe");
|
||||
}
|
||||
false => assert_eq!(counts, [0; 4]),
|
||||
|
||||
@@ -235,6 +235,7 @@ pub(crate) struct Counters {
|
||||
rate_map_probe_gpu_nanos: AtomicU64,
|
||||
rate_map_probe_wait_nanos: AtomicU64,
|
||||
rate_map_flagged_draws: AtomicU64,
|
||||
rate_map_flagged_triangles: AtomicU64,
|
||||
rate_map_fanned_draws: AtomicU64,
|
||||
rate_map_fanned_few_draws: AtomicU64,
|
||||
rate_map_parted_draws: AtomicU64,
|
||||
@@ -2838,10 +2839,12 @@ impl Counters {
|
||||
}
|
||||
|
||||
/// A host step's probe of a rate-mapped pass's draws was submitted and waited for
|
||||
/// (`rate_mapped_pass.rs`, **Fan-out**), of which it flagged `flagged` draws.
|
||||
pub(crate) fn rate_map_probe(&self, flagged: u64) {
|
||||
/// (`rate_mapped_pass.rs`, **Fan-out**), of which it flagged `flagged` draws, of `triangles`
|
||||
/// flagged triangles.
|
||||
pub(crate) fn rate_map_probe(&self, flagged: u64, triangles: u64) {
|
||||
(self.rate_map_probes).fetch_add(1, Ordering::Relaxed);
|
||||
(self.rate_map_flagged_draws).fetch_add(flagged, Ordering::Relaxed);
|
||||
(self.rate_map_flagged_triangles).fetch_add(triangles, Ordering::Relaxed);
|
||||
}
|
||||
|
||||
/// A host step that fans its pass's triangles out took the making of a probe's or a
|
||||
@@ -7171,6 +7174,12 @@ pub struct WorkCounts {
|
||||
/// ([`rate_map_parted_draws`](Self::rate_map_parted_draws)), or region by region whole where
|
||||
/// it cannot be (`render/fan_out.rs`, **Parts**).
|
||||
pub rate_map_flagged_draws: u64,
|
||||
/// Their triangles the probes flagged, each of each instance once: against
|
||||
/// [`rate_map_parted_region_triangles`](Self::rate_map_parted_region_triangles), how many
|
||||
/// of the triangles a draw in parts draws region by region, from its first flagged one to
|
||||
/// its last, are flagged themselves (a flagged draw drawn whole region by region counts
|
||||
/// its flagged triangles here, its triangles there not).
|
||||
pub rate_map_flagged_triangles: u64,
|
||||
/// Executed commands' draws in rate-mapped passes drawn once, fanned out to the regions their
|
||||
/// triangles touch.
|
||||
pub rate_map_fanned_draws: u64,
|
||||
@@ -10327,6 +10336,8 @@ impl Device {
|
||||
rate_map_probe_gpu_nanos: counters.rate_map_probe_gpu_nanos.load(Ordering::Relaxed),
|
||||
rate_map_probe_wait_nanos: (counters.rate_map_probe_wait_nanos).load(Ordering::Relaxed),
|
||||
rate_map_flagged_draws: counters.rate_map_flagged_draws.load(Ordering::Relaxed),
|
||||
rate_map_flagged_triangles: (counters.rate_map_flagged_triangles)
|
||||
.load(Ordering::Relaxed),
|
||||
rate_map_fanned_draws: counters.rate_map_fanned_draws.load(Ordering::Relaxed),
|
||||
rate_map_fanned_few_draws: (counters.rate_map_fanned_few_draws).load(Ordering::Relaxed),
|
||||
rate_map_parted_draws: (counters.rate_map_parted_draws).load(Ordering::Relaxed),
|
||||
|
||||
@@ -33,7 +33,8 @@
|
||||
//! **Fan-out**), after a probe; under `Exact` (`rate_mapped_pieces_host_step_exact`) every draw
|
||||
//! is drawn region by region, as at `commit`. The line then states the probes, the draws they
|
||||
//! flagged, the draws fanned out, the flagged ones drawn in parts and their triangles drawn
|
||||
//! region by region (`rate_map_parted_draws`, `rate_map_parted_region_triangles`), and the
|
||||
//! region by region (`rate_map_parted_draws`, `rate_map_parted_region_triangles`) and how many
|
||||
//! of those the probe flagged (`rate_map_flagged_triangles`), and the
|
||||
//! probes' GPU time and the host's wait for them (`rate_map_probe_wait_nanos`); fanned out, a
|
||||
//! draw is never cut into ranges, so only the region-by-region frames are checked for ranges and
|
||||
//! pieces, and a fanned-out frame for its probe, the host's wait for it and its fanned-out draws.
|
||||
@@ -113,8 +114,8 @@ const PIECE_LIMIT: Duration = Duration::from_secs(1);
|
||||
/// timed, their GPU time and the longest's; the probes, the draws they flagged, the draws fanned
|
||||
/// out and the probes' GPU time; the host step's time and making; the fan-out's pipelines; the
|
||||
/// draws of few copies; the draws in parts and their triangles drawn region by region; the
|
||||
/// host's wait for the probes.
|
||||
fn counts(work: &WorkCounts) -> [u64; 18] {
|
||||
/// host's wait for the probes; the triangles the probes flagged.
|
||||
fn counts(work: &WorkCounts) -> [u64; 19] {
|
||||
[
|
||||
work.rate_map_pieces,
|
||||
work.rate_map_index_ranges,
|
||||
@@ -134,6 +135,7 @@ fn counts(work: &WorkCounts) -> [u64; 18] {
|
||||
work.rate_map_parted_draws,
|
||||
work.rate_map_parted_region_triangles,
|
||||
work.rate_map_probe_wait_nanos,
|
||||
work.rate_map_flagged_triangles,
|
||||
]
|
||||
}
|
||||
|
||||
@@ -389,7 +391,7 @@ fn pieces_frame(step: bool, policy: RateMapRegionPolicy, scale: u32, triangles:
|
||||
let [probes, flagged, fanned, probe_nanos] = [5, 6, 7, 8].map(delta);
|
||||
let [stepped, made, made_nanos, ready, waited] = [9, 10, 11, 12, 13].map(delta);
|
||||
let few = delta(14);
|
||||
let [parted, by_regions, probe_wait] = [15, 16, 17].map(delta);
|
||||
let [parted, by_regions, probe_wait, flagged_triangles] = [15, 16, 17, 18].map(delta);
|
||||
let most = Duration::from_nanos(after[4]);
|
||||
let indices: u64 = draws.iter().map(|&count| u64::from(count)).sum();
|
||||
let mean = Duration::from_nanos(nanos / timed.max(1));
|
||||
@@ -406,7 +408,8 @@ fn pieces_frame(step: bool, policy: RateMapRegionPolicy, scale: u32, triangles:
|
||||
time, {} pieces ({ranges} index ranges past the first); {timed} pieces timed, the \
|
||||
longest {:.2} ms, the mean {:.2} ms; {probes} probes of {:.2} ms, waited for {:.2} ms, \
|
||||
{flagged} draws flagged, {fanned} fanned out ({few} of few copies), {parted} drawn in \
|
||||
parts ({by_regions} triangles region by region); the host step {:.1} ms, \
|
||||
parts ({by_regions} triangles region by region, {flagged_triangles} of them \
|
||||
flagged); the host step {:.1} ms, \
|
||||
{made} pipelines made there, \
|
||||
{:.1} ms creating render pipelines; the fan-out's pipelines {ready} ready at the \
|
||||
step, {waited} waited for; the commit {:.1} ms",
|
||||
@@ -434,6 +437,11 @@ fn pieces_frame(step: bool, policy: RateMapRegionPolicy, scale: u32, triangles:
|
||||
"draws flagged: {flagged}"
|
||||
);
|
||||
assert_eq!(parted, flagged, "flagged draws drawn in parts");
|
||||
assert_eq!(flagged_triangles > 0, flagged > 0, "triangles flagged");
|
||||
assert!(
|
||||
flagged_triangles <= by_regions,
|
||||
"{flagged_triangles} triangles flagged of {by_regions} region by region"
|
||||
);
|
||||
assert!(
|
||||
probe_wait > 0,
|
||||
"the host's wait for the probe was not counted"
|
||||
|
||||
@@ -36,16 +36,21 @@
|
||||
//! then y's: a line `vec4(ndc_lo, ndc_hi, a, b)`, a clip `vec4(W/2, X + W/2 − p₀, p₁ − X − W/2,
|
||||
//! 0)`.
|
||||
|
||||
/// The words of a probe's flags each probed draw takes: its flag, then the
|
||||
/// [`PROBE_COUNT_WORDS`] its triangles add their copies into, then as many its triangles that it
|
||||
/// does not flag and that reach more than [`FEW_COPIES`] pairs of segments mark, then as many
|
||||
/// that hold the greatest `u32::MAX − PrimitiveId` of its flagged triangles, then as many that
|
||||
/// hold the greatest `PrimitiveId + 1` of them (`pipeline::link::fan_out`, the probe), from word
|
||||
/// `PROBE_DRAW_WORDS·i` for the draw of index `i`, each zero before the probe. The consumer sums
|
||||
/// a draw's counts, draws a draw none of whose wide words is marked through its variant of few
|
||||
/// copies (`RegionFanOut::DrawFew`), and takes the first and the last flagged primitive of a
|
||||
/// flagged draw from the least and the greatest of the last two sets.
|
||||
pub const PROBE_DRAW_WORDS: u32 = 1 + 4 * PROBE_COUNT_WORDS;
|
||||
/// The words of a probe's flags each probed draw takes: its flag, then [`PROBE_SETS`] sets of
|
||||
/// [`PROBE_COUNT_WORDS`] (`pipeline::link::fan_out`, the probe), from word `PROBE_DRAW_WORDS·i`
|
||||
/// for the draw of index `i`, each zero before the probe. The consumer sums a draw's counts,
|
||||
/// draws a draw none of whose wide words is marked through its variant of few copies
|
||||
/// (`RegionFanOut::DrawFew`), takes the first and the last flagged primitive of a flagged draw
|
||||
/// from the least of the third set and the greatest of the fourth, and sums the fifth for its
|
||||
/// flagged triangles.
|
||||
pub const PROBE_DRAW_WORDS: u32 = 1 + PROBE_SETS * PROBE_COUNT_WORDS;
|
||||
|
||||
/// The sets of [`PROBE_COUNT_WORDS`] after a probed draw's flag ([`PROBE_DRAW_WORDS`]), in
|
||||
/// order: the counts its triangles add their copies into; the marks of its triangles that it
|
||||
/// does not flag and that reach more than [`FEW_COPIES`] pairs of segments; the greatest
|
||||
/// `u32::MAX − PrimitiveId` of its flagged triangles; the greatest `PrimitiveId + 1` of them;
|
||||
/// and the counts its flagged triangles add one each into.
|
||||
pub const PROBE_SETS: u32 = 5;
|
||||
|
||||
/// The words a probed draw's triangles add their copies into, and in each of the other sets of
|
||||
/// its words ([`PROBE_DRAW_WORDS`]) as many, a triangle the one of each set its `PrimitiveId`
|
||||
|
||||
@@ -702,7 +702,8 @@ pub enum WriteSource {
|
||||
/// consumer keeps for its probes, `bind::fan_out::PROBE_DRAW_WORDS` zeros at each draw's index
|
||||
/// (`BindState::region_fan_out`) before the draw, where the draw writes 1 into the first for
|
||||
/// a triangle it cannot fan out, adds into the counts after it the copies it would emit of
|
||||
/// the others, and marks those after them for a triangle too wide for few copies
|
||||
/// the others, marks those after them for a triangle too wide for few copies, and for a
|
||||
/// flagged triangle raises its first's and last's words and adds one into its flagged count
|
||||
/// (`GraphicsState::region_fan_out`); bound whole.
|
||||
RateMapFlags,
|
||||
/// The top-level structure of the acceleration structure bound at buffer slot `slot`
|
||||
|
||||
@@ -434,9 +434,10 @@ pub enum RegionFanOut {
|
||||
/// `u32`s from `PROBE_DRAW_WORDS·i`, `i` its pushed index (`PushField::RegionProbe`, at
|
||||
/// [`push_offset`](Self::push_offset) for stage `GEOMETRY`), it writes 1 into the first where a
|
||||
/// triangle of the draw touches more regions than [`copies`](Self::copies), or crosses `w = 0`,
|
||||
/// and raises the words after those below to that triangle's `PrimitiveId`; the consumer draws
|
||||
/// such a draw's triangles from the first flagged one to the last region by region, the others
|
||||
/// fanned out, or, where it cannot draw the draw in parts, the whole draw region by region. It
|
||||
/// and raises the words after those below to that triangle's `PrimitiveId` and adds one into
|
||||
/// its flagged count; the consumer draws such a draw's triangles from the first flagged one to
|
||||
/// the last region by region, the others fanned out, or, where it cannot draw the draw in parts,
|
||||
/// the whole draw region by region, and counts its flagged triangles. It
|
||||
/// adds the copies the draw emits of each triangle it fans out into one of the
|
||||
/// `bind::fan_out::PROBE_COUNT_WORDS` after the flag, which the draw's work counts; and writes 1
|
||||
/// into one of the as many after those where a triangle it does not flag touches more regions
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
//! as many after those, which mark the draw one its variant of few copies cannot draw; and for
|
||||
//! a triangle it flags, raises the word its `PrimitiveId` picks of the as many after those to
|
||||
//! `u32::MAX − PrimitiveId`, and of the as many after them to `PrimitiveId + 1`, so the
|
||||
//! consumer finds the draw's first and last flagged triangle. Its writes need
|
||||
//! consumer finds the draw's first and last flagged triangle, and adds one into the word it
|
||||
//! picks of the last set ([`PROBE_SETS`](crate::bind::fan_out::PROBE_SETS)), so the
|
||||
//! consumer counts them. Its writes need
|
||||
//! `vertexPipelineStoresAndAtomics`.
|
||||
|
||||
use super::geometry::{array, kf, ku, scalar, GeometryStages};
|
||||
@@ -405,12 +407,14 @@ pub(super) fn module(stages: &GeometryStages, fan: FanOutStage) -> BResult<Typed
|
||||
let zero = ku(fb, 0)?;
|
||||
fb.access_chain(base, &[zero, at])
|
||||
};
|
||||
// A flagged triangle: the draw's flag, and its `PrimitiveId` raised into the first's
|
||||
// and the last's words it picks.
|
||||
// A flagged triangle: the draw's flag, its `PrimitiveId` raised into the first's and
|
||||
// the last's words it picks, and one added into the flagged count it picks: the
|
||||
// sets after the counts, its word the same lane of each.
|
||||
let lanes = ku(&mut fb, PROBE_COUNT_WORDS)?;
|
||||
let wide_at = fb.binary(BinOp::IAdd, count_at, lanes)?;
|
||||
let first_at = fb.binary(BinOp::IAdd, wide_at, lanes)?;
|
||||
let last_at = fb.binary(BinOp::IAdd, first_at, lanes)?;
|
||||
let flagged_at = fb.binary(BinOp::IAdd, last_at, lanes)?;
|
||||
let most_id = ku(&mut fb, u32::MAX)?;
|
||||
let first = fb.binary(BinOp::ISub, most_id, id)?;
|
||||
let last = fb.binary(BinOp::IAdd, id, one)?;
|
||||
@@ -428,6 +432,8 @@ pub(super) fn module(stages: &GeometryStages, fan: FanOutStage) -> BResult<Typed
|
||||
value,
|
||||
)?;
|
||||
}
|
||||
let ptr = word_ptr(fb, flagged_at)?;
|
||||
fb.atomic(AtomicOp::IAdd, ptr, Scope::Device, Semantics::RELAXED, one)?;
|
||||
Ok(ArmEnd::FallThrough(Vec::new()))
|
||||
});
|
||||
fb.if_(&mut ctx, flagged, arm, None)?;
|
||||
|
||||
@@ -148,7 +148,7 @@ fn instructions(words: &[u32], op: crate::spv::Op) -> Vec<&[u32]> {
|
||||
/// [`PROBE_COUNT_WORDS`](crate::bind::fan_out::PROBE_COUNT_WORDS) that its `PrimitiveId` picks
|
||||
/// (masked by their number less one), whether or not the fragment function reads the primitive's
|
||||
/// index: no one word takes every triangle's add. A flagged triangle raises its draw's first's and
|
||||
/// last's words once each.
|
||||
/// last's words once each, and adds one into its flagged count once.
|
||||
#[test]
|
||||
fn a_probe_adds_a_triangle_s_copies_into_the_count_its_primitive_picks() {
|
||||
use crate::spv::{BuiltIn, Decoration, Op};
|
||||
@@ -165,7 +165,8 @@ fn a_probe_adds_a_triangle_s_copies_into_the_count_its_primitive_picks() {
|
||||
.find(|(_, class)| *class == Class::Triangle)
|
||||
.expect("the triangle stage");
|
||||
let words = &module.spirv;
|
||||
assert_eq!(instructions(words, Op::AtomicIAdd).len(), 1, "one add");
|
||||
// The copies' add, and a flagged triangle's count.
|
||||
assert_eq!(instructions(words, Op::AtomicIAdd).len(), 2, "two adds");
|
||||
// The flag's store, and the wide word's.
|
||||
assert_eq!(instructions(words, Op::AtomicStore).len(), 2, "two stores");
|
||||
// A flagged triangle's raise of the first's and the last's words.
|
||||
|
||||
@@ -292,8 +292,8 @@ pub enum SyntheticBinding {
|
||||
/// A fan-out probe's flags (`GraphicsState::region_fan_out`), a storage buffer of `u32`s its
|
||||
/// geometry stage writes into at the pushed index (`PushField::RegionProbe`,
|
||||
/// `bind::fan_out::PROBE_DRAW_WORDS` a draw): a flag, the copies its draw emits, the marks
|
||||
/// of its triangles too wide for few copies, and its first and last flagged triangle. Declared
|
||||
/// with the vertex stage's symbols.
|
||||
/// of its triangles too wide for few copies, its first and last flagged triangle, and the
|
||||
/// count of its flagged triangles. Declared with the vertex stage's symbols.
|
||||
RateMapFlags,
|
||||
/// The render encoder's tessellation factor buffer (`setTessellationFactorBuffer:offset:
|
||||
/// instanceStride:`), a read-only storage buffer of a tessellation pipeline's synthesized
|
||||
|
||||
@@ -1032,6 +1032,7 @@ const metal2vulkan::bind::fan_out::HEADER_ENTRIES pub const HEADER_ENTRIES: u32
|
||||
const metal2vulkan::bind::fan_out::MAX_SEGMENTS pub const MAX_SEGMENTS: u32
|
||||
const metal2vulkan::bind::fan_out::PROBE_COUNT_WORDS pub const PROBE_COUNT_WORDS: u32
|
||||
const metal2vulkan::bind::fan_out::PROBE_DRAW_WORDS pub const PROBE_DRAW_WORDS: u32
|
||||
const metal2vulkan::bind::fan_out::PROBE_SETS pub const PROBE_SETS: u32
|
||||
const metal2vulkan::bind::fan_out::TABLE_BYTES pub const TABLE_BYTES: u64
|
||||
const metal2vulkan::bind::fan_out::WIDEN_PIXELS pub const WIDEN_PIXELS: f64
|
||||
const metal2vulkan::bind::indirect_commands::BINDING_COUNT pub const BINDING_COUNT: usize
|
||||
@@ -1107,7 +1108,8 @@ const-value metal2vulkan::bind::fan_out::FEW_COPIES 4
|
||||
const-value metal2vulkan::bind::fan_out::HEADER_ENTRIES 2
|
||||
const-value metal2vulkan::bind::fan_out::MAX_SEGMENTS 128
|
||||
const-value metal2vulkan::bind::fan_out::PROBE_COUNT_WORDS 32
|
||||
const-value metal2vulkan::bind::fan_out::PROBE_DRAW_WORDS 1 + 4 * PROBE_COUNT_WORDS
|
||||
const-value metal2vulkan::bind::fan_out::PROBE_DRAW_WORDS 1 + PROBE_SETS * PROBE_COUNT_WORDS
|
||||
const-value metal2vulkan::bind::fan_out::PROBE_SETS 5
|
||||
const-value metal2vulkan::bind::fan_out::TABLE_BYTES (HEADER_ENTRIES as u64 + 4 * MAX_SEGMENTS as u64) * 16
|
||||
const-value metal2vulkan::bind::fan_out::WIDEN_PIXELS 0.125
|
||||
const-value metal2vulkan::bind::indirect_commands::BINDING_COUNT 32
|
||||
@@ -3257,6 +3259,7 @@ field metal2vulkan-runtime::WorkCounts.rate_map_fan_tables_uploaded pub rate_map
|
||||
field metal2vulkan-runtime::WorkCounts.rate_map_fanned_draws pub rate_map_fanned_draws: u64
|
||||
field metal2vulkan-runtime::WorkCounts.rate_map_fanned_few_draws pub rate_map_fanned_few_draws: u64
|
||||
field metal2vulkan-runtime::WorkCounts.rate_map_flagged_draws pub rate_map_flagged_draws: u64
|
||||
field metal2vulkan-runtime::WorkCounts.rate_map_flagged_triangles pub rate_map_flagged_triangles: u64
|
||||
field metal2vulkan-runtime::WorkCounts.rate_map_index_ranges pub rate_map_index_ranges: u64
|
||||
field metal2vulkan-runtime::WorkCounts.rate_map_parted_draws pub rate_map_parted_draws: u64
|
||||
field metal2vulkan-runtime::WorkCounts.rate_map_parted_region_triangles pub rate_map_parted_region_triangles: u64
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -829,6 +829,7 @@ surface! {
|
||||
const MAX_SEGMENTS;
|
||||
const PROBE_COUNT_WORDS;
|
||||
const PROBE_DRAW_WORDS;
|
||||
const PROBE_SETS;
|
||||
const TABLE_BYTES;
|
||||
const WIDEN_PIXELS;
|
||||
fn clip_entry;
|
||||
|
||||
+2
-1
@@ -5817,7 +5817,8 @@ each item named states the rule in full.
|
||||
flags, a list of triangles of one instance whose pipeline reads no `[[primitive_id]]` and
|
||||
writes no memory, is drawn in parts in its place: its triangles from the first the probe
|
||||
flagged to the last region by region, those before and after fanned out
|
||||
(`WorkCounts::rate_map_parted_draws`); another flagged draw is drawn region by region. The
|
||||
(`WorkCounts::rate_map_parted_draws`, and of those triangles the ones the probe flagged
|
||||
`rate_map_flagged_triangles`); another flagged draw is drawn region by region. The
|
||||
probe costs the host step a submission it waits for before the pass, which runs each probed
|
||||
draw's vertex function and geometry stage once and shades nothing (`WorkCounts::rate_map_probes`,
|
||||
`rate_map_probe_gpu_nanos`, the host's wait `rate_map_probe_wait_nanos`); a fanned-out draw
|
||||
|
||||
Reference in new issue
Block a user