Question by
CorvusUltima88 · May 07 at 03:53 PM ·
arraysgpuasynchronousreading data
AsyncGPUReadback.RequestIntoNativeArray - owner has been invalidated
i have next code :
private void Start()
{
CreateBuffer(ref _data, ref _rt);
StartCoroutine(StartEncoding(_rt,isLoging));
}
System.Collections.IEnumerator StartEncoding(RenderTexture oRTs, bool active)
{
while (active)
{
yield return new WaitForEndOfFrame();
AsyncGPUReadback.RequestIntoNativeArray(ref _data, oRTs, 0, request =>
{
if (request.hasError) { Debug.Log("GPU readback error detected."); return; }
Debug.Log("in Function ");
// encode to png and save
Debug.Log( "saved PNG file ");
});
}
}
Before even the first frame ends i get next error : 1[System.Byte] can no longer be accessed, since its owner has been invalidated .
What is happening ? i can get date to be used once and then i can not use it anymore ? My Q is how i can use AsyncGPUReadback.RequestIntoNativeArray corectly so i do not lost acces to my NativeArray ?
Comment
Your answer
Follow this Question
Related Questions
Read a part of the screen with AsyncGPUReadback 0 Answers
C# noob question (array realated) 1 Answer
Print quest into quest log 0 Answers
Can I use an array to determine an enclosed area and remove objects inside? 0 Answers
null array? 0 Answers