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 4 of 4

Thread: Anroid, GLSurfaceView. Delay between onDrawFrame

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2018
    Posts
    7

    Anroid, GLSurfaceView. Delay between onDrawFrame

    Hello! Sorry for my English. I've got a problem with understanding of GLThread processing, i think)

    I wrote simple graphic engine. It uses 200MB of data that stored in 7 vao(static draw) to draw my scene using only glDrawArrays. onDrawFrame complite in 3-5ms, but between calling of onDrawFrame elapsing up to 60ms, min delay is about 15ms. It makes "freezes" on screen even as rendered scene is very simple. I have only one question: wtf? =) i don't understand what can happened in GLThread so long. No matter what render type i use, render continuously or when dirty, it looks the same both type. What can i do wrong? Or, maybe, i didn't make smth necessary... Thanks in advance for any help!

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,394
    You really haven't given much to go on here.

    Have you verified that the size of the GPU resources you're using (VBOs, textures, renderbuffers, etc.) isn't blowing past the amount of available GPU memory?

    Are you calling glFinish() or doing something that would cause a full pipeline flush?

    Have you brought this up in a GPU profiler to see what's going on?

    Try getting commenting out all of your draw calls to obtain an app that just clears the screen and renders with good performance. Gradually add things. That'll point out where your problem lies.

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2018
    Posts
    7
    Thanks for reply! It was very helpful, cause i haven't seen anywhere in example glFinish and think that gl call execute write when it called =) But how i can see, it puts in some buffer and executing not the same thread that calls onDrawFrame. That's ok, i understand where was mistake in measuring render time. Now i measure time from start of one onDrawFrame to start next onDrawFrame. And have many new surprises. For example, with empty onDrawFrame it is called by every 15-17ms. Empty, with no any api calls! Why is it so rarely?

  4. #4
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,394
    Quote Originally Posted by restangel View Post
    Now i measure time from start of one onDrawFrame to start next onDrawFrame. And have many new surprises.

    For example, with empty onDrawFrame it is called by every 15-17ms. Empty, with no any api calls! Why is it so rarely?
    It sounds like you're rendering on a 60Hz display with VSync. 60Hz = 16.66ms per frame.

    VSync avoids tearing by slowing down the rate at which the frames you render are presented on the screen to once per display cycle. After a frame or two this backs up into your draw loop (onDrawFrame), slowing it down to the same rate. This also has the effect of saving CPU and GPU cycles rendering frames that will never be displayed.

Posting Permissions

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