• Advertisement
Sign in to follow this  

Max number of shader resources/constant buffers

This topic is 2332 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

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
Advertisement
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 MSDN docs 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 shader reflection information structures 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
Sign in to follow this  

  • Advertisement