Using DirectX 11 & Effect 11, I'm trying to understand how to draw efficiently two objects with different shaders. So first I set all the states and set the constant buffers up once for all. And while iterating through all of first object's meshes, all the previously set constant buffers stay available which is fine as you can see here.
And then I'm applying another pass (Pass.Apply() from Effect 11) to draw the second object. And at this point, all my constant buffers are destroyed as shown there.
So now I'm starting to wonder if the constant buffers cannot be set once for all on app startup and then be used/shared at anytime, across any shader. Or does it belong to the active shader only?
Thanks!