Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

First Phase of Tracing Transition #395

Merged
merged 1 commit into from
Jun 23, 2020
Merged

Conversation

cwfitzgerald
Copy link
Member

Connections

This is the wgpu-rs component of gfx-rs/wgpu#740.

Notable Changes

  • Added annotations for non-trivial wrapper functions
  • Enabled building all features on docs.rs
  • Took a dep on tracing.
  • Fixes an assert that randomly stopped compiling.
  • Added env variable WGPU_CHROME_TRACING which will be a path to the output chrome trace, if the feature is enabled.
  • Added feature which corresponds directly to wgc feature.

@cwfitzgerald cwfitzgerald requested a review from kvark June 20, 2020 03:07
@cwfitzgerald cwfitzgerald marked this pull request as draft June 20, 2020 18:33
@cwfitzgerald cwfitzgerald force-pushed the tracing branch 5 times, most recently from 1ca2d04 to 1d63e36 Compare June 22, 2020 06:16
bors bot added a commit to gfx-rs/wgpu that referenced this pull request Jun 22, 2020
740: First Phase of Tracing Transition r=kvark a=cwfitzgerald

## Connections

First step in the implementation of #491. gfx-rs/wgpu-rs#395

## Description

This adds the tracing crate, implements a tracing "layer" for chrome tracing, and instruments every entrypoint into wgpu.

Tracing is added as a main dependency. A feature is added called `subscriber` which guards the tracing and default logger implementation, as that adds 3 dependencies. 

The main macro is there to make creating a span a simple one line process. This macro will come in useful in the next couple stages. Use of this macro is used unqualified with it imported into scope as that style allows IntelliJ ides to actually find the macro.

I also removed a really annoying warning that was driving me crazy.

This PR does not make sure the logging output from tracing is up to snuff, that will be done when logging output and conversion is the priority.

Both commits should compile individually, so shouldn't need to be squashed.

## Testing

This PR was tested with the wgpu-rs PR on various examples, as well as my personal project.


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
@cwfitzgerald cwfitzgerald marked this pull request as ready for review June 22, 2020 19:21
@cwfitzgerald cwfitzgerald force-pushed the tracing branch 2 times, most recently from 5270e25 to 6608914 Compare June 22, 2020 19:23
@cwfitzgerald
Copy link
Member Author

Should be ready to review!

#[cfg(feature = "subscriber")]
{
let chrome_tracing_dir = std::env::var("WGPU_CHROME_TRACING");
wgpu::util::initialize_default_subscriber(chrome_tracing_dir.ok());
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need to show it off in hello- examples. Just framework is OK and most useful anyway.

Copy link
Member Author

Choose a reason for hiding this comment

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

The reason I added this here too is because once we switch to tracing entirely, env_logger won't do anything, and I would imagine we want logging enabled. I can remove this for now and we can revisit it later if you want.

Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

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

Nice! This is really happening now!
bors r+

@bors bors bot merged commit 445a9ec into gfx-rs:master Jun 23, 2020
@cwfitzgerald
Copy link
Member Author

Wooooo!

kejor pushed a commit to kejor/wgpu-rs that referenced this pull request Nov 28, 2020
fix gfx-rs#395
Add BufferMapState enum to track the state of buffer
mapping and store any mapping details in case one is
pending.
kejor pushed a commit to kejor/wgpu-rs that referenced this pull request Nov 28, 2020
547: Add BufferMapState r=kvark a=kunalmohan

WIP for issue gfx-rs#395 

Co-authored-by: Kunal Mohan <kunalmohan99@gmail.com>
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants