Search code examples
c++directxdirect3d12

D3D12 Pipeline State Object use clarification


I'm working on my own D3D12 wrapper, and I'm in the beginning 'schema' phase.

I understand the purpose of the PSO in a very simple rendering pipeline, but say I've multiple objects, meshes, models, whatever terminology works best, and I would like to use a different pixel shader for each,
for clarification, I would make multiple PSOs for each of these objects correct?

Sorry for the simple question, it's just a clarification I really need, thank you.


Solution

  • You need a distinct Pipeline State Object for every unique combination of all states:

    • VS, PS, GS, etc. Shader Objects
    • Blend, Depth, and Raster state
    • Render Target format
    • Number of render targets (MRT vs. 1)
    • Sample count (MSAA vs. not)

    In practice that means at least one PSO per unique material in your entire scene.