Jump to content
  • Advertisement
ritzmax72

C++ Where does the StructuredBuffer without register specification go?

Recommended Posts

Hi All, I am sorry for creating this small thread but I couldn't find the answer to where does a shader variable go if no register is mentioned in it's declaration.
In DirectXSamples nBodyGravity's shader file there is no mention of register in constant buffers or structuredbuffers, like 
StructuredBuffer<PoseVelo> g_buffPosVelo; 

There is no answer available in msdn. This is so basic people should be putting in msdn docs. 

Share this post


Link to post
Share on other sites
Advertisement

Hi, if the resource has no register declaration, it will simply be placed to the next available slot. Your best bet is to use DirectX shader reflection API to see which slot a resource takes. Unfortunately, you will have to use and provide d3dcompiler DLL file as part of your application if you use shader reflection (or D3DCompileFromFile). Using d3d compiler is also not allowed for UWP windows store applications.

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

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