bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Consider what to do with wgpu_trace feature

Open IceSentry opened this issue 1 year ago • 6 comments

Description

Wgpu 22 removed the wgpu/trace feature, but the PR to update to wgpu 22 for bevy kept the wgpu_trace feature. We should either remove it or add a compile warning that the feature currently doesn't do anything.

https://github.com/bevyengine/bevy/pull/14401#discussion_r1685046521

wgpu issue https://github.com/gfx-rs/wgpu/issues/5974

Since this is only temporary, we could consider keeping it in with just a warning. Personally I think we should just remove it.

IceSentry avatar Aug 12 '24 17:08 IceSentry

As per my comment over at https://github.com/bevyengine/bevy/pull/14401#discussion_r1712901764, I personally think it should be removed.

This is because, as far as I'm aware, bevy/wgpu_trace is solely a proxy to wgpu/trace, and doesn't enable any functionality in bevy itself. Having a feature that's solely a proxy seems weird to me - if a user needs wgpu/trace, they can pull in wgpu and enable the trace feature in their own crate.

This does mean that the user will have to update dependencies.wgpu.version every time bevy updates, in order to ensure it actually works... but bevy updates don't come every day, so that effort only needs to happen every once in a while.

LikeLakers2 avatar Aug 12 '24 18:08 LikeLakers2

@LikeLakers2 if you pull in a dependency of a dependency, you can use version = * to make it automatically match what you are pulling in anyways.

janhohenheim avatar Aug 13 '24 17:08 janhohenheim

This is because, as far as I'm aware, bevy/wgpu_trace is solely a proxy to wgpu/trace, and doesn't enable any functionality in bevy itself.

It technically does I think? ~~Looking at it, it doesn't even seem to enable the wgpu/trace feature from what I can see on a cursory glance~~ (I missed that it was removed when we updated to wgpu 22), gets used in https://github.com/bevyengine/bevy/blob/main/crates/bevy_render/src/renderer/mod.rs#L198-L206 to pass a tracing path for wgpu to use.

TrialDragon avatar Aug 19 '24 19:08 TrialDragon

@TrialDragon Ahh, good catch.

If I might propose a solution then... perhaps allow that tracing path to be set as a field on bevy::render::settings::WgpuSettings? That way, the user can customize it and bevy no longer needs to worry about whether the feature is enabled - it just passes the value in as-is, and wgpu will handle it if wgpu/trace is enabled.

LikeLakers2 avatar Aug 20 '24 07:08 LikeLakers2

That sounds good to me. Presuming there are no objections, this seems ready for implementation, then.

TrialDragon avatar Aug 20 '24 19:08 TrialDragon

@TrialDragon I have little experience with bevy's codebase - but I will try making this change.

LikeLakers2 avatar Aug 21 '24 01:08 LikeLakers2