Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Get Buffer from Constant Buffer


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 fs1   Members   -  Reputation: 376

Like
0Likes
Like

Posted 25 January 2014 - 09:40 AM

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,

Sponsor:

#2 Pachanoi   Members   -  Reputation: 822

Like
1Likes
Like

Posted 25 January 2014 - 01:43 PM

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);


#3 fs1   Members   -  Reputation: 376

Like
0Likes
Like

Posted 25 January 2014 - 02:32 PM

 

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, 25 January 2014 - 02:41 PM.


#4 Adam_42   Crossbones+   -  Reputation: 2814

Like
1Likes
Like

Posted 25 January 2014 - 02:44 PM

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).



#5 fs1   Members   -  Reputation: 376

Like
0Likes
Like

Posted 25 January 2014 - 02:53 PM

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, 25 January 2014 - 03:40 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS