Jump to content
  • Advertisement
Sign in to follow this  
Funkymunky

DX12 Sharing shaders between PSOs

Recommended Posts

I have 3 PSOs that all use the same code for their vertex shader.  If I pass the same pointer into each of their D3D12_GRAPHICS_PIPELINE_STATE_DESC::VS fields, does that mean that they'll actually share the vertex shader?  Or are they each going to make individual copies of the shader?  (And by extension, does doing this eliminate a state change on the GPU?)

Share this post


Link to post
Share on other sites
Advertisement

It's going to depend on the driver. D3D will de-duplicate the bytecode and only send it to the driver once, but whether the driver recompiles it based on the surrounding state in the PSO, or whether it simply references it, is up to their discretion. It's also possible that they could have a middle ground and use a base compile followed by multiple patching steps for the surrounding state.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!