diff options
| author | bobcatchris <83428450+bobcatchris@users.noreply.github.com> | 2026-11-29 20:38:40 -0600 |
|---|---|---|
| committer | bobcatchris <83428450+bobcatchris@users.noreply.github.com> | 2026-11-30 05:18:00 -0600 |
| commit | 0f8f57b6a04283ae35450a74e9ec2415c6bc6351 (patch) | |
| tree | f9595f0d1eac5513ab6cc76e5fc43b563fce3e0e /runtime/src/thread_stacks.cpp | |
| parent | d367675c705c758f731ae9eb603839a4ebb2283c (diff) | |
leonida-shader: hoist uniform createHandleFromHeap out of branches and loops (D3D12-SHADER-OPT-HOIST-HEAP-HANDLES)
Addresses the d3d12/docs/findings.md item ("descriptors made again in
every branch of a program (createHandleFromHeap of an index that is a
root constant plus an offset, behind a branch on a load)").
Adds Module::hoist_handles() under REUSE: marks uniform (nonuniform =
false) dx.op.createHandleFromHeap calls, their wrapping annotateHandle
calls, and their pure, non-trapping index/clamp operands
(cbufferLoadLegacy, integer non-div/rem arithmetic, casts, extracts,
dx.op.binary.i32 clamp), and hoists each in RPO order to the deepest
dominating block defining its operands. REUSE then collapses duplicate
handles across sibling branches and loops into a single descriptor
handle.
Nonuniform handles and handles whose index depends on branch-local
memory loads remain in their original blocks.
AI-assisted: Antigravity (Gemini 4 Neon)
Diffstat (limited to 'runtime/src/thread_stacks.cpp')
0 files changed, 0 insertions, 0 deletions