I'm in a bit of dilemma. My whole renderer is designed around a list of objects that I need to draw. They are split up into a few groups depending on the draw type (lines, polygons, textured polygons etc). Each of the groups with their own set of root signature and pipeline state, shaders etc. For each group I record draw calls to command lists for fast execution later.
Now I have come across objects that consists of more than one draw type. Some objects consist of both lines and polygons. I just need to send in a line to the pipeline, and the geometry shader can produce the necessary triangles. The thing is I still want to keep these objects together instead of splitting them up into several groups.
Consider that I use command lists, I have a few questions:
- Is it possible to draw triangles and lines in one draw call?
- Is is possible to have a geometry shader output both triangles and lines in the same call?
- Is it possible to draw several instances of the same object (DrawInstanced) with various types?
I'm afraid the answer is no to all of the above, especially when using command lists, because I would still have to switch pipeline state in the middle of executing a command list, right?
- Is it possible to switch pipeline state quickly in the middle of executing a command list? How?