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

gpu profiler #3998

Closed
wants to merge 2 commits into from
Closed

gpu profiler #3998

wants to merge 2 commits into from

Conversation

molikto
Copy link
Contributor

@molikto molikto commented Feb 20, 2022

Objective

Enable GPU profile each render passes.

Solution

integrate https://github.com/Wumpf/wgpu-profiler, user can enable the render pass profiling individually, and the result will be written to a diagnostics (not sure if this is the best thing to do)

I tried to integrate this as a external plugin without success, also the code is really bad, so just a WIP/pitch

# Conflicts:
#	crates/bevy_render/src/lib.rs
#	crates/bevy_render/src/renderer/mod.rs
#	crates/bevy_render/src/settings.rs
@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Feb 20, 2022
@Weasy666
Copy link
Contributor

@superdump already worked, or is working, on some kind of integration, here https://github.com/superdump/bevy/tree/wgpu-timestamp-queries . I guess you two should link up 🙂

@james7132 james7132 added A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible and removed S-Needs-Triage This issue needs to be labelled labels Feb 21, 2022
@@ -59,12 +59,15 @@ impl Default for WgpuSettings {
limits
};

let features = wgpu::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES;
#[cfg(feature = "gpu_profiler")]
let features = features | wgpu::Features::TIMESTAMP_QUERY;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this will fail on platforms that don't support timestamp queries. I don't know if I think that should be the preferred behaviour rather than silently not working.

@superdump
Copy link
Contributor

Mmm, maybe we can try to merge the two somehow. I think using diagnostics makes sense for making the measurements available for printing or so. And I think using the wgpu_profiler macro is probably the way to go for wrapping measurements. What do you think?

@molikto
Copy link
Contributor Author

molikto commented Mar 2, 2022

Mmm, maybe we can try to merge the two somehow. I think using diagnostics makes sense for making the measurements available for printing or so. And I think using the wgpu_profiler macro is probably the way to go for wrapping measurements. What do you think?

I think this PR is definitely not well designed, partly because I am not familiar with graphics APIs, so go ahead the way you want!

On the other hand, the profiler is only enabled in debug/dev builds, so I don't know how well designed it should be

@bjorn3
Copy link
Contributor

bjorn3 commented Mar 2, 2022

On the other hand, the profiler is only enabled in debug/dev builds, so I don't know how well designed it should be

Veloren enables it in release builds too. It has an option in the graphics settings.

@JustAnotherCodemonkey
Copy link

What's the progress on this PR? Seems dead but is it worth reviving?

@Inspirateur
Copy link

would that allow us to know how much drawcall we're doing per frame ? that would be really good info 🙏

@NthTensor
Copy link
Contributor

Looks like this was covered by #9135. Will close this at the end of the week unless someone objects.

@NthTensor
Copy link
Contributor

NthTensor commented Apr 4, 2024

No objections, closing as implemented.

@NthTensor NthTensor closed this Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants