Jump to content

  • Log In with Google      Sign In   
  • Create Account

Calling all IT Pros from Canada and Australia.. we need your help! Support our site by taking a quick sponsored surveyand win a chance at a $50 Amazon gift card. Click here to get started!


UpdateSubresource & Constant Buffer Perfomance


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
1 reply to this topic

#1 wh1sp3rik   Members   -  Reputation: 248

Like
0Likes
Like

Posted 07 March 2014 - 10:13 AM

Hello,

 

I have a question about updaing contant buffer performance.

I would like to know how it works when I bind a constant buffer to let's say all shaders. ( it's VS, HS, DS, GS, PS, CS ).

 

Let's say, I will upload some per frame data and I am curious what steps it will do if I call UpdateSubresource function.

 

Microsoft says that UpdateSubresource does two copies. First copy goes to temporary storage and it's copied by CPU and second copy goes to non mappable memory and it's copied async by GPU. If I bind contant buffers to more shaders, does it mean, it will copy it multiple times for every shader ?

 

thank you very much.

 


DirectX 11, C++


Sponsor:

#2 DwarvesH   Members   -  Reputation: 506

Like
0Likes
Like

Posted 10 March 2014 - 01:37 AM

From what I read, you should use Map/Unmap with constant buffers.

 

And you should use multiple constant buffers, sorted by update frequency. You could have one buffer with view * projection matrix, camera position, SH and other stuff that doesn't change during a frame. Then on for things that change, but not that often, like material properties. Any decent engine will group your object when rendering by some common property, and material could be it. Then there is a buffer for per object constants, like the world matrix, relative light positions, etc...






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