Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Two contexts - glReadPixels

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2012
    Posts
    11

    Two contexts - glReadPixels

    Hi I have OpenGL rendering server that sends rendered images based on request. Basic princip is simple: 1) get request 2) render to texture(pbuffer or fbo), call glReadPixels 3) send image.

    Problem is when too many requests are pending. GPU stalls when I call glReadPixels.

    Can it be solved by using two contexts in different threads ? Doesn't glReadPixels in one thread blocks all gl* operations on another ?

    Btw. is there better solution ? Async reading with two PBOs doesnt work very well, because there is very problematic balancing between incoming requests and reading pixels (I dont know if its better to render next request and wait for image to copy to cpu memory - but rendering can be very long and first request finish will take forever - or copy image right away - but another request may arrive and im copying pixels instead of rendering). The main problem: no signalisation in OpenGL whether reading pixels to cpu is done).

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    no signalisation in OpenGL whether reading pixels to cpu is done
    Nonsense. Just use a fence sync object.

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2012
    Posts
    11
    thx, I missed that, but I really want to know the answer to first question:
    Does glReadPixels in one thread stalls gl* operations on another thread if a have two contexts ?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •