hlsl – Are you able to append values to an appendbuffer after which instantly learn from that very same buffer?

hlsl – Are you able to append values to an appendbuffer after which instantly learn from that very same buffer?

[ad_1]

hlsl – Are you able to append values to an appendbuffer after which instantly learn from that very same buffer? – Sport Improvement Stack Trade







Sport Improvement Stack Trade is a query and reply website for skilled and unbiased sport builders. It solely takes a minute to enroll.

Signal as much as be a part of this neighborhood

Anyone can ask a query

Anyone can reply

The very best solutions are voted up and rise to the highest

Requested

Considered
9 instances

$begingroup$

I’m seeking to obtain the next: I’ve a compute shader that receives a Texture2D as enter, the place a small proportion of the pixels within the texture are white. The situation of the white pixels are unpredictable for any given body. I wish to learn the depth worth at these white pixels and retailer them in reminiscence. I cant put them in a RWStructuredBuffer as a result of there isn’t any technique to forestall every thread from overriding one other thread when storing values to the buffer. In fact I might assign every thread its personal place within the buffer, BUT THEN THIS WOULD INCLUDE ALL non-white pixels. I solely wish to retailer the values from white pixels, so the buffer can be a lot smaller in dimension than the feel. I can obtain this with an append buffer, just by having solely the white pixels append to the appendbuffer. However I do not know the way I can then subsequently READ from that appendbuffer in the identical compute shader. Is that potential?

Daniel Cardin is a brand new contributor to this website. Take care in asking for clarification, commenting, and answering.
Try our Code of Conduct.

$endgroup$

1

You need to log in to reply this query.

default

 

[ad_2]

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Scroll to Top