I'm new to DXR, so please
If I got it right, when we want to compile a ray tracing shader using the DirectX Shader Compiler, we need to specify lib_6_*
as the target profile.
Now assume I've got a HLSL file containing a single ray generation shader RayGen
whose root signature is specified by a RootSignature attribute of the form
#define MyRS "RootFlags(LOCAL_ROOT_SIGNATURE)," \
"DescriptorTable(" \
"UAV(u0, numDescriptors = 1)," \
"SRV(t0, numDescriptors = 1))"
[rootsignature(MyRS)]
[shader("raygeneration")]
void RayGen() {}
Using IDxcCompiler::Compile
, I'm able to compile both the shader itself using the target profile lib_6_3
and the root signature using the target profile rootsig_1_1
, but if I got it right it's not possible to invoke IDxcCompiler::Compile
such that the created IDxcBlob
contains both the shader and the root signature. (I've tried to add the argument -rootsig-define MyRS
to the call for the compilation of the shader, but it seems to me that the compiler expects the root signature specified in this way to be a global root signature.)
So, I end up with two IDxcBlob
's. Is there any possibility to "merge" them into a single one which can later be used to specify the shader as well in a call of ID3D12Device5::CreateRootSignature
?