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 upAdd a debugging feature to visualize overdraw. #2963
Conversation
|
Looks like there are some shader validation failures on CI: https://ci.appveyor.com/project/servo/webrender/build/1.0.10141#L304 It might just be related to needing to pass the right defines to the validation code, if they've changed. |
webrender/res/brush_debug_overdraw.glsl, line 1 at r1 (raw file):
Instead of having a separate shader, we could perhaps have just had an #ifdef in the fragment shader skeleton for brush.glsl? Doesn't really matter either way though. |
|
We'll need to resolve the shader validation errors on CI above. If we instead added an We should do a try run too, to make sure that nothing breaks with any of the weird shader combinations. I can do that on Monday if you're not sure how to do a gecko try. |
|
(if you think it's simpler to leave as is, that's fine too - the above is just what came to mind when looking through the code). |
|
Left comments in reviewable. |
|
This is a really helpful feature to have, btw! |
|
A screnshot would be handy here |
| // Sets the blend mode. Blend is unconditionally set if the "show overdraw" debugging mode is | ||
| // enabled. | ||
| fn set_blend(&self, mut blend: bool) { | ||
| if !self.debug_flags.contains(DebugFlags::SHOW_OVERDRAW) { |
This comment has been minimized.
This comment has been minimized.
kvark
Aug 10, 2018
Member
shouldn't this be the other way around? if self.debug_flags.contains(DebugFlags::SHOW_OVERDRAW) { blend = true; }
This comment has been minimized.
This comment has been minimized.
| @@ -4013,6 +4020,47 @@ impl Renderer { | |||
| } | |||
| self.device.end_frame(); | |||
| } | |||
|
|
|||
| // Sets the blend mode. Blend is unconditionally set if the "show overdraw" debugging mode is | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
kvark
Aug 10, 2018
Member
We render a frame in multiple passes. All but the last one go into off-screen targets. Since we are only displaying the screen overdraw, we don't want the blending overrides to affect rendering in any other passes than the last one.
This comment has been minimized.
This comment has been minimized.
| brush_radial_gradient: BrushShader, | ||
| brush_linear_gradient: BrushShader, | ||
| brush: BrushShaders, | ||
| brush_debug_overdraw: BrushShaders, |
This comment has been minimized.
This comment has been minimized.
kvark
Aug 10, 2018
Member
a brush shader struct contains 3 versions:
struct BrushShader {
opaque: LazilyCompiledShader,
alpha: LazilyCompiledShader,
dual_source: Option<LazilyCompiledShader>,
}Would it make sense to add a 4th for the debug overdraw instead of duplicating the whole thing?
| @@ -0,0 +1,29 @@ | |||
| /* This Source Code Form is subject to the terms of the Mozilla Public | |||
This comment has been minimized.
This comment has been minimized.
|
Comments addressed. |
|
Comment addressed. |
|
Thank you! I got one last nit, otherwise shipit. |
| @@ -2304,7 +2308,7 @@ impl Renderer { | |||
|
|
|||
| self.device.disable_scissor(); | |||
| self.device.disable_depth(); | |||
| self.device.set_blend(false); | |||
| self.set_blend(false, true); | |||
This comment has been minimized.
This comment has been minimized.
kvark
Aug 11, 2018
Member
uh, that's a bit confusing when reading the code.
can have an enum TargetKind or something like this?
|
Comment addressed. r? @kvark |
|
Wonderful, thank you! |
|
|
Add a debugging feature to visualize overdraw. Lighter shades of orange indicate more overdraw. This has already helped to diagnose a few issues (e.g. #2958). r? @gw3583 <!-- 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/2963) <!-- Reviewable:end -->
|
|


pcwalton commentedAug 10, 2018
•
edited by larsbergstrom
Lighter shades of orange indicate more overdraw.
This has already helped to diagnose a few issues (e.g. #2958).
r? @gw3583
This change is