Jump to content
  • Advertisement
Sign in to follow this  
fs1

Get Buffer from Constant Buffer

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

Hi All,
Is there any other way to get a buffer from a certain slot in the constant buffer other than calling VSGetConstantBuffers ?
In addition, has anyone got a working snippet for VSGetConstantBuffers?
It is very poor documented and wanted some help.
Any help/insight is appreciated.
Thanks,

Share this post


Link to post
Share on other sites
Advertisement

If you are trying to retrieve a constant buffer that is currently bound to the device, this is the only way that I'm aware of to do it.  But it does seem fairly well documented to me.  The first parameter is the starting register, the second is the number of buffers you want to retrieve starting from the register you gave as the first parameter, and the last is a pointer to the array of ID3D11Buffer pointers where you want to store the results. So if you wanted to get the constant buffer in register 1, you would do something like:

ID3D11Buffer* buffer[1];
context->VSGetConstantBuffers(1, 1, &buffer);

Share this post


Link to post
Share on other sites

 

If you are trying to retrieve a constant buffer that is currently bound to the device, this is the only way that I'm aware of to do it.  But it does seem fairly well documented to me.  The first parameter is the starting register, the second is the number of buffers you want to retrieve starting from the register you gave as the first parameter, and the last is a pointer to the array of ID3D11Buffer pointers where you want to store the results. So if you wanted to get the constant buffer in register 1, you would do something like:

ID3D11Buffer* buffer[1];
context->VSGetConstantBuffers(1, 1, &buffer);

Thanks for your comment. There are nearly no examples as far as I searched.

Also how can I check if the function failed?

Any other workaround?

Edited by fs1

Share this post


Link to post
Share on other sites

The reason that there's a lack of examples is that I suspect most people never call that function. You can keep track of what you passed to VSSetConstantBuffers() if you want to know what's set on the device.

 

As there is no return code or other documented error messages, the function should always work (if you pass valid parameters).

Share this post


Link to post
Share on other sites

The reason that there's a lack of examples is that I suspect most people never call that function. You can keep track of what you passed to VSSetConstantBuffers() if you want to know what's set on the device.

 

As there is no return code or other documented error messages, the function should always work (if you pass valid parameters).

EDIT: Thanks to all.

Edited by fs1

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!