The Direct3D 12 upgrade was a little bit more involved.
First off, the Direct3D 12 renderer will not only have to accept the render targets to be used, but will also need to transition them to valid state. This is done at the start and the end of every single pass. The neutral state is the D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE
, and is swapped to the appropriate resource state when the pass starts. The state is transitioned back at the end of the pass.
The model matrix calculation is also moved into the RenderPassesSubsection
function, as this is the only implementation up to this point where we have gotten to add multithreading support. This array is sampled in much the same way as it is in the newer Direct3D 11 implementation, although rather than a buffer, we are using root constants to indicate the batch index of the model matrix to be used. This is quite a bit more convenient than the buffer method as used in the Direct3D 11 implementation.