Repository navigation
R-7: sample with each immediate sampler a join picks - #56
Conversation
|
Two things before this can merge:
Also: this and #55 both add to the top of "Newest" in |
|
Thanks, both points taken.
On |
A join of two immediate samplers (one clamping, one wrapping) was refused as a descriptor chosen by control flow: descriptor_phi only joins heap loads. The join now picks a static sampler number; the sample is made with each sampler it can be and its channels are selected by that number.
When the sample cannot be made again with another sampler a join picks, or a level-of-detail query takes a picked sampler, the program is refused as a sampler chosen by control flow instead of drawing with the first sampler. A gather's four texel reads take no sampler and keep their path. AI-assisted.
10ebb6f to
12e25fa
Compare
|
Rebased on The |
|
The Median frame time from 170 s on: Side note: under Windows PowerShell 5.1 |
What changed
R-7 (partial): the 40 programs that failed with "emit: a descriptor chosen by control flow" now translate (37 pixel shaders:
PS_TexturedLit*,PS_TexturedDeferred,PS_MirrorReflectionTexturedDeferred,PS_PuddleDetect; 3 mesh shaders:MST_DS_TerrainTransform,MST_DS_CascadeShadows_PNTriTexture). The join was between two immediate samplers (one clamping, one wrapping), anddescriptor_phionly joins heap loads. The join now picks a static sampler number; the sample is made with each sampler it can be and its channels are selected by that number. Exact, at the cost of one more sample per affected read. A join of an immediate and a loaded sampler is still refused ("a sampler chosen by control flow").How it was tested
scripts\measure-run.ps1before and after (Playtest below).Checks run on this branch:
cargo test --workspace --locked: 656 passed, 0 failed, 18 ignored (run with-j 2 -- --test-threads=4)cargo clippy --workspace --all-targets --locked -- -D warningscargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo xtask policyNew unit test:
emit::lower::tests::a_sampler_chosen_by_control_flow_samples_with_each(a compute program picks one of two immediate samplers by a root constant; both are declared).leonida translate --list --validate --jobs 2with a release build:All 40 are emitted and pass the DXIL validator. The validator failures that remain (output signatures, mesh output over 32,768, out-of-bound coordinates) are on other programs; none of the 40 is among them.
Playtest
mainf3c94ca)translate --warm allon each build first)The difference between the two builds (about 1 %) is smaller than the difference between the two
mainruns (26 ms), so the second sample has no cost that this measure can see on this machine. Per-part medians are close too: preparing 137.5 / 123.4 ms onmainagainst 125.7 / 125.9 ms on the branch, GPU 55.5 / 62.9 ms against 58.8 / 58.7 ms.One thing that went wrong, also on
main: under Windows PowerShell 5.1,summary.txtreportslines: 0andNaNfor every run, because the colour codes are stripped with the`eescape that only PowerShell 7 knows, so no frame line matches. The figures above were taken from each run'sstderr.logwith the same patterns and the same 170 s start as the script. I will send that fix as its own PR.AI