Jump to content
  • Advertisement
Sign in to follow this  
_void_

DX12 Shader Visibility on Root Signature

This topic is 383 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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!