diff options
| author | eIBart0 <eIBart0@users.noreply.github.com> | 2026-11-21 15:19:09 -0300 |
|---|---|---|
| committer | eIBart0 <eIBart0@users.noreply.github.com> | 2026-11-21 15:19:09 -0300 |
| commit | 74e188c8a02fca0b13e9e12b861b888349f5b230 (patch) | |
| tree | 28ae3dbb6276e0cbf1d0ac21168a1e2a17be9236 /runtime/src/main.cpp | |
| parent | 793b06f12765571ed5e126d1d8944cec6a4dc805 (diff) | |
Translator: cache descriptor lookups per basic block
Each image instruction called %desc_lookup_fn for its T# and S#, so a shader sampling the same texture
many times in a block called it many times. The call count is what the driver's compile time follows
(ShadowRenderTiledCascades: 1550 static calls on main). desc_lookup_sgpr remembers the result per
(first SGPR, dwords) for the rest of the basic block.
- store_reg drops the entries overlapping the SGPR it writes; every write to %sgpr goes through it
(64-bit writes are two calls), apart from the function prologue, which runs before any block.
- translate() clears the cache when a basic block starts.
- Only lookups at the top level of the block are remembered (desc_cache_ok): an id made inside an op's
selection construct would not dominate the code after its merge.
- image_load passes its image index to image_load_typed instead of looking the T# up a second time.
- tests/test_desc_cache.py counts the calls.
Diffstat (limited to 'runtime/src/main.cpp')
0 files changed, 0 insertions, 0 deletions