Please note: We are aware of an issue affecting replies on the Arm Community forums, which may not be loading as expected.

We apologize for any inconvenience and appreciate your patience while we investigate and work to resolve the issue.

Thank you for your understanding.


This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Combined vs individual glClear performance

Hi,

Basically I wanted to know if calling glClear with all buffers bits to clear is faster than clearing them all individually.

So:

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

is faster thabn:

glClear(GL_COLOR_BUFFER_BIT);
glClear(GL_DEPTH_BUFFER_BIT);

Cheers!

Parents
  • It depends on where the clears are. 

    If they are before any glDraw...() calls in the render pass, then they will be combined. On Mali this is a free "start of tile" initialization.

    If they are after any draws then they will not be combined, and will be a "not free" shader-based clear.

Reply
  • It depends on where the clears are. 

    If they are before any glDraw...() calls in the render pass, then they will be combined. On Mali this is a free "start of tile" initialization.

    If they are after any draws then they will not be combined, and will be a "not free" shader-based clear.

Children