Use PBO's to download textures to client memory asynchronously
Opened this issue · 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
andGet_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:
- Copy the data with
Get_Data
inOrka.Rendering.Buffers
- Map the buffer, copy to an array, unmap the buffer
- 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