diff options
| author | Kal0s-design <356578040+Kal0s-design@users.noreply.github.com> | 2026-11-30 11:44:27 +0100 |
|---|---|---|
| committer | Kal0s-design <356578040+Kal0s-design@users.noreply.github.com> | 2026-11-30 17:56:52 +0100 |
| commit | e7b9959c55996c611f69a22b8aa7e18706644771 (patch) | |
| tree | 2a8defcc6cdeb09a2e3115cc9873e73565953c7e /runtime/test/code_hooks_test.cpp | |
| parent | 7663c34fcf805f0917f6637737579d54f598f636 (diff) | |
d3d12: give host sampler heaps every slot the shaders can reach
Shaders clamp a sampler index to 2,047 (leonida-shader emit/shader.rs:
"not the bound heap's own count, which a title heap smaller than 2,048
would need"), but HostHeap::new made a sampler heap with exactly the
title's count. With a title sampler heap of fewer than 2,048 samplers, an
index between its count and 2,047 (a number read from memory the host has
not got yet) read past the end of the host heap.
A host sampler heap now always has 2,048 slots; fill_null already makes
every slot a null point sampler, so the slots past the title's count read
as that. The title's own count is kept (up to 2,048): unlike the sibling
tree's version, slot 2,047 is not taken from a title heap that uses it,
since any clamped index now lands inside the heap anyway.
Test: sampler_heaps_have_every_slot_the_shaders_can_reach (a 16-sampler
title heap gets 2,048 host slots and keeps count 16; a 2,048 one keeps
2,048). On main it fails: the 16-sampler heap has 16 slots.
After ESAT's fix in the sibling VIctory tree (TaynanGT/Vice-Tay dd67ae7,
GPL-3.0).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/code_hooks_test.cpp')
0 files changed, 0 insertions, 0 deletions