Jump to content
  • Advertisement
Sign in to follow this  
_void_

DX12 Shader Visibility on Root Signature

Recommended Posts

Hello guys!

 

My constant buffer view is used by geometry and pixel shaders but not vertex shader.

What would a good practice in this case to setup  constant buffer view visibility on the root signature?

Is it really worth creating two separate root parameters with visibility D3D12_SHADER_VISIBILITY_GEOMETRY and D3D12_SHADER_VISIBILITY_PIXEL or maybe one root paramter with visiblity D3D12_SHADER_VISIBILITY_ALL will suffice?

Is there a recommended way to set up root signature if the resource is visible to some shader stages but no all? Should you set it up for each stage or just make visible to all?

 

Thanks!

 

Edited by _void_

Share this post


Link to post
Share on other sites
Advertisement

On some hardware, the driver/hardware will need to do work for every shader that has visibility into a parameter. On other hardware, work only needs to be done per parameter, regardless of visibility. The happy medium is to declare each parameter with a single shader stage visibility where applicable, ALL where necessary, and then use the overall root signature visibility to scope down what ALL actually means.

Share this post


Link to post
Share on other sites

@SoldierOfLightThank you for the input!

I do not feel I am compeletely following you on the following statememnt

1 hour ago, SoldierOfLight said:

The happy medium is to declare each parameter with a single shader stage visibility where applicable, ALL where necessary, and then use the overall root signature visibility to scope down what ALL actually means.

What do you specifically mean by "applicable" and "necessary"? Maybe you can give an example.

Share this post


Link to post
Share on other sites

If your parameters only need to be visible to a single shader stage, then declare them as such. As a general rule of thumb, if they need to be visible to more than one, then declare them with ALL.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!