# not set at the intrinsic if the NIR was created from SPIR-V.
index("enum gl_access_qualifier", "access")
+# call index for split raytracing shaders
+index("unsigned", "call_idx")
+
+# The stack size increment/decrement for split raytracing shaders
+index("unsigned", "stack_size")
+
# Alignment for offsets and addresses
#
# These two parameters, specify an alignment in terms of a multiplier and
# src[] = { sbt_index, payload }
intrinsic("execute_callable", src_comp=[1, -1])
+# Driver independent raytracing helpers
+
+# rt_resume is a helper that that be the first instruction accesing the
+# stack/scratch in a resume shader for a raytracing pipeline. It includes the
+# resume index (for nir_lower_shader_calls_internal reasons) and the stack size
+# of the variables spilled during the call. The stack size can be use to e.g.
+# adjust a stack pointer.
+intrinsic("rt_resume", indices=[CALL_IDX, STACK_SIZE])
+
+# Lowered version of execute_callabe that includes the index of the resume
+# shader, and the amount of scratch space needed for this call (.ie. how much
+# to increase a stack pointer by).
+# src[] = { sbt_index, payload }
+intrinsic("rt_execute_callable", src_comp=[1, -1], indices=[CALL_IDX,STACK_SIZE])
+
+# Lowered version of trace_ray in a similar vein to rt_execute_callable.
+# src same as trace_ray
+intrinsic("rt_trace_ray", src_comp=[-1, 1, 1, 1, 1, 1, 3, 1, 3, 1, -1],
+ indices=[CALL_IDX, STACK_SIZE])
+
+
# Atomic counters
#
# The *_var variants take an atomic_uint nir_variable, while the other,
}
case nir_intrinsic_trace_ray:
- case nir_intrinsic_execute_callable: {
+ case nir_intrinsic_execute_callable:
+ case nir_intrinsic_rt_trace_ray:
+ case nir_intrinsic_rt_execute_callable: {
nir_deref_instr *payload =
nir_src_as_deref(*nir_get_shader_call_payload_src(intrin));
combine_stores_with_deref(state, payload);
break;
case nir_intrinsic_trace_ray:
- case nir_intrinsic_execute_callable: {
+ case nir_intrinsic_execute_callable:
+ case nir_intrinsic_rt_trace_ray:
+ case nir_intrinsic_rt_execute_callable: {
nir_deref_instr *payload =
nir_src_as_deref(*nir_get_shader_call_payload_src(intrin));
}
case nir_intrinsic_trace_ray:
- case nir_intrinsic_execute_callable: {
+ case nir_intrinsic_execute_callable:
+ case nir_intrinsic_rt_trace_ray:
+ case nir_intrinsic_rt_execute_callable: {
if (debug) dump_instr(instr);
nir_deref_and_path payload = {
break;
}
- case nir_intrinsic_execute_callable: {
+ case nir_intrinsic_execute_callable:
+ case nir_intrinsic_rt_execute_callable: {
/* Mark payload as it can be used by the callee */
nir_deref_instr *src = nir_src_as_deref(intrin->src[1]);
clear_unused_for_read(&unused_writes, src);
break;
}
- case nir_intrinsic_trace_ray: {
+ case nir_intrinsic_trace_ray:
+ case nir_intrinsic_rt_trace_ray: {
/* Mark payload as it can be used by the callees */
nir_deref_instr *src = nir_src_as_deref(intrin->src[10]);
clear_unused_for_read(&unused_writes, src);