Let's say I render 2 objects that are using the same shader (and the same
ID3D11VertexShader object). When I call
VSSetShader() to set the shader for the 1st object
DirectX has to change previous shader to the new one which takes some
GPU time. But when I then render the 2nd object and call
VSSetShader() again with the same argument(s) does it set the shader again (and take as much
GPU time as before) or is
DirectX "smart" enough to figure out it's the same shader and it doesn't have to change anything?
Actually, I'd like to ask a broader question - does the same hold true for other analogous state changing function calls? Like setting buffers, sampler states, blending states etc... Pretty much whenever it's a matter of "applying"/"setting as current" objects and states when I actually try to set the same as before.