1.2 KiB
1.2 KiB
VulkanTriangle
The minimal ray-traced example. Renders a single static triangle through
vkCmdTraceRaysKHR. No UI.
What it shows
Device::Initialize()+Window+ swapchain bring-up.- A
DescriptorHeapVulkansized for one image + one buffer slot, with slot ranges allocated via the bump-allocator API (AllocateImageSlots,AllocateBufferSlots). - A
PipelineRTVulkanbuilt from raygen / miss / closesthit SPIR-V shaders compiled at build time. Mesh::Buildconstructing a BLAS andRenderingElement3D::BuildTLASthe per-frame TLAS.- Direct descriptor writes via
vkWriteResourceDescriptorsEXTfor the swapchain views and TLAS device addresses. RTPass{&pipeline}plugged intowindow.passes— the canonical way to add ray tracing to a window in this library.
It's the smallest sensible test of the bindless VK_EXT_descriptor_heap
- ray-tracing path.
Run
cd examples/VulkanTriangle
crafter-build -r
You should see a 1280×720 window with a triangle filling roughly the centre.
Notes
raygen.glsl's traceRayEXT call is currently commented out — the
example exercises the dispatch and imageStore paths only. Uncomment
it to actually trace into the BLAS.