@@ -20,13 +20,14 @@ use bevy_ui::{
2020 widget:: { Text , TextUiWriter } ,
2121 FlexDirection , GlobalZIndex , Node , PositionType , Val ,
2222} ;
23+ #[ cfg( not( all( target_arch = "wasm32" , not( feature = "webgpu" ) ) ) ) ]
2324use bevy_ui_render:: prelude:: MaterialNode ;
2425use core:: time:: Duration ;
2526use tracing:: warn;
2627
27- use crate :: frame_time_graph :: {
28- FrameTimeGraphConfigUniform , FrameTimeGraphPlugin , FrametimeGraphMaterial ,
29- } ;
28+ # [ cfg ( not ( all ( target_arch = "wasm32" , not ( feature = "webgpu" ) ) ) ) ]
29+ use crate :: frame_time_graph :: FrameTimeGraphConfigUniform ;
30+ use crate :: frame_time_graph :: { FrameTimeGraphPlugin , FrametimeGraphMaterial } ;
3031
3132/// [`GlobalZIndex`] used to render the fps overlay.
3233///
@@ -163,8 +164,14 @@ struct FrameTimeGraph;
163164fn setup (
164165 mut commands : Commands ,
165166 overlay_config : Res < FpsOverlayConfig > ,
166- mut frame_time_graph_materials : ResMut < Assets < FrametimeGraphMaterial > > ,
167- mut buffers : ResMut < Assets < ShaderStorageBuffer > > ,
167+ #[ cfg_attr(
168+ all( target_arch = "wasm32" , not( feature = "webgpu" ) ) ,
169+ expect( unused, reason = "Unused variables in wasm32 without webgpu feature" )
170+ ) ]
171+ ( mut frame_time_graph_materials, mut buffers) : (
172+ ResMut < Assets < FrametimeGraphMaterial > > ,
173+ ResMut < Assets < ShaderStorageBuffer > > ,
174+ ) ,
168175) {
169176 commands
170177 . spawn ( (
0 commit comments