bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Cannot access `WgpuAdapterInfo` anymore?

Open djeedai opened this issue 3 years ago • 3 comments

Bevy version

0.9

What you did

Upgrading from v0.8.

The documentation of WgpuSettings still claims to use "the WgpuAdapterInfo resource", but WgpuAdapterInfo is not a resource since it's an alias for a WGPU type and it probably lost the default Resource implementation.

What went wrong

Doesn't build.

// the trait bound `WgpuAdapterInfo: bevy::prelude::Resource` is not satisfied
let adapter_name = app
    .world
    .get_resource::<WgpuAdapterInfo>()
    .map(|ai| &ai.name[..])
    .unwrap();

djeedai avatar Nov 13 '22 21:11 djeedai

Note: WgpuAdapterInfo doesn't appear in the migration guide https://bevyengine.org/learn/book/migration-guides/0.8-0.9/

djeedai avatar Nov 13 '22 21:11 djeedai

The AdapterInfo is now wrapped in the RenderAdapterInfo Resource.

tim-blackbird avatar Nov 13 '22 21:11 tim-blackbird

Confirmed working with RenderAdapterInfo. Do we / can we upgrade the migration guide for it maybe?

djeedai avatar Nov 13 '22 22:11 djeedai