radv/rt: Remove nir_intrinsic_execute_callable instrs in monolithic mode

It's allowed to place OpExecuteCallableKHR in a SPIR-V, even if the RT
pipeline doesn't contain any callable shaders. Unreal hits this case and
crashes. We can assume the intrinsic never gets executed, so we can
simply remove it.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32613>
This commit is contained in:
Friedrich Vock 2024-12-12 18:03:17 +01:00 committed by Marge Bot
parent 1b1003ca6f
commit 0c02a7e8e8

View file

@ -1771,7 +1771,12 @@ lower_rt_instruction_monolithic(nir_builder *b, nir_instr *instr, void *data)
switch (intr->intrinsic) {
case nir_intrinsic_execute_callable:
unreachable("nir_intrinsic_execute_callable");
/* It's allowed to place OpExecuteCallableKHR in a SPIR-V, even if the RT pipeline doesn't contain
* any callable shaders. However, it's impossible to execute the instruction in a valid way, so just remove any
* nir_intrinsic_execute_callable we encounter.
*/
nir_instr_remove(instr);
return true;
case nir_intrinsic_trace_ray: {
vars->payload_offset = nir_src_as_uint(intr->src[10]);