Jump to content

View more

Image of the Day

Inventory ! Va falloir trouver une autre couleur pour le cadre D: #AzTroScreenshot #screenshotsaturday https://t.co/PvxhGL7cOH
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Get Buffer from Constant Buffer

4: Adsense

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   

445
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,

#2 Pachanoi   Members   

860
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   

445
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   Members   

3586
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   

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