I am using AsyncGPUReadback to retrieve the contents of a Compute Buffer each frame, it sometimes works, but equally sometimes the request completes with “hasError” set. I’ve tried most obvious things I can think of, but still struggling to diagnose the issue.
That’s puzzled me slightly - what exactly does it mean by “disposed of”? If I have a AsyncGPUReadbackRequest object, in what way(s) could it be disposed? Can anyone elaborate more on the possible meanings of this?
Similarly, anyone else have experience using Async readbacks, and can offer up any insight into reasons the hasError property may be set, or tips on how to debug it?
> The result is accessible only for a single frame once is successfully fulfilled and this request is then disposed of in the following frame.
Looks like you can’t dispose it. It is disposed automatically by unity engine and after that you can’t use it anymore. I think you can’t save that reference outside of callback. Copy required data from it and leave it to die in the wild
A thousand thankyous! That gave me exactly the clue I needed to figure out my mistake, not sure how I glossed over that bit of the Doc.
I’m issuing a new request every frame, and keeping a Queue of them, and also each frame checking if the first request in the queue is “done” and if so grabbing the data. … But of course, it’s possible that more than one request could have completed in the same frame! So if I check the rest of the Queue for “done” requests, rather than just the first one only, then my “hasError” problems disappear!