Skip to content

Read image from GPU on background thread #1254

Answered by robertosfield
cbrl asked this question in Q&A
Discussion options

You must be logged in to vote

OpenGL has a single threaded model where each graphics context can only deal with a single thread using it's FIFO at any one time. The FIFO is processed by the driver in-order and calls like glReadPixels requires that all commands+data in FIFO before it are fully processed before it can run, then finally there is the transfer from the GPU to main memory which is why you are seeing a hiccup and unfortunately why you can fix it.

If you can try to keep the images on GPU memory and process the images there.

Or adopt Vulkan/VulkanSceneGraph as it has a multi-threaded model.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@cbrl
Comment options

@robertosfield
Comment options

@cbrl
Comment options

Answer selected by robertosfield
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants