Skip to content

Commit

Permalink
Fix CI: shader_material_glsl missing AssetUsages impl
Browse files Browse the repository at this point in the history
  • Loading branch information
superdump committed Apr 2, 2024
1 parent dab44e9 commit 8f133a8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions examples/shader/shader_material_glsl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ use bevy::{
prelude::*,
reflect::TypePath,
render::{
mesh::MeshVertexBufferLayoutRef,
render_resource::{
mesh::MeshVertexBufferLayoutRef, render_asset::{AssetUsages, RenderAssetUsages}, render_resource::{
AsBindGroup, RenderPipelineDescriptor, ShaderRef, SpecializedMeshPipelineError,
},
}
},
};

Expand Down Expand Up @@ -56,6 +55,12 @@ struct CustomMaterial {
alpha_mode: AlphaMode,
}

impl AssetUsages for CustomMaterial {
fn asset_usage(&self) -> RenderAssetUsages {
RenderAssetUsages::MAIN_WORLD | RenderAssetUsages::RENDER_WORLD
}
}

/// The Material trait is very configurable, but comes with sensible defaults for all methods.
/// You only need to implement functions for features that need non-default behavior. See the Material api docs for details!
/// When using the GLSL shading language for your shader, the specialize method must be overridden.
Expand Down

0 comments on commit 8f133a8

Please # to comment.