Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync changes from mozilla-central #3816

Merged
merged 3 commits into from Dec 18, 2019
Merged

Sync changes from mozilla-central #3816

merged 3 commits into from Dec 18, 2019

Conversation

@moz-gfx
Copy link

moz-gfx commented Dec 18, 2019

No description provided.

jfkthame and others added 3 commits Dec 18, 2019
Uploading texture data is showing up frequently in profiles on Adreno devices,
especially when zooming on a text-heavy page. Specifically, the time is spent in
glMapBufferRange and glBufferSubData, most likely when internally allocating the
buffer before transferring data in to it.

Currently, we are creating a new PBO, by calling glBufferData(), for each
individual upload region. This change makes it so that we calculate the required
size for all upload regions to a texture, then create single a PBO of the
required size. The entire buffer is then mapped only once, and each individual
upload chunk is written to it. This can require the driver to allocate a large
buffer, sometimes multiple megabytes in size. However, it handles this case much
better than allocating tens or even hundreds of smaller buffers.

An upload chunk may require more space in a PBO than the original CPU-side
buffer, so that the data is aligned correctly for performance or correctness
reasons. Therefore it is the caller of Device.upload_texture()'s responsibility
to call a new function, Device.required_upload_size(), to calculate the required
size beforehand.

On AMD Macs, there is a bug where PBO uploads from a non-zero offset can
fail. See bug 1603783. Therefore this patch preserves the current behaviour on
AMD Mac, reallocating a new PBO for each upload, therefore ensuring the offset
is always zero.

Differential Revision: https://phabricator.services.mozilla.com/D56382

[wrupdater] From https://hg.mozilla.org/mozilla-central/rev/44161695885886b689baae2ad8b357f81f3eef23
@moz-gfx
Copy link
Author

moz-gfx commented Dec 18, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Dec 18, 2019

📌 Commit f432b60 has been approved by moz-gfx

@bors-servo
Copy link
Contributor

bors-servo commented Dec 18, 2019

Testing commit f432b60 with merge b05363f...

bors-servo added a commit that referenced this pull request Dec 18, 2019
Sync changes from mozilla-central
@bors-servo
Copy link
Contributor

bors-servo commented Dec 18, 2019

☀️ Test successful - status-appveyor, status-taskcluster
Approved by: moz-gfx
Pushing b05363f to master...

@bors-servo bors-servo merged commit f432b60 into servo:master Dec 18, 2019
2 of 3 checks passed
2 of 3 checks passed
Community-TC (pull_request) TaskGroup: failure
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.