How to stop swapping

This topic contains 2 replies, has 2 voices, and was last updated by  hnyk 8 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #29794

    hnyk
    Member

    Hi

    I don’t want framebuffer to be shown on display. In my algorithm what is seen on display isn’t relevant and I want to make it as fast as possible so how can I stop it wasting resources on swapping buffers? Thanks.

    -hnyk

    #33043

    Gordon
    Moderator

    Assuming you are using the PVRShell abstraction layer with an API such as OpenGL ES 2 then you will have to look for where glSwapBuffers is called in this code. For instance, in PVRShellAPI.cpp::PVRShellInit::ApiRenderComplete(). You can remove this call to stop display.

    Alternatively, if you know the number of frames you require n then you could set the swap interval by calling setSwapInterval(n( or larger)) in the PVRShell::InitApplication() function. This means swaps will occur only every after every n times RenderScene() is called during the running of your program. You could use this to update the frame infrequently, but regularly during runtime or not at all. Passing 0 to this function should disable vetical syncing which could improve performance by itself.

    Unless glSwapBuffers is called then there is nothing to tell the GPU that the render has finished, so you will have to use glReadPixels in order to flush rendering operations at the program finish. I’m assuming you will do this anyway in order to retrieve data.

    #33044

    hnyk
    Member

    Thanks

Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.