According to MS doc, most ID3DCommandList functions calls are cheap (like RSSetViewports, RSSetScissorRects....) but some of them which involve pipeline state changes are comparably expensive (like SetPipelineState, SetDescriptorHeap...).
So my question here is that: Does the driver do some basic check to prevent duplicate commands? For example, in one cmdlist we've called SetPipelineState(PSO1) and then later we call SetPipelineState(PSO2), and PSO1 and PSO2 have exact same bindings. Does driver intelligent enough to avoid the second SetPipelineState call during cmdlist execution? ( same as other cmd functions?) Or we as developer have to do this kind of check ourself?(like using hash value to identify duplicated func call with same params and avoid it?) or the perf delta is negligible?
Thanks