intel/rt: Add return instructions at the end of ray-tracing shaders
authorJason Ekstrand <jason@jlekstrand.net>
Thu, 6 Aug 2020 18:53:34 +0000 (13:53 -0500)
committerMarge Bot <eric+marge@anholt.net>
Wed, 25 Nov 2020 05:37:10 +0000 (05:37 +0000)
commitca88cd8e5a6d1c36e0f3842eee20edeb1d78eec2
treeabb34cf58539c96da36cb1c30124586e79b628d4
parent49778a7253dfce7a09c6d0e433c571a543d85065
intel/rt: Add return instructions at the end of ray-tracing shaders

Each callable ray-tracing shader shader stage has to perform a return
operation at the end.  In the case of raygen shaders, it retires the
bindless thread because the raygen shader is always the root of the call
tree.  In the case of any-hit shaders, the default action is accep the
hit.  For callable, miss, and closest-hit shaders, it does a return
operation.  The assumption is that the calling shader has placed a
BINDLESS_SHADER_RECORD address for the return in the first QWord of the
callee's scratch space.  The return operation simply loads this value
and calls a btd_spawn intrinsic to jump to it.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7356>
src/compiler/nir/nir_intrinsics.py
src/intel/Makefile.sources
src/intel/compiler/brw_nir_lower_shader_calls.c [new file with mode: 0644]
src/intel/compiler/brw_nir_rt.c
src/intel/compiler/brw_nir_rt.h
src/intel/compiler/brw_nir_rt_builder.h
src/intel/compiler/meson.build