Exemplo n.º 1
0
        public static OpenGLAsyncReadbackRequest CreateComputeBufferRequest(int computeBufferOpenGLName, int size)
        {
            var result = new OpenGLAsyncReadbackRequest();

            result.nativeTaskHandle = RequestComputeBufferMainThread(computeBufferOpenGLName, size);
            GL.IssuePluginEvent(GetKickstartFunctionPtr(), result.nativeTaskHandle);
            return(result);
        }
Exemplo n.º 2
0
        public static OpenGLAsyncReadbackRequest CreateTextureRequest(int textureOpenGLName, int mipmapLevel)
        {
            var result = new OpenGLAsyncReadbackRequest();

            result.nativeTaskHandle = RequestTextureMainThread(textureOpenGLName, mipmapLevel);
            GL.IssuePluginEvent(GetKickstartFunctionPtr(), result.nativeTaskHandle);
            return(result);
        }
Exemplo n.º 3
0
 public static UniversalAsyncGPUReadbackRequest OpenGLRequestComputeBuffer(int computeBuffer, int size)
 {
     return(new UniversalAsyncGPUReadbackRequest()
     {
         isPlugin = true,
         oRequest = OpenGLAsyncReadbackRequest.CreateComputeBufferRequest((int)computeBuffer, size)
     });
 }
Exemplo n.º 4
0
 public static UniversalAsyncGPUReadbackRequest OpenGLRequestTexture(int texture, int mipmapIndex)
 {
     return(new UniversalAsyncGPUReadbackRequest()
     {
         isPlugin = true,
         oRequest = OpenGLAsyncReadbackRequest.CreateTextureRequest((int)texture, mipmapIndex)
     });
 }
Exemplo n.º 5
0
 /// <summary>
 /// Request readback of a texture.
 /// </summary>
 /// <param name="src"></param>
 /// <param name="mipmapIndex"></param>
 /// <returns></returns>
 public static UniversalAsyncGPUReadbackRequest Request(Texture src, int mipmapIndex = 0)
 {
     if (SystemInfo.supportsAsyncGPUReadback)
     {
         return(new UniversalAsyncGPUReadbackRequest()
         {
             isPlugin = false,
             uDisposd = false,
             uRequest = AsyncGPUReadback.Request(src, mipIndex: mipmapIndex),
         });
     }
     else
     {
         return(new UniversalAsyncGPUReadbackRequest()
         {
             isPlugin = true,
             oRequest = OpenGLAsyncReadbackRequest.CreateTextureRequest(RenderTextureRegistery.GetFor(src).ToInt32(), mipmapIndex)
         });
     }
 }
Exemplo n.º 6
0
 public static UniversalAsyncGPUReadbackRequest Request(ComputeBuffer computeBuffer)
 {
     if (SystemInfo.supportsAsyncGPUReadback)
     {
         return(new UniversalAsyncGPUReadbackRequest()
         {
             isPlugin = false,
             uInited = true,
             uDisposd = false,
             uRequest = AsyncGPUReadback.Request(computeBuffer),
         });
     }
     else
     {
         return(new UniversalAsyncGPUReadbackRequest()
         {
             isPlugin = true,
             oRequest = OpenGLAsyncReadbackRequest.CreateComputeBufferRequest((int)computeBuffer.GetNativeBufferPtr(), computeBuffer.stride * computeBuffer.count),
         });
     }
 }
Exemplo n.º 7
0
 void Update()
 {
     OpenGLAsyncReadbackRequest.Update();
     RenderTextureRegistery.ClearDeadRefs();
 }