orka icon indicating copy to clipboard operation
orka copied to clipboard

Use PBO's to download textures to client memory asynchronously

Open onox opened this issue 5 years ago • 0 comments

Get_Data and Get_Compressed_Data in GL.Objects.Textures assume no PBO is bound and operate synchronously. Refactor these functions so they can operate (only) asynchronously (requires binding a buffer to a PBO and setting a fence).

  • [ ] Refactor Get_Data and Get_Compressed_Data (bind a buffer as a PBO + set a fence)
  • [ ] Add support for downloading data asynchronously in a Orka.Rendering.Textures (use job graph system)
  • [ ] Find out how to obtain a file descriptor from an EGL/GL sync object.

After the fence has been retired, we can either:

  1. Copy the data with Get_Data in Orka.Rendering.Buffers
  2. Map the buffer, copy to an array, unmap the buffer
  3. Make sure a specific region of a PMB has been bound as a PBO (useful for video streaming)

The job graph system might need to be modified in order to postpone the execution of the remaining jobs of a job graph until a fence has been retired. Currently we either need to wait on a fence in a GPU job or insert a new GPU job between the current GPU job and the next job in a job graph. However, this new GPU job might immediately get executed by the thread which processes the GPU jobs. Currently there's no way to tell the system to wait until the next frame.

https://on-demand.gputechconf.com/gtc/2012/presentations/S0356-GTC2012-Texture-Transfers.pdf

onox avatar Apr 27 '19 18:04 onox