Skip to content
Advertisement

How to know if an opengl function is going to block?

I am using wayland with IVI extension. I have a program, showing camera image in a sufrace, and it is controlled using dbus.

I found out that if the surface is hidden, then the opengl functions are blocking the program (It is glClear( GL_COLOR_BUFFER_BIT ); which blocks). I found this discussion, which explain that this behaviour is as expected.

Is there any way to check if the surface is not visible, so I can prevent the program to be blocked? Is there anything in opengl to see if a function is going to block?


My layer is number 1, surface is 5242880, and initially, when the progra starts, my scene is this:

root@pdm3:~# LayerManagerControl get scene
screen 0 (0x0)
---------------------------------------
- connector name:       Unknown-1
- resolution:           x=1280, y=480
- layer render order:   1(0x1),

    layer 1 (0x1)
    ---------------------------------------
    - destination region:   x=0, y=0, w=1280, h=480
    - source region:        x=0, y=0, w=1280, h=480
    - opacity:              1
    - visibility:           1
    - surface render order:
    - on screen:            0(0x0)

To show the image, and only then the process gets unblocked, and I can access it with dbus, I need to do next things:

 LayerManagerControl set layer 1 render order 5242880
 LayerManagerControl set surface 5242880 source region 0 0 200 200
 LayerManagerControl set surface 5242880 destination region 0 0 200 200
 LayerManagerControl set surface 5242880 visibility 1

Advertisement

Answer

Is there anything in opengl to see if a function is going to block?

No. What blocks and when is entirely implementation-defined, and could be completely different across vendors and may even depend on dynamic run-time conditions so what blocks in one frame may not block in another even if the API sequence is the same.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement