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 up[RFC] Introduce a web based debugger and some basic examples. #1607
Conversation
|
BTW, it's listed as [RFC], but it's actually ready to go from my perspective, if everyone is happy with it as-is. |
|
I would like this to be in the repo. Hopefully, having it behind a feature flag like you did should be enough for vendoring. |
| DebugMsg::FetchBatches(sender) => { | ||
| let mut batch_list = BatchList::new(); | ||
|
|
||
| if let Some(ref frame) = self.current_frame { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| if let Some(ref frame) = frame.frame { | ||
| for pass in &frame.passes { | ||
| for target in &pass.alpha_targets.targets { | ||
| batch_list.push("[Clip] Clear", target.clip_batcher.border_clears.len()); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
glennw
Aug 24, 2017
Author
Member
Definitely - the batch list is very much a proof of concept - I'll expand on the information with a more detailed view as a follow up.
| #[derive(Serialize)] | ||
| pub struct BatchList { | ||
| kind: &'static str, | ||
| batches: Vec<BatchInfo>, |
This comment has been minimized.
This comment has been minimized.
kvark
Aug 24, 2017
Member
we might consider having a bit stronger types here, e.g.
#[derive(Serialize)]
pub struct ClipBatcherInfo {
clears: usize,
borders: usize,
rectangles: usize,
}
#[derive(Serialize)]
pub struct CacheBatcherInfo {
...
}
pub struct BatchList {
kind: &'static str,
clip: ClipBatcherInfo,
cache: CacheBatcherInfo,
alpha: HashMap<&'static str, usize>,
}
This comment has been minimized.
This comment has been minimized.
|
Thanks @glennw , amazing stuff!
Since we are already settled with multi-project single-repo approach, I think it would be great to have the debugger in the repo as well, for easier maintenance at the very least.
Currently, it's doesn't appear that |
| notifier.unwrap() | ||
| .as_mut() | ||
| .unwrap() | ||
| .new_frame_ready(); |
This comment has been minimized.
This comment has been minimized.
kvark
Aug 24, 2017
Member
looks like new_frame_ready gets abused more. Maybe we should just add a ping method to be used both here and for MemoryPressure?
This comment has been minimized.
This comment has been minimized.
|
|
||
| fn handle_debug_command(&mut self, command: DebugCommand) { | ||
| match command { | ||
| DebugCommand::EnableProfiler(enable) => { |
This comment has been minimized.
This comment has been minimized.
kvark
Aug 24, 2017
Member
since we are at it, maybe we can remove the duplicated logic from wrench and examples boilerplate
This comment has been minimized.
This comment has been minimized.
glennw
Aug 24, 2017
Author
Member
Do you mean remove the keyboard shortcuts? I think it makes sense to keep those for quick debugging - or did you mean something else?
|
|
||
| #[cfg(not(feature = "debugger"))] | ||
| fn update_debug_server(&self) { | ||
| } |
This comment has been minimized.
This comment has been minimized.
kvark
Aug 24, 2017
Member
perhaps, would be cleaner to do let _ = &self.debug_server than having underscore in _debug_server
This comment has been minimized.
This comment has been minimized.
e4421a7
to
4fe0d28
|
@kvark Thanks for the review! Fixed up some of those nits. I think it's OK to do the rest as follow ups - does that sound OK? Also added the debugger feature to wrench, which I had missed previously. |
yeah, I don't see much point in keeping the shortcuts if you can do the same thing by just enabling
Absolutely! One last concern before r=me is CI-testing the debugger feature. I don't see you modifying the travis/appveyor scripts. |
|
|
|
@kvark Ah, good point - I've rebased and updated the travis file to build wrench in release + debugger mode. |
|
Wonderful, it's shipping time! |
|
|
[RFC] Introduce a web based debugger and some basic examples. This introduces a simple web based debugger for WR, as an optional feature. The initial implementation allows toggling the debug flags (e.g. profiler, texture cache debug view) and dumping a list of draw call batches to the browser. In the future, I'd plan to expand the feature set significantly - for example, a render tree visualization, and more detailed timing. We can also use this as a debugging tool - for example, adding support for stepping through a single frame etc. The main things to answer are: * Should the client live in this repo or elsewhere? * Is the current setup of the feature going to work OK with vendoring? * Is the current implementation / threading strategy reasonable? The implementation uses Vue.js, websockets and Bulma. <!-- 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/1607) <!-- Reviewable:end -->
|
|
|
CI has legitimate errors:
|
|
Ah, it needed a rebase after the batching PR landed - done. |
|
thanks! |
|
|
[RFC] Introduce a web based debugger and some basic examples. This introduces a simple web based debugger for WR, as an optional feature. The initial implementation allows toggling the debug flags (e.g. profiler, texture cache debug view) and dumping a list of draw call batches to the browser. In the future, I'd plan to expand the feature set significantly - for example, a render tree visualization, and more detailed timing. We can also use this as a debugging tool - for example, adding support for stepping through a single frame etc. The main things to answer are: * Should the client live in this repo or elsewhere? * Is the current setup of the feature going to work OK with vendoring? * Is the current implementation / threading strategy reasonable? The implementation uses Vue.js, websockets and Bulma. <!-- 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/1607) <!-- Reviewable:end -->
|
|

glennw commentedAug 24, 2017
•
edited
This introduces a simple web based debugger for WR, as an optional feature.
The initial implementation allows toggling the debug flags (e.g. profiler, texture cache debug view) and dumping a list of draw call batches to the browser.
In the future, I'd plan to expand the feature set significantly - for example, a render tree visualization, and more detailed timing. We can also use this as a debugging tool - for example, adding support for stepping through a single frame etc.
The main things to answer are:
The implementation uses Vue.js, websockets and Bulma.
This change is