Let's say I have three command lists, A B and C. They are guaranteed to be submitted in order. If I call OMSetRenderTargets on list A, can I then ignore calling it on the B and C lists and assume they will be writing to the same render target?
OMSetRenderTargets per Command List?
Is it a necessity per list though? Wouldn't putting in a fence to ensure the correct setup has been processed be less work for the GPU than calling OMSetRenderTargets, RSSetViewports, and RSSetScissorRects for every list? To clarify, I'm making those calls per list now, but I'm just wondering if there's a better way to do it...
According to the documentation (link below), yes it is a necessity. There is some inheritance for bundles, but between direct command lists the pipeline state is reset.
GPUs aren't necessarily as stateful as your mental model might indicate. Each command list command isn't necessarily something that's executed by the GPU. It might simply be storing some CPU-side state which will be used by the driver when recording a subsequent command. In that case, since command lists can be recorded in parallel and submitted out-of-order, these types of commands need to be present in every command list.
Rather than try to pin hardware to a particular model where some states must be set by hardware commands, and others may be CPU-side tracking, D3D12 requires all command list state to fit into a model that supports either.