Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upuse switch statement for text snapping decision #3540
Conversation
|
Looks like this should be documented in the driver issues wiki page. |
|
It sounds very similar to https://github.com/servo/webrender/wiki/Driver-issues#2864---mac-glsl-compiler-bug-with-integer-comparisons, though not quite the same? |
|
Thanks for the patch! https://bugzilla.mozilla.org/show_bug.cgi?id=1525032 will merge this to m-c and then it will get synced back to webrender. |
Looks very similar indeed, I added https://github.com/servo/webrender/wiki/Driver-issues#2864---mac-glsl-compiler-bug-with-integer-comparisons right next to it, not sure whether they are the same but it's good to keep a history of each workaround. |
|
What's bothering me here is that |
|
local_transform is only ever used with WR_FEATURE_GLYPH_TRANSFORM, which is only ever used with RasterSpace::Screen |
|
@lsalzman so you are saying that |
|
FWIW, initializing |
|
That's fairly surprising that even though local_transform is never used at
all that it caused that issue. In any case, keep the switch() I would
suggest, but also add in the initialization of mat2 local_transform =
mat2(1.0) just to make the compiler supremely happy, I suppose.
…On Tue, Feb 5, 2019 at 4:58 PM Sam Rijs ***@***.***> wrote:
FWIW, initializing local_transform to the identity matrix on line 74 also
fixes the issue on my machine. Happy to push that change instead if you
want to go that way.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3540 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABY60deb8B3J8yz0dxtwXzXNusYXGiDWks5vKf6TgaJpZM4agqA9>
.
|
[wrupdater] From servo/webrender#3540 Differential Revision: https://phabricator.services.mozilla.com/D18565 --HG-- extra : moz-landing-system : lando
|
@lsalzman are you 100% sure that I'm not a fan of |
|
Since this is technically an enum value, the switch is a more natural expression of the intent of the code anyway, so there is no harm in just leaving the switch. |
|
I've pushed the additional commit onto the branch. @kvark using a bogus initializer for |
|
WR_FEATURE_GLYPH_TRANSFORM will only get triggered if there is a font transform, which can only happen in RasterSpace::Screen. If RasterSpace::Local is used, then the font transform is identity, and WR_FEATURE_GLYPH_TRANSFORM will never be used. So the only possible way for the shader enum to not actually be RASTER_SCREEN is if there was either a driver bug with the uniform value, or a bug in our uniform code. However, given that this problem only manifests on one very limited configuration on macOS and only on specific hardware, and nowhere else, I think this is just a driver bug. |
[wrupdater] From servo#3540 Differential Revision: https://phabricator.services.mozilla.com/D18565 [wrupdater] From https://hg.mozilla.org/mozilla-central/rev/af2acbe820daaa9ac1b34350bed84d90b1242cf9
[wrupdater] From servo/webrender#3540 Differential Revision: https://phabricator.services.mozilla.com/D18565
|
Sorry about closing the PR while discussion is still ongoing but the syncing process assumes that once the PR is approved it won't be modified. If the additional commit needs landing please open a new PR with that patch. Thanks! |
[wrupdater] From servo#3540 Differential Revision: https://phabricator.services.mozilla.com/D18565 [wrupdater] From https://hg.mozilla.org/mozilla-central/rev/af2acbe820daaa9ac1b34350bed84d90b1242cf9
[wrupdater] From servo#3540 Differential Revision: https://phabricator.services.mozilla.com/D18565 [wrupdater] From https://hg.mozilla.org/mozilla-central/rev/af2acbe820daaa9ac1b34350bed84d90b1242cf9
[wrupdater] From servo/webrender#3540 Differential Revision: https://phabricator.services.mozilla.com/D18565 UltraBlame original commit: af2acbe820daaa9ac1b34350bed84d90b1242cf9
[wrupdater] From servo/webrender#3540 Differential Revision: https://phabricator.services.mozilla.com/D18565 UltraBlame original commit: af2acbe820daaa9ac1b34350bed84d90b1242cf9
[wrupdater] From servo/webrender#3540 Differential Revision: https://phabricator.services.mozilla.com/D18565 UltraBlame original commit: af2acbe820daaa9ac1b34350bed84d90b1242cf9
srijs commentedFeb 4, 2019
•
edited
Fixes #3538.
@lsalzman this implements your suggestion of switching from an
ifto aswitchstatement, and it really fixes the issue for some puzzling reason! I'd love to put a better description of the issue into the commit message, but this behaviour thoroughly confuses me. Can you offer more insight into why this particular change alleviates the problem?This change is