The texture2d access::read_write qualifier seems only available on OSX. Is there a way to read/write the same texture inside a kernel (or other) metal function?
The reason is the written texture values may not be final and can be updated by other threads.
Thanks for the hint @warrenm. It works using an atomic buffer
device atomic_uint *buf [[ buffer(0) ]]
performing following steps:
kernel function that runs before the operationkernel computes a min value for a specific coordinate using atomic_fetch_min_explicit(buf[pos], val, memory_order_relaxed)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With