[ad_1]
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
Asked
Viewed
9 times
I am looking to achieve the following: I have a compute shader that receives a Texture2D as input, where a small percentage of the pixels in the texture are white. The location of the white pixels are unpredictable for any given frame. I want to read the depth value at these white pixels and store them in memory. I cant put them in a RWStructuredBuffer because there is no way to prevent each thread from overriding another thread when storing values to the buffer. Of course I could assign each thread its own position in the buffer, BUT THEN THIS WOULD INCLUDE ALL non-white pixels. I only want to store the values from white pixels, so the buffer would be much smaller in size than the texture. I can achieve this with an append buffer, simply by having only the white pixels append to the appendbuffer. But I don’t know how I can then subsequently READ from that appendbuffer in the same compute shader. Is that possible?
\$\endgroup\$
1
You must log in to answer this question.
default
[ad_2]