Results 1 to 2 of 2

Thread: OpenGl ES 3.1 app in Android: flashes on Mali T880 GPU

  1. #1
    Newbie
    Join Date
    Jun 2018
    Posts
    1

    OpenGl ES 3.1 app in Android: flashes on Mali T880 GPU

    I have written a OpenGL ES 3.1 app for Android and I am battling with problems on one particular platform, ARM Mali GPU. The program appears to run correctly on Adreno and PowerVR GPUs.

    One frame is composed of several render passes. The render passes communicate with help of a Shader Storage Buffer Object and atomic counters. The whole thing looks like this:

    Code :
    Pass1_Initialize_SSBO_and_Atomic();
    glMemoryBarrier(GL_ALL_BARRIER_BITS);
     
    Pass2_Fill_SSBO_With_initial_Data();
    glMemoryBarrier(GL_ALL_BARRIER_BITS);
     
    for(i=0;i<N;i++)
       {
       Pass3_Render_Object(i);
       glMemoryBarrier(GL_ALL_BARRIER_BITS);
       }
     
    Pass4_Compose_Everything();
    Now, the problem is that on Mali the screen keeps flashing. I have made many recordings and watched them frame-by-frame. What happens is that about 95% of frames look correct, but every so often an arbitrary subset of Objects disappears, and reappears in the next frame.

    The problem is, I have no idea what can be causing the disappearing Objects. What I've tried so far is to keep removing code to see if the bug is still there - in an attempt to come up with the shortest piece of code that reproduces the problem. This approach fails because the more code I remove, the harder the bug gets to reproduce. Initially it keeps happening about twice per second, after several passes of removing various bits I can only reproduce it once per minute, and ultimately I cannot reproduce it anymore, but I have no idea if this is because I just removed the offending code or because I just passed some threshold and the bug is still there but is now very hard to reproduce.

    The second thing I tried is to measure the bug by taking a look at the SSBO. I memory-map it to CPU at certain moments between passes and make sure it really does contain what it should. Unfortunately as soon as I add a

    Code :
    glBindBuffer(GL_SHADER_STORAGE_BUFFER, mSSBO[0] );
    glMapBufferRange(GL_SHADER_STORAGE_BUFFER, 0, length, GL_MAP_READ_BIT);
    (...) // print the buffer
    glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
    glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
    pretty much anywhere in the application code, the bug simply disappears.

    In particular, when I remove the first glMemoryBarrier() and replace it with the above, the bug disappears completely ( I recorded 10 minutes worth of screen and watched this frame-by-frame, it's gone). This happens even if I don't inspect the buffer on CPU at all, I just map it and unmap it right away (which AFAIK should have the same effect like a memoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT) ??) This has raised a suspicion that maybe glMemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT) on Mali is buggy, so I wrote a test program to see - and this proved glMemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT) works just fine.

    I also have a Mali Graphics Debugger and I can connect it to the phone, but when I do the bug immediately disappears. I stop tracing - it again starts flashing once-twice per second.

    Would you have any advice how to approach such an issue?

    The code is GPL v2 and is fully available, but in this post I cannot include a link (it is 45k lines of Java, XML and GLSL though)

  2. #2
    Newbie
    Join Date
    Aug 2018
    Posts
    1
    Hi, sorry I don't know fix but may I ask you what phdo you have with Mali T880 GPU?
    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean