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

Commits on Jul 30, 2019

  1. Bug 1548339 - WR swizzle configuration of texture units r=gw

    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
    kvark authored and moz-gfx committed Jul 30, 2019
You can’t perform that action at this time.