Jump to content
  • Advertisement
Sign in to follow this  
Migi0027

DX11 DX11 - Updating global buffers?

This topic is 2075 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 guys! happy.png

 

So I'm in the process of improving my material system, and what I'm trying to accomplish now, using the reflection api, is to make the user able to assign their variable values by their name, going well for now, but!

 

Whenever I define a global variable in my shader, let us call it _mSize,  I can retrieve all kinds of information from it, it's offset, size, etc... These variables which aren't assigned to a buffer are put inside a global buffer (denoted as $Global in the docs), but is there any kind of way that I can modify/update this buffer, is it even possible?

 

Thank you, as usual. smile.png

-MIGI0027

Edited by Migi0027

Share this post


Link to post
Share on other sites
Advertisement

The $Globals constant buffer is not anymore special than the ones you explicitly declare, it'll show up through the reflection interfaces (probably always index 0). So if you already have a scheme going with querying meta data, and updating buffers with your variables, it's the same exact procedure.

Edited by Starnick

Share this post


Link to post
Share on other sites


(probably always index 0)

Not if there's another buffer specifically declared at cb0. For this and other reasons, the compiler gives no guarantee that $Globals will be at a specific index, so you have to query it by name.

Share this post


Link to post
Share on other sites

Alright, thanks for the input, really appreciate it! wink.png

 

I'll try and see if I can succeed in fetching the variables from the global buffer. What I guess that I do is simply query the variable by name, then find the buffer from that variable, and go on from there.

 

Thanks guys!

-MIGI0027

Edited by Migi0027

Share this post


Link to post
Share on other sites

 


(probably always index 0)

Not if there's another buffer specifically declared at cb0. For this and other reasons, the compiler gives no guarantee that $Globals will be at a specific index, so you have to query it by name.

 

 

True, true. I was thinking if you didn't explicitly assign any CB's to a register. But yeah "always" doesn't fit :)

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!