Appending to an append buffer several times

Started by
7 comments, last by newMe 9 years, 1 month ago

Hi. Is it possible to append to an append buffer several times in one thread, say in a loop? All examples i have seen just consume and append or append a new item but once per thread.

For example, would something like this work:

Item newItem;

for( uint i=0; i< N; ++i)

{

newItem.param = i;

AppendBuffer.Append( newItem );

}

Thanks.

Advertisement

Why not just try it ?

And yes, it works.

Thank you for reply. I just did not want to take some unnecessary steps. If the answer was no, i would try some walkaround, if nobody answered, i would try it and share the result. Luckily you had the answer. Thank you again.

No problem. Please share your results anyway. I just used it once as a "debug log", not for actual useful stuff. But it was a loop, even with [allow_uav_condition]. Since append doesn't guarantee order - at least not across threads - I wonder about this for several appends from the same thread.

OK, it can take up to couple of days though. It is a part of a a little bigger thing, so i am not testing now anything, just thinking what disigne pass to take. And i dont care about the order just want to add new items to the whole bunch, then they are all treated in the next dispatch on equal terms.

You can, but keep an eye on performance. The more you write to an UAV, the less scalable the performance will be across multithreading hardware, which means performance may be greatly affected with each additional use if the GPU can't hide the latency.

OK, i have sort of finished it. The idea was to take one couple of append buffers and use them as a "fragment" buffers that can spawn particles to other append buffers based on a passed distance. The particals then are expanded to sprites. The sphere was completely expanded in a domain shader from a single vertex and i move its vertices with displacement map. So the whole process takes place on the gpu only. i dont like the way sprites interact though, case insted of blending to each other they blick and everything.

I'm guessing that your flickering is due to the non-deterministic ordering of particles in your append buffer. If you want to alpha blend the particles, then you'll need to sort them based on their distance from the camera.

This problem started when i changed blending stage settings. But before that i had another problem. Transparent edges of my sprites where eating through other sprites like in this problem http://www.gamedev.net/topic/524664-transparent-png-on-texture/ Alphatocoverageenable worked fine but then i could not adjust transparency. I added some randomness to sprites and some rotation but when i use bandicam somehow this adjustments stop working i dont know why. With them it looks a bit better, can not record it though. Blickering is worse with bandicam too. Thats what i got so far.

I have sort of found a walkaround with this flickering. When fading, i render smoke to a tecture and render it with a sprite, i changed the smoke to spheres, insted of expanding them to sprite in the geometry shader expand them to spheres in the domain shader. It is strange though,how rendering to a texture is different from rendering to a back buffer. Looks like it is the same process, why does it flicker in the buffer then.

This topic is closed to new replies.

Advertisement