Sign in to follow this  
Aqua Costa

Max number of shader resources/constant buffers

Recommended Posts

I know there is the D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT and D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUN constants, however I don't understand that does COMMONSHADER mean...

Does COMMONSHADER mean that the value of that constant is the maximum number of input slots per pipeline stage (vertex/hull/domain/geometry/pixel/compute shaders) or the sum of all stages?

Share this post


Link to post
Share on other sites
It's specific to the stage, but since it's the same value for all stages it's been sort of 'factored out' into a 'common namespace,' if you want to describe it as such. Have a look at the [url="http://msdn.microsoft.com/en-us/library/windows/desktop/ff476494(v=vs.85).aspx"]MSDN docs[/url] for the appropriate functions-- notice how you can feed the individual stage resources any start value within that range, and combine that with the independent resource setup tip you were asking about previously.

If you're more interested in the specifics, have a look at the commented assembly output of like FXC and note how they have a table of resources with slot indices, etc. I found this quite helpful to see when working to grok this myself :) You can also have a look at the various [url="http://msdn.microsoft.com/en-us/library/windows/desktop/dd607334(v=VS.85).aspx"]shader reflection information structures[/url] the D3DCompile DLL makes available to you if you want to figure out what goes where programmatically. This is what the D3D Effects framework uses internally when you get resource slots by name.

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