After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 656303 - Improve cogl-pango's journal usage
Improve cogl-pango's journal usage
Status: RESOLVED FIXED
Product: cogl
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Cogl maintainer(s)
Cogl maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-08-10 17:34 UTC by Neil Roberts
Modified: 2011-08-11 13:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
cogl-pango-display-list: Use CoglPrimitive instead of CoglVertexBuffer (9.58 KB, patch)
2011-08-10 17:34 UTC, Neil Roberts
none Details | Review
cogl-pango-display-list: Use cogl_rectangles_with_texture_coords (9.66 KB, patch)
2011-08-10 17:35 UTC, Neil Roberts
none Details | Review

Description Neil Roberts 2011-08-10 17:34:57 UTC
When drawing text on the Sodaville platform Thomas was seeing the
pipeline validation of cogl_rectangle quite high in the list. As an
experiment I thought it would be good to get it to use cogl_rectangles
instead so that it can add multiple rectangles to the journal in one
call. That way it would only have to validate the pipeline once. In
the process of implementing this I took the opportunity to switch it
to use CoglAttributeBuffer instead of CoglVertexBuffer.

The results when using test-text-perf were:

With patch     Font size    String length   FPS
    N             10             10         77.54
    N             10            100         161.19
    Y             10             10         83.06
    Y             10            100         168.7

When the string length is 10 cogl-pango should be submitting the
layout through the journal, and when it is 100 it should be submitting
it through a VBO. The patch makes both cases slightly faster, although
I can't explain why it would be faster in the VBO case.

It would could be useful to test this on the Sodaville platform where
the balance between GPU and CPU is probably different.

I think we should just land the first patch but I'm not totally sure
whether the second patch is a good idea or not.
Comment 1 Neil Roberts 2011-08-10 17:34:59 UTC
Created attachment 193576 [details] [review]
cogl-pango-display-list: Use CoglPrimitive instead of CoglVertexBuffer

When rendering text through a VBO, CoglPangoDisplayList now uses the
CoglPrimitive API instead of CoglVertexBuffer. CoglVertexBuffer is
just a layer on top of the attirbute buffer API anyway so it should be
slightly faster.
Comment 2 Neil Roberts 2011-08-10 17:35:02 UTC
Created attachment 193577 [details] [review]
cogl-pango-display-list: Use cogl_rectangles_with_texture_coords

Instead of storing four vertices per rectangle in the array for a
texture node in the display list, it now only stores two in a format
that is acceptable to cogl_rectangles_with_texture_coords. That way
it can pass the array directly to that function. That function has the
advantage over cogl_rectangle that it doesn't need to validate the
pipeline for every quad so it should be slightly faster.

When the texture node is being rendered with a CoglPrimitive we now
map the buffer and expand the rectangles into 4 vertices as the data
is copied.
Comment 3 Neil Roberts 2011-08-11 13:52:41 UTC
Pushed as 9270412..df30641