Callable Shader

A shader that is invoked from another shader with the CallShader intrinsic.

There is a parameter structure supplied at the CallShader call site that must match the parameter structure used in the callable shader pointed to by the requested index into the callable shader table supplied through the DispatchRays method. The callable shader must declare this parameter as inout. Additionally, the callable shader may read launch index and dimension inputs. For more information, see System Value Intrinsics.

Shader Type attribute

[shader("callable")]

Example

[shader("callable")]
void callable_main(inout MyParams params)
{
    // Perform some common operations and update params
    CallShader( ... );	// maybe
}