When creating a PSO we must specify a Root Signature
D3D12_GRAPHICS_PIPELINE_STATE_DESC psoDesc = {};
psoDesc.pRootSignature = rootSignature.Get();
// fill out other fields ...
.
And again we must specify a Root Signature before recording commands into a CommandList
commandList->Reset(commandAllocator.Get(), pipelineState.Get());
commandList->SetGraphicsRootSignature(rootSignature.Get());
.
The weird part is that the same PSO is used in calling Reset on the CommandList, meaning the CommandList should already have access to the PSO's Root Signature. If one does not set the CommandList's Root Signature explicitly, then a D3D12 Error is generated due to undefined behavior. I suspect this design was put in place so that the CommandList could override it's parent PSO's Root Signature with a different one, but I have not yet tested this to see if this is the case. Anyone have information on this?
Seems weird that we need to set a Root Signature at all in the PSO if we have to then set the same Root Signature again in the CommandList using said PSO.