The title might not be precise. Let's say I have one material consisting of vertex and pixel shader, another one consisting of vertex, geometry and pixel shader, and yet another one consisting of vertex, hull, domain and pixel shader. I use these 3 materials (shaders) for 3 different objects. If I want to render all 3 objects in one frame can I just apply the first material, render the first object, apply the second one, render the second object and the same with the third one? Is there any restriction to "mixing" shader types this way?
I think there isn't but I'm asking because I'm getting a strange bug in my application. I have 1 material using only vertex and pixel shader and another one using tessellation (vertex, hull, domain and pixel). When I render only 1st object everythings works fine. If I render only 2nd object everythings works fine, as well. But when I try to render both in one frame my application seems to freeze/crash and I get system notification that my graphics card driver crashed. Am I using shaders incorrectly or should I just look for some bug in my code?
Update:
When I assigned a tessellation shader to my first object as well and tried to render both objects... it worked. Or at least it didn't crash like before. And it's a different shader (material) but with the same stages (vertex, hull, domain, pixel) as the other object's material.
Again - is there any restriction to mixing tessellation shader with non-tessellation one?
Update:
Found the culprit - my tessellation shader (vertex, hull, domain and pixel) set 4 stages as active and my other shader (vertex and pixel) used only 2. But I never disabled the unused shader stages (hull and domain) which caused the crash. Still, the main question was "Is it ok to mix shader stages?" which Sean's just answered.