Sign in to follow this  
newMe

RWByteAddressBuffer strange behavior

Recommended Posts

newMe    249

Hi. I noticed some strange behavior of RWByteAddressBuffer. First it was like i could not initilize it when created. Then i noticed that a value put in it with the Store function does not stay there after the dispatch call and on top of it  there are actually only two functions i can operate with - Store and Load. InterlockedAdd does not seem to have any affect on it. Whatever value is put there i can retrieve only zero. Moreover, when called between  Store and  Load it erases the value put there with Store.

To sum up, 

 

Accum.Store(0, 901);

var = Accum.Load(0); 

 

works. Nothing else does. Even

 

Accum.Store(0, 901);

Accum.InterlockedAdd(0, 0, dummy);

var = Accum.Load(0);

 

would produce 0. Is it worth changing the driver for the graphic card? Maybe i do something incorrectly. I tried different variations, nothing works, now i have run out of options, but i would not want to change the driver if it cannot help.  As a topic with a little generality it probably deserves deletion after somebody answers it and all the more so if nobody does.

 

Share this post


Link to post
Share on other sites
newMe    249

I have another buffer that is coupled with a staging resource, i can write to it and read any result by cpu. It is working, i have no doubt about it, it is checked with other buffers, so i can read pretty much any value from any variable at any point. All the other buffers work as expected, i have no problem with them. The byte buffer gives me a hard time with everything but store and load, i cannot initilaze it, a value does not stay there, the member functions do not work. It behaves more like a shared memory than buffer. That is why i thought that maybe there was something wrong with  implementation. I know there are some issues regarding writing and reading from the byte buffer, an attention to the interpretation of the data should be paid, still i think that is not the problem.

Share this post


Link to post
Share on other sites
newMe    249

Actually, the only reason for me to have this buffer is to perform the atomic float add cause directcompute does not provide this option http://www.gamedev.net/topic/613648-dx11-interlockedadd-on-floats-in-pixel-shader-workaround/  So for now i have to settle for integral atomic add though it is not the best thing. Maybe i will figure out something later.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this