1f6ae809ef
Both traceRay() and executeCallable() take a payload parameter which gets passed from the caller to the callee and which the callee can write to pass data back to the caller. We implement these by passing a pointer to the data structure in the callee to the caller as the second QWord on its stack. Coming out of spirv_to_nir, the incoming call payloads get the nir_var_shader_call_data variable mode allowing us to easily identify them. Outgoing call payloads get assigned the nir_var_shader_temp mode and will have been turned into function_temp by nir_lower_global_vars_to_local. All we have to do is crawl the shader looking for references to the nir_var_shader_call_data variable and rewrite those to use the passed in pointer. nir_lower_explicit_io will do the rest for us. Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7356>