Commit graph

26 commits

Author SHA1 Message Date
catbot
950059c86e fix(vulkan-rt): work around NVIDIA descriptor-heap AS-read device-loss (#15)
Reading an acceleration structure through VK_EXT_descriptor_heap aborts
with VK_ERROR_DEVICE_LOST on NVIDIA 610.43.02 — a brand-new-extension
driver fault isolated in #7 (engine setup is correct and validation-clean;
images/buffers through the same heap work, and both traceRayEXT and inline
rayQuery fault identically on the AS read).

An acceleration structure can equally be reached by its device address via
OpConvertUToAccelerationStructureKHR, which reads no descriptor and so never
touches the faulting heap path. glslang has no GLSL spelling for that
conversion, so VulkanShader rewrites the compiled SPIR-V at module-load
time: every `OpLoad %accelStruct <heap-ptr>` becomes a load of the TLAS
device address from a synthesized push-constant block followed by the
convert. RTPass pushes the active frame's TLAS address into that push
constant. User GLSL and example code are unchanged; acceleration structures
still bind into the heap normally.

The workaround is gated on Device::workaroundDescriptorHeapAS (true only on
the NVIDIA proprietary driver) and confined to one fenced block in
Crafter.Graphics-ShaderVulkan.cppm plus the RTPass push and the shaderInt64
feature toggle — delete those once a fixed NVIDIA driver ships and the heap
AS read becomes the direct path again.

Verified: VulkanTriangle ray-traces correctly on native NVIDIA (RTX 4090),
validation-layer-clean, no device loss. The SPIR-V rewrite was independently
validated with spirv-val on both the VulkanTriangle and Sponza raygen
modules.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 01:59:54 +00:00
catbot
464cb66063 docs(vulkan-rt): record native descriptor-heap AS read as a driver fault
Investigated the VK_ERROR_DEVICE_LOST on the native VulkanTriangle (#7).
Verified the engine side is correct and validation-clean: the BLAS/TLAS
build finishes before render (FinishInit waits), the built instance is
well-formed (identity transform, mask=0xFF, correct BLAS ref), and
vkWriteResourceDescriptorsEXT stores the TLAS device address at the
expected heap offset (confirmed by dumping the heap bytes). Khronos
validation 1.4.350 reports zero errors.

The fault is isolated to reading the acceleration structure through
VK_EXT_descriptor_heap:
- images/buffers via the same heap render fine (trace disabled -> the
  raygen imageStore path renders a full gradient);
- both traceRayEXT and inline rayQueryEXT (no SBT) fault identically on
  the AS read;
- reproduces with the AS descriptor at heap byte 0 / shader index 0 (no
  offset/stride ambiguity) and regardless of pAddressRange size.

NVIDIA 610.43.02 is the only descriptor_heap implementation available
(llvmpipe lacks the extension), so there is no second implementation to
cross-check. Conclusion: driver-side fault in NVIDIA's brand-new
VK_EXT_descriptor_heap acceleration-structure path; should be reported to
NVIDIA. The traceRayEXT call is left active so the example stays a
faithful reproducer. Documented in both READMEs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 22:21:57 +00:00
5553ded476 webgpu triangle 2026-05-18 18:43:30 +02:00
216972e73a new UI system 2026-05-01 23:35:37 +02:00
f8e142fb06 descriptor heap rewrite 2026-04-05 22:53:59 +02:00
d661c88ee2 cleaned up renderer 2026-03-09 20:10:19 +01:00
72bf6c83e1 windows build fix 2026-03-02 23:53:13 +01:00
b5e69c90fa Win32 vulkan window 2026-02-24 02:32:37 +01:00
d1b8e45fb6 new descriptor layout 2 2026-02-03 21:03:11 +01:00
74832c6824 templated pipeline 2026-01-31 21:08:42 +01:00
1d0b7a615b descriptor fixed 2026-01-29 23:43:54 +01:00
5e3a7738ed fixed descriptors 2026-01-29 23:31:56 +01:00
83bb8ebd61 instance transform 2026-01-29 20:35:55 +01:00
642cef78b1 buffered TLAS 2026-01-29 19:46:53 +01:00
550590d6ee rgba8 2026-01-29 19:26:02 +01:00
96b5d1a299 vulkan triangle 2026-01-29 19:18:47 +01:00
8b2fd773b1 working RT 2026-01-29 02:05:18 +01:00
e4e7c66808 RT descriptors 2026-01-29 01:31:17 +01:00
7b24f52764 RT pipeline 2026-01-29 00:45:02 +01:00
962cc4b8cb descriptor 2026-01-28 23:45:33 +01:00
9f62233a07 shader 2026-01-28 23:37:12 +01:00
e08d5f104a TLAS 2026-01-28 19:16:28 +01:00
2e11ac6484 improved vulkanbuffer 2026-01-28 18:51:11 +01:00
b49abf3d1a BLAS 2026-01-28 01:06:48 +01:00
e7d0bc8f8e new structure complete 2025-11-16 18:52:52 +01:00
c82c8c0887 commit 2025-11-16 15:32:03 +01:00
Renamed from example/VulkanTriangle/main.cpp (Browse further)