🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Where does the StructuredBuffer without register specification go?

Started by
1 comment, last by turanszkij 5 years, 1 month ago

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. 

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.

This topic is closed to new replies.

Advertisement