From 27d8a79ce3dd394ffa950294c0e83659148383d3 Mon Sep 17 00:00:00 2001 From: mklefrancois <38076163+mklefrancois@users.noreply.github.com> Date: Mon, 14 Dec 2020 17:13:43 +0100 Subject: [PATCH] Corrections + warning notices --- docs/vkrt_tutorial.md.htm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/vkrt_tutorial.md.htm b/docs/vkrt_tutorial.md.htm index 790487f..6c76782 100644 --- a/docs/vkrt_tutorial.md.htm +++ b/docs/vkrt_tutorial.md.htm @@ -1368,10 +1368,9 @@ itself, but hit groups can comprise up to 3 shaders (intersection, any hit, clos The ray generation and closest hit shaders can trace rays, making the ray tracing a potentially recursive process. To allow the underlying RTX layer to optimize the pipeline we indicate the maximum recursion depth used by our shaders. For -the simplistic shaders we currently have, we set this depth to 1, meaning that even if the shaders would trigger -recursion (ie. a hit shader calling `TraceRayEXT()`), this recursion would be prevented by setting the result of this trace -call as a miss. Note that it is preferable to keep the recursion level as low as possible, replacing it by a loop -formulation instead. +the simplistic shaders we currently have, we set this depth to 1, meaning that we must not trigger +recursion at all (i.e. a hit shader calling `TraceRayEXT()`). Note that it is preferable to keep the recursion level +as low as possible, replacing it by a loop formulation instead. ```` C rayPipelineInfo.setMaxPipelineRayRecursionDepth(1); // Ray depth @@ -2161,6 +2160,11 @@ At the end of the method, we destroy the shader module for the shadow miss shade m_device.destroy(shadowmissSM); ```` +!!! WARNING Recursion Limit + The spec does not guarantee a recursion check at runtime. If you exceed either + the recursion depth you reported in the raytrace pipeline create info, or the + physical device recursion limit, undefined behaviour results. + ## `traceRaysKHR` The addition of the new miss shader group has modified our shader binding table, which now looks like: