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

Webgl profiling #22130

Open
wants to merge 6 commits into
base: master
from

Conversation

Projects
None yet
6 participants
@cbrewster
Copy link
Member

cbrewster commented Nov 6, 2018

This adds additional profiling for WebGL commands and some WebGL DOM APIs using the existing profiling infrastructure.

I don't really like adding a ton of new profiling category variants, but it seemed like the simplest approach given how signpost works with repr[u32] and using a bitwise shift for the event category and how characterize.py works.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #21150 (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because it adds additional profiling

This change is Reviewable

@highfive

This comment has been minimized.

Copy link

highfive commented Nov 6, 2018

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/webglrenderingcontext.rs
  • @paulrouget: components/servo/lib.rs
  • @KiChjang: components/script/dom/webglrenderingcontext.rs
@highfive

This comment has been minimized.

Copy link

highfive commented Nov 6, 2018

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify script code, but no tests are modified. Please consider adding a test!
@bors-servo

This comment has been minimized.

Copy link
Contributor

bors-servo commented Nov 7, 2018

☔️ The latest upstream changes (presumably #22126) made this pull request unmergeable. Please resolve the merge conflicts.

@cbrewster cbrewster force-pushed the cbrewster:webgl_profile branch 2 times, most recently from 0f0bd72 to 0898440 Nov 19, 2018

@cbrewster cbrewster changed the title [WIP] Webgl profiling Webgl profiling Nov 19, 2018

@jdm

This comment has been minimized.

Copy link
Member

jdm commented Nov 19, 2018

r? @nox

@bors-servo

This comment has been minimized.

Copy link
Contributor

bors-servo commented Nov 21, 2018

☔️ The latest upstream changes (presumably #22225) made this pull request unmergeable. Please resolve the merge conflicts.

@nox

This comment has been minimized.

Copy link
Member

nox commented Nov 21, 2018

Is there really no way to avoid all those new categories?

@@ -1703,3 +1711,147 @@ fn map_dot_separated<F: Fn(&str, &mut String)>(s: &str, f: F) -> String {
}
mapped
}

fn profiler_category(webgl_command: &WebGLCommand) -> ProfilerCategory {

This comment has been minimized.

@nox

nox Nov 21, 2018

Member

This could be generated with a macro wrapping this function and the definition of WebGLCommand.

@cbrewster

This comment has been minimized.

Copy link
Member

cbrewster commented Nov 21, 2018

There’s no good way to avoid adding new categories since we have to strip away any associated data from the WebGLCommand. I suppose we could use a macro to generate a new enum that is the same as WebGLCommand but without any associated data

@cbrewster cbrewster force-pushed the cbrewster:webgl_profile branch 2 times, most recently from 2336380 to 8cf7313 Dec 10, 2018

@cbrewster cbrewster force-pushed the cbrewster:webgl_profile branch from 8cf7313 to 746578c Dec 11, 2018

@cbrewster cbrewster force-pushed the cbrewster:webgl_profile branch 3 times, most recently from 2168060 to 142256b Dec 11, 2018

@cbrewster cbrewster force-pushed the cbrewster:webgl_profile branch from 142256b to 1097e7f Dec 11, 2018

@cbrewster

This comment has been minimized.

Copy link
Member

cbrewster commented Dec 11, 2018

Sorry had some git issues...
I added a macro that automatically generates the conversion code between a WebGLCommand and ProfilerCategory. I wasn't sure how to do it via a macro_rules so I made a custom derive. I've not written many macros, so it may need some improvement.

@cbrewster cbrewster assigned nox and unassigned ferjm Dec 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment