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 #3727

Merged
merged 1 commit into from Jul 30, 2019
Merged

Sync changes from mozilla-central #3727

merged 1 commit into from Jul 30, 2019

Conversation

@moz-gfx
Copy link

moz-gfx commented Jul 30, 2019

This change is Reviewable

Allow the swizzle to be configurable with a texture binding. This is still experimental and needs to be tested well on all platforms.
Basic approach is the following:
  - WR device figures out how it can use BGRA and makes the texture cache format configurable at run-time. It tries to make the uploads to the shared texture cache pages to be done without any driver conversions, and without extra memory allocated.
  - it also reports the preferred input format for the images, which may be different from the texture cache format
  - if WR texture cache is asked to allocate a shared texture with a different (swizzled) format from the preferred, it associates the cache entry with a swizzle
  - the swizzle becomes a part of the `SourceTexture`, which affects batch splitting
  - when a texture reaches binding by GL device, it checks whether the current swizzle on this texture doesn't match the given one, and configures the texture sampling accordingly
  - we can't use blits with swizzling, so when that needs to happen we use `cs_copy` path, which is now mostly rewritten

The idea is that Gecko would ask WR for the preferred format and configure its image decoding to produce image data that doesn't require any swizzling.

The PR changes existing texture upload (and batching) paths. On Linux, if texture storage is available, we now use it and provide the data as RGBA, assuming no conversion by the driver. The swizzling kicks in when we sample this data in the shader. On Windows/Angle we use BGRA as an internal format for texture cache and expect Gecko to provide BGRA data, this should be unchanged.

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

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

moz-gfx commented Jul 30, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Jul 30, 2019

📌 Commit 7171ff7 has been approved by moz-gfx

@bors-servo
Copy link
Contributor

bors-servo commented Jul 30, 2019

Testing commit 7171ff7 with merge a27b830...

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

bors-servo commented Jul 30, 2019

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

@bors-servo bors-servo merged commit 7171ff7 into servo:master Jul 30, 2019
3 checks passed
3 checks passed
Taskcluster (pull_request) TaskGroup: success
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

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