Improve efficiency of GLContext::TexSubImage2D when GL_UNPACK_ROW_LENGTH isn't supported

RESOLVED DUPLICATE of bug 697990

Status

()

Core
Graphics
RESOLVED DUPLICATE of bug 697990
6 years ago
6 years ago

People

(Reporter: ajuma, Assigned: ajuma)

Tracking

Trunk
ARM
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
On GPUs that don't support GL_UNPACK_ROW_LENGTH, we are currently doing a row-by-row upload when the row length of the source surface doesn't match the width of the region being uploaded. This means calling fTexSubImage2D once per row. It's probably more efficient to instead do a row-by-row memcpy of the region being uploaded from the source surface into a temporary buffer, and then make a single call to fTexSubImage2D to upload from the temporary buffer.
(Assignee)

Comment 1

6 years ago
Doing a memcpy to a temporary buffer followed by a single call to fTexSubImage2D gives us roughly a 10X speedup for our slowest uploads.
Assignee: nobody → ajuma
Status: NEW → ASSIGNED
(Assignee)

Comment 2

6 years ago
Created attachment 570729 [details] [diff] [review]
Copy to a temporary buffer when GL_UNPACK_ROW_LENGTH isn't supported.
Attachment #570729 - Flags: review?(jmuizelaar)
Comment on attachment 570729 [details] [diff] [review]
Copy to a temporary buffer when GL_UNPACK_ROW_LENGTH isn't supported.

Patchs look good! Let's get this in ASAP. Gives us a good perf win on Nexus S.
Attachment #570729 - Flags: feedback+
Comment on attachment 570729 [details] [diff] [review]
Copy to a temporary buffer when GL_UNPACK_ROW_LENGTH isn't supported.

Not thrilled with this patch, but it's clearly better than what we have. Please add a comment about why we choose the new approach instead of the old one.
Attachment #570729 - Flags: review?(jmuizelaar) → review+
(Assignee)

Comment 5

6 years ago
This was folded into Bug 697990.
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 697990
You need to log in before you can comment on or make changes to this bug.