Merge lp:~compiz-team/compiz/gles2.scope_of_empty_vb_check into lp:~compiz-linaro-team/compiz/gles2
Status: | Superseded |
---|---|
Proposed branch: | lp:~compiz-team/compiz/gles2.scope_of_empty_vb_check |
Merge into: | lp:~compiz-linaro-team/compiz/gles2 |
Diff against target: |
261 lines (+80/-95) 6 files modified
plugins/compiztoolbox/src/compiztoolbox.cpp (+9/-12) plugins/decor/src/decor.cpp (+8/-13) plugins/opengl/src/paint.cpp (+4/-2) plugins/ring/src/ring.cpp (+17/-20) plugins/scale/src/scale.cpp (+6/-9) plugins/shift/src/shift.cpp (+36/-39) |
To merge this branch: | bzr merge lp:~compiz-team/compiz/gles2.scope_of_empty_vb_check |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel van Vugt | Needs Fixing | ||
Review via email: mp+117058@code.launchpad.net |
This proposal has been superseded by a proposal from 2012-08-08.
Commit message
Make checking to see if the vertex buffer is empty the responsibility of
GLWindow::glDraw and not the clients of that function.
While this is technically slower (incurred wrapped function overhead), it
is better encapsulation, since clients of glDraw less are coupled with the
implementation of glDraw.
Description of the change
Put the check for an empty vertex buffer inside of glDraw.
The more expensive part of calling glDraw so much is the associated calls to glDrawArrays with an empty buffer - we can effectively cull out this part by putting the check for an empty buffer inside of glDrawTexture. This decouples the "necessary optimization" from the clients of glDrawTexture.
While this is technically more expensive due to the extra wrapped function call overhead, most of that is mitigated by plugins doing the Right Thing [tm] and not registering a wrapped function for glDrawTexture.
I compared benchmarks through manual testing and there wasn't any noticable impact.
Unmerged revisions
- 3300. By Sam Spilsbury
-
Make checking to see if the vertex buffer is empty the responsibility of
GLWindow::glDraw and not the clients of that function.While this is technically slower (incurred wrapped function overhead), it
is better encapsulation, since clients of glDraw less coupled with the
implementation of glDraw.
There are still a lot of calculations we wish to avoid if number of vertices is zero. So I'd like to keep the if statements: >vertexBuffer ()->countVertices ()) { /* stuff to avoid */ }
if (gWindow-
I think we just want the 2-line check added to glDrawTexture. It's redundant but an extra layer of performance-safety.
So keep lines 86-87 and drop everything else?