diff --git a/examples/shader/compute_shader_game_of_life.rs b/examples/shader/compute_shader_game_of_life.rs index ebd00c3894d222..2913be3ef30617 100644 --- a/examples/shader/compute_shader_game_of_life.rs +++ b/examples/shader/compute_shader_game_of_life.rs @@ -4,6 +4,7 @@ //! is rendered to the screen. use bevy::{ + app::AppExit, prelude::*, render::{ extract_resource::{ExtractResource, ExtractResourcePlugin}, @@ -11,7 +12,7 @@ use bevy::{ render_asset::RenderAssets, render_graph::{self, RenderGraph, RenderLabel}, render_resource::*, - renderer::{RenderContext, RenderDevice}, + renderer::{RenderAdapter, RenderContext, RenderDevice}, Render, RenderApp, RenderSet, }, window::WindowPlugin, @@ -92,6 +93,17 @@ impl Plugin for GameOfLifeComputePlugin { fn finish(&self, app: &mut App) { let render_app = app.sub_app_mut(RenderApp); render_app.init_resource::(); + + if !render_app + .world + .resource::() + .get_texture_format_features(TextureFormat::Rgba8Unorm) + .allowed_usages + .contains(TextureUsages::STORAGE_BINDING) + { + error!("Rgba8Unorm texture format does not support STORAGE_BINDING usage, exiting."); + app.world.send_event(AppExit); + } } }