Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

What is the reason to get AsyncGPUReadbackRequest.hasError true?

Discussion in 'General Graphics' started by guodongrong, Mar 31, 2020.

  1. guodongrong

    guodongrong

    Joined:
    Dec 4, 2019
    Posts:
    13
    I am using AsyncGPUReadbackRequest to read back the render rendering result asynchronously. Sometimes, I got both AsyncGPUReadbackRequest.done and AsyncGPUReadbackRequest.hasError ture. The document just said "This property is true if the request has encountered an error." for "hasError". But how can I know what error it is and why do I have this error?

    Anyone has experience on resolve this "hasError"?
     
  2. guodongrong

    guodongrong

    Joined:
    Dec 4, 2019
    Posts:
    13
    I see the document of AsyncGPUReadbackRequest said:

    "The result is accessible only for a single frame once is successfully fulfilled and this request is then disposed of in the following frame" and

    "A request that has been disposed of will result in the AsyncGPUReadbackRequest.hasError property being true".

    So I think my problem is that I have too many calls of "Camera.Render()" followed by "AsyncGPUReadback.Request" after every render in one frame. It seems that those renders cannot be all finished within one frame, and thus those finished in next frame will cause AsyncGPUReadbackRequest.hasError to be true.

    I do not care about delay for my application. Is there any way to have the result of AsyncGPUReadbackRequest last longer than one frame?
     
  3. tankorsmash

    tankorsmash

    Joined:
    Jul 20, 2019
    Posts:
    7
    Did you find an answer to this?