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

Don't panic when compiling the debug overlay shaders fail. #2920

Merged
merged 1 commit into from Jul 23, 2018

Conversation

nical
Copy link
Contributor

@nical nical commented Jul 20, 2018

Fixes #2808.
There is always going to be a silly driver out there that will fail for whatever reason so let's not panic for something that isn't important to the user.
I did leave the unwrap in wrench sort of on purpose because in the unlikely event that someone using wrench hits the driver bug, they'll be in a much better place to fix or report the issue than our average user, and if we are lucky enough to hit this kind of bug a developer's machine we'll be able can try to fix it.

I'm tempted to remove the debug_render feature. It's not buying much since the shader is compiled lazily and it adds noise to the code (and feature flags are annoyingly easy to break).


This change is Reviewable

@@ -1306,18 +1306,33 @@ struct TargetSelector {
#[cfg(feature = "debug_renderer")]
struct LazyInitializedDebugRenderer {
debug_renderer: Option<DebugRenderer>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleaner to have Option<Result<_>> instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would that make things better?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the state expressed with an extra bool is less safe and more redundant (e.g. it doesn't prohibit Some() + true combo)

@kvark
Copy link
Member

kvark commented Jul 23, 2018

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 13249af has been approved by kvark

@bors-servo
Copy link
Contributor

⌛ Testing commit 13249af with merge d2b7cac...

bors-servo pushed a commit that referenced this pull request Jul 23, 2018
Don't panic when compiling the debug overlay shaders fail.

Fixes #2808.
There is always going to be a silly driver out there that will fail for whatever reason so let's not panic for something that isn't important to the user.
I did leave the unwrap in wrench sort of on purpose because in the unlikely event that someone using wrench hits the driver bug, they'll be in a much better place to fix or report the issue than our average user, and if we are lucky enough to hit this kind of bug a developer's machine we'll be able can try to fix it.

I'm tempted to remove the debug_render feature. It's not buying much since the shader is compiled lazily and it adds noise to the code (and feature flags are annoyingly easy to break).

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

☀️ Test successful - status-appveyor, status-taskcluster
Approved by: kvark
Pushing d2b7cac to master...

@bors-servo bors-servo merged commit 13249af into servo:master Jul 23, 2018
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.

debug_font shader has compilation failures
3 participants