Take the fix/amd-view-heap-clamp branch of triippywhale's fork (as one commit)

Every host view heap ends at a null slot that view indices past the heap
read (a host that takes large heaps gets 2^21 views; one that caps them
keeps the capped heap), the cache key includes that limit, and
v_permlane16/x16 are lowered.

Both forks lower v_cvt_f32_f64. The IEEE form with its test is the one in
use; this branch's flush-to-zero form is kept beside it, unused, and its
test is ignored until the console's float mode for the instruction is
checked.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
fxcelessandClaude Fable 5.2 committed 2026-11-24 19:00:31 -05:00
1 parent 3bff182ef4
commit 31714deb2d
6 files changed
+302 -49

No files matched your search

+10 -5
View File
@@ -113,11 +113,11 @@ pub(crate) struct Geometry {
pub max_vertices: u32,
}
/// The null slot a host view heap keeps at its end when the title's heap did not fit in it
/// (0: no limit). Shaders translated while it is set read that slot for any view index at or
/// past it: a host that caps its heap (NVIDIA at 1 000 000 views; a retail game's heap is
/// larger) hung its GPU on reads past the end (GPU-based validation: "descriptor heap index
/// out of bounds"), which AMD's driver forgives.
/// The null slot every host view heap keeps at its end (0: no limit). Shaders translated while
/// it is set read that slot for any view index at or past it. A read past a heap's end is
/// undefined: a host that caps its heap (NVIDIA at 1 000 000 views; a retail game's heap is
/// larger) hung its GPU (GPU-based validation: "descriptor heap index out of bounds"), and AMD
/// RDNA3 took a page fault and removed the device.
static VIEW_LIMIT: std::sync::atomic::AtomicU32 = std::sync::atomic::AtomicU32::new(0);
/// See [`VIEW_LIMIT`]: `null_slot` is the last slot of the host's view heap, kept null.
@@ -125,6 +125,11 @@ pub fn set_view_heap_limit(null_slot: u32) {
VIEW_LIMIT.store(null_slot, std::sync::atomic::Ordering::Relaxed);
}
/// See [`VIEW_LIMIT`]: the null slot shaders translated now clamp view indices to (0: none).
pub fn view_heap_limit() -> u32 {
VIEW_LIMIT.load(std::sync::atomic::Ordering::Relaxed)
}
pub(crate) struct Shader {
pub m: Module,
pub t: Types,