docs(vulkan-rt): document dynamic descriptor_heap-index hit-shader fault (#23)
Indexing a `layout(descriptor_heap)` array with a runtime (non-constant) index inside a ray-tracing hit shader device-losts on NVIDIA 610.43.02, for both SSBO and sampled-image descriptors. A constant/spec-constant index is fine, and the same dynamic pattern works in fragment shaders, so it's an RT-stage-specific driver fault — the same family as #7/#15 (descriptor-heap AS reads) and #21/#22 (RT recursion + compute TLAS push). Unlike the AS-read fault, this cannot be worked around transparently: a sampled image has no device-address escape hatch the way an acceleration structure does (OpConvertUToAccelerationStructureKHR), and a buffer-only buffer_reference rewrite would need a whole address-table architecture while still leaving the texture half broken. So the resolution is the documented-limitation path (the precedent set by #7). Records the fault and its isolation in README's Native RT status and in the Sponza example README (the textured-closest-hit example, which already reads its albedo through a spec-constant slot for exactly this reason). Documents the recommended consumer pattern: bind one resource and index *within* it dynamically (single geometry SSBO / buffer_reference at a spec-constant slot; one texture2DArray indexed by layer) rather than selecting a descriptor dynamically — what the WebGPU path already does. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
5358aee2f6
commit
d08c7cea11
2 changed files with 136 additions and 0 deletions
25
README.md
25
README.md
|
|
@ -43,6 +43,31 @@ shaded through an intersection shader with an any-hit cut-out.
|
|||
> [examples/VulkanTriangle/README.md](examples/VulkanTriangle/README.md)
|
||||
> for the full investigation. WebGPU RT is unaffected.
|
||||
|
||||
> **Native RT limitation — dynamic `descriptor_heap` indexing in hit
|
||||
> shaders:** on the same NVIDIA driver, indexing a `descriptor_heap`
|
||||
> array with a **runtime (non-constant)** index inside a ray-tracing
|
||||
> **hit** shader also device-losts (`VK_ERROR_DEVICE_LOST`), for plain
|
||||
> SSBO **and** sampled-image descriptors. A **constant / spec-constant**
|
||||
> index is fine (that's why [Sponza](examples/Sponza/README.md)'s
|
||||
> closest-hit reads `albedo[albedoSlot]` through a spec constant), and
|
||||
> the identical dynamic pattern works in fragment shaders (the UI
|
||||
> renderer indexes `uiTextures[]` by per-item runtime slots) — so this
|
||||
> is **RT-stage-specific**, not a general heap problem. Unlike the
|
||||
> AS-read fault above this **cannot** be worked around transparently:
|
||||
> sampled images have no device-address escape hatch the way an
|
||||
> acceleration structure does (`OpConvertUToAccelerationStructureKHR`).
|
||||
> The recommended pattern for bindless per-mesh geometry/material is to
|
||||
> **bind one resource and index *within* it dynamically** rather than
|
||||
> selecting a descriptor dynamically: pack geometry into a single SSBO
|
||||
> (or reach it via `buffer_reference`) at a spec-constant slot and index
|
||||
> by element offset, and put materials in one `texture2DArray` indexed
|
||||
> by layer. Dynamic addressing *inside* a bound resource is ordinary
|
||||
> memory/layer addressing and is unaffected; only dynamic selection of a
|
||||
> *descriptor* faults. This is exactly what the WebGPU path already does
|
||||
> (bucketed texture arrays + a single buffer). Full investigation and
|
||||
> GLSL in [examples/Sponza/README.md](examples/Sponza/README.md) (issue
|
||||
> #23). WebGPU RT is unaffected.
|
||||
|
||||
## What's in here
|
||||
|
||||
- **Window** — Wayland, Win32, and DOM backends, swapchain ring / canvas
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue