Skip to content

textureSize() workaround for Angle/NV - #2491

Merged
bors-servo merged 1 commit into
servo:masterfrom
kvark:flicker-workaround
Mar 6, 2018
Merged

bors-servo merged 1 commit into
servo:masterfrom
kvark:flicker-workaround

Conversation

@kvark

@kvark kvark commented Mar 6, 2018 •

Copy link
Copy Markdown
Member

Temporary workaround for flickering issues of https://bugzilla.mozilla.org/show_bug.cgi?id=1431560

It is not covering all the cases, but on the other hand is rather harmless. Should ease the pain of Windows/Nvidia users while the proper cure (my Angle fix) is in flight. Check out this comment for nasty technical details.

WR driver bug entry: https://github.com/servo/webrender/wiki/Driver-issues#texturesize-in-vertex-shaders

r? @glennw


This change is Reviewable

@glennw

glennw commented Mar 6, 2018

Copy link
Copy Markdown
Member

Wow, nice detective work.

Should we add an issue to remove this once the ANGLE fixes land in Gecko?

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 86d833b has been approved by glennw

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 86d833b with merge 4df61ef...

bors-servo pushed a commit that referenced this pull request Mar 6, 2018
@kvark

kvark commented Mar 6, 2018

Copy link
Copy Markdown
Member Author

Here is the gist of the situation:

  • Angle has a specific workaround for Nvidia that uses the baseLevel of a sampler for backing textureSize calls instead of the parameter we give in the shader (just 0).
  • Angle stores the baseLevel in the special driver constants buffer. It's updated with MAP_WRITE_DISCARD mapping, then filling in exactly the data needed by the current program, and unmapping it. Consequently, everything above the number of samplers used by the program is turned into trash by the driver.
  • The buffer is invalidated based on a number of triggers, but unfortunately the shader program change is not one of them. Thus, once we switch to a bigger shader program, we sometimes get trash results in textureSize calls (and possibly other things), visible as flickering.

@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - status-appveyor, status-taskcluster, status-travis
Approved by: glennw
Pushing 4df61ef to master...

@bors-servo
bors-servo merged commit 86d833b into servo:master Mar 6, 2018
@kvark
kvark deleted the flicker-workaround branch March 6, 2018 12:41
bors-servo pushed a commit that referenced this pull request Mar 8, 2018
Revert "textureSize() workaround for Angle/NV"

This reverts #2491 for apparently causing https://bugzilla.mozilla.org/show_bug.cgi?id=1444076
Must be some real confusion by the driver, since the code changes are semantically harmless.
I'll come up with a better fix.
r? @staktrace

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2499)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants