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

Nicer shader management #2505

Merged
merged 4 commits into from Mar 13, 2018
Merged

Nicer shader management #2505

merged 4 commits into from Mar 13, 2018

Conversation

@kvark
Copy link
Member

kvark commented Mar 10, 2018

@glennw
This is a big (but shallow) refactor of the way we manage shaders:

  • move all the shader related logic into a separate module. Our renderer is still too big
  • separate getting a lazy shader pointer from its binding
  • introduce special handling of the mode uniform
  • modernize the shape a bit, including the use of ? macro

The last bit, implemented in 0d6b922, is not essential to the PR but I believe it compliments it somewhat nicely. This commit can be seen as controversial because it makes program binding a little less functional. I'd argue that the device is already stateful (e.g. one is expected to bind a program first, then draw, not the other way around), but can remove the commit if there are objections.

The PR reduces the amount of code, separates the concerns better, and makes things nicer to work with overall. The desire to clean it up came to me after messing with the flickering workarounds...

I'm deliberately dropping this PR bomb during the weekend for a chance to avoid mergocalypse later on :)


This change is Reviewable

@kvark
Copy link
Member Author

kvark commented Mar 10, 2018

Try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=02b1c1e9084a9208f925f4c288b69a6576dd4ed4

Also, isolation of the shaders could help with #2436 in the future.

@glennw
Copy link
Member

glennw commented Mar 12, 2018

A lot of orange on the try run. I think the R reftest results are expected, not sure about those Windows failures though?

@kvark
Copy link
Member Author

kvark commented Mar 12, 2018

All windows failures look like WebGL timeouts, which is hardly related. @staktrace any clues?

@staktrace
Copy link
Contributor

staktrace commented Mar 12, 2018

@kvark I don't know which base revision your try push was made from, but the webgl stuff is green on central. So either you're using an older base rev where stuff was broken, or your patch breaks those tests. I'd try rebasing to latest central to make sure it's not the former; the failures persist then it must be something in your patch.

@kvark
Copy link
Member Author

kvark commented Mar 13, 2018

@staktrace: a try push after rebasing on latest central - https://treeherder.mozilla.org/#/jobs?repo=try&revision=47b5eac4436ebd319bdc0c5f4b7b5dfeb8cc3f90
I find it weird that it hasn't finished still (15 pending jobs?).

@glennw
Copy link
Member

glennw commented Mar 13, 2018

Latest try looks good, thanks!

@bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented Mar 13, 2018

📌 Commit 0d6b922 has been approved by glennw

@bors-servo
Copy link
Contributor

bors-servo commented Mar 13, 2018

Testing commit 0d6b922 with merge ba8a1e5...

bors-servo added a commit that referenced this pull request Mar 13, 2018
Nicer shader management

@glennw
This is a big (but shallow) refactor of the way we manage shaders:
  - move all the shader related logic into a separate module. Our `renderer` is still too big
  - separate getting a lazy shader pointer from its binding
  - introduce special handling of the `mode` uniform
  - modernize the shape a bit, including the use of `?` macro

The last bit, implemented in 0d6b922, is not essential to the PR but I believe it compliments it somewhat nicely. This commit can be seen as controversial because it makes program binding a little less functional. I'd argue that the device is already stateful (e.g. one is expected to bind a program first, then draw, not the other way around), but can remove the commit if there are objections.

The PR reduces the amount of code, separates the concerns better, and makes things nicer to work with overall. The desire to clean it up came to me after messing with the flickering workarounds...

I'm deliberately dropping this PR bomb during the weekend for a chance to avoid mergocalypse later on :)

<!-- 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/2505)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Mar 13, 2018

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

@bors-servo bors-servo merged commit 0d6b922 into servo:master Mar 13, 2018
3 checks passed
3 checks passed
Taskcluster (pull_request) TaskGroup: success
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
@kvark kvark deleted the kvark:nice-shaders branch Mar 13, 2018
@staktrace
Copy link
Contributor

staktrace commented Mar 13, 2018

I find it weird that it hasn't finished still (15 pending jobs?).

@kvark Seems to be done now. Looking at the timestamps I guess the pending jobs were the talos jobs which run on different hardware. Sometimes there's a backlog.

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.