From 3faad8c7ee009b743c118c56d81b74bb7891dca5 Mon Sep 17 00:00:00 2001 From: tigregalis Date: Tue, 7 Jan 2025 13:43:52 +0800 Subject: [PATCH 01/14] Add `Image::new_target_texture` convenience constructor --- crates/bevy_image/src/image.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/crates/bevy_image/src/image.rs b/crates/bevy_image/src/image.rs index 195debc1d4..72187d59dc 100644 --- a/crates/bevy_image/src/image.rs +++ b/crates/bevy_image/src/image.rs @@ -843,6 +843,26 @@ impl Image { Image::new(size, dimension, data, format, asset_usage) } + /// Create a new zero-filled image with a given size, which can be rendered to. + /// This is primarily for use as a render target for a [`Camera`](`bevy_render::camera::Camera`). + /// See [`RenderTarget::Image`](`bevy_render::camera::RenderTarget::Image`). + pub fn new_target_texture(width: u32, height: u32) -> Self { + let mut image = Self::default(); + + image.resize(Extent3d { + width, + height, + ..Default::default() + }); + + // You need to set these texture usage flags in order to use the image as a render target + image.texture_descriptor.usage = TextureUsages::TEXTURE_BINDING + | TextureUsages::COPY_DST + | TextureUsages::RENDER_ATTACHMENT; + + image + } + /// Returns the width of a 2D image. #[inline] pub fn width(&self) -> u32 { From 1fe04a5a383a873a7b47a0fb2b486b4debe3e7d8 Mon Sep 17 00:00:00 2001 From: tigregalis Date: Tue, 7 Jan 2025 13:45:23 +0800 Subject: [PATCH 02/14] Update `render_to_texture` example to use constructor --- examples/3d/render_to_texture.rs | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/examples/3d/render_to_texture.rs b/examples/3d/render_to_texture.rs index cf428be9c3..3cc1a96078 100644 --- a/examples/3d/render_to_texture.rs +++ b/examples/3d/render_to_texture.rs @@ -2,14 +2,7 @@ use std::f32::consts::PI; -use bevy::{ - prelude::*, - render::{ - render_asset::RenderAssetUsages, - render_resource::{Extent3d, TextureDimension, TextureFormat, TextureUsages}, - view::RenderLayers, - }, -}; +use bevy::{prelude::*, render::view::RenderLayers}; fn main() { App::new() @@ -33,23 +26,8 @@ fn setup( mut materials: ResMut>, mut images: ResMut>, ) { - let size = Extent3d { - width: 512, - height: 512, - ..default() - }; - // This is the texture that will be rendered to. - let mut image = Image::new_fill( - size, - TextureDimension::D2, - &[0, 0, 0, 0], - TextureFormat::Bgra8UnormSrgb, - RenderAssetUsages::default(), - ); - // You need to set these texture usage flags in order to use the image as a render target - image.texture_descriptor.usage = - TextureUsages::TEXTURE_BINDING | TextureUsages::COPY_DST | TextureUsages::RENDER_ATTACHMENT; + let image = Image::new_target_texture(512, 512); let image_handle = images.add(image); From 679b7c712e2d96578d8961bbafe9a555bea7a029 Mon Sep 17 00:00:00 2001 From: tigregalis <38416468+tigregalis@users.noreply.github.com> Date: Tue, 7 Jan 2025 15:43:08 +0800 Subject: [PATCH 03/14] reference docs.rs in doc comment Co-authored-by: Antony --- crates/bevy_image/src/image.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/bevy_image/src/image.rs b/crates/bevy_image/src/image.rs index 72187d59dc..68e547955e 100644 --- a/crates/bevy_image/src/image.rs +++ b/crates/bevy_image/src/image.rs @@ -843,9 +843,11 @@ impl Image { Image::new(size, dimension, data, format, asset_usage) } - /// Create a new zero-filled image with a given size, which can be rendered to. - /// This is primarily for use as a render target for a [`Camera`](`bevy_render::camera::Camera`). - /// See [`RenderTarget::Image`](`bevy_render::camera::RenderTarget::Image`). + /// Create a new zero-filled image with a given size, which can be rendered to. This is primarily + /// for use as a render target for a [`Camera`]. See [`RenderTarget::Image`]. + /// + /// [`Camera`]: https://docs.rs/bevy/latest/bevy/render/camera/struct.Camera.html + /// [`RenderTarget::Image`]: https://docs.rs/bevy/latest/bevy/render/camera/enum.RenderTarget.html#variant.Image pub fn new_target_texture(width: u32, height: u32) -> Self { let mut image = Self::default(); From 81d3a928bf2dfec8288a4634907cf9e3029022ad Mon Sep 17 00:00:00 2001 From: tigregalis Date: Tue, 7 Jan 2025 15:53:55 +0800 Subject: [PATCH 04/14] inline default and resize --- crates/bevy_image/src/image.rs | 39 +++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/crates/bevy_image/src/image.rs b/crates/bevy_image/src/image.rs index 68e547955e..e39522a822 100644 --- a/crates/bevy_image/src/image.rs +++ b/crates/bevy_image/src/image.rs @@ -843,26 +843,41 @@ impl Image { Image::new(size, dimension, data, format, asset_usage) } - /// Create a new zero-filled image with a given size, which can be rendered to. This is primarily - /// for use as a render target for a [`Camera`]. See [`RenderTarget::Image`]. - /// - /// [`Camera`]: https://docs.rs/bevy/latest/bevy/render/camera/struct.Camera.html - /// [`RenderTarget::Image`]: https://docs.rs/bevy/latest/bevy/render/camera/enum.RenderTarget.html#variant.Image + /// Create a new zero-filled image with a given size, which can be rendered to. This is primarily + /// for use as a render target for a [`Camera`]. See [`RenderTarget::Image`]. + /// + /// [`Camera`]: https://docs.rs/bevy/latest/bevy/render/camera/struct.Camera.html + /// [`RenderTarget::Image`]: https://docs.rs/bevy/latest/bevy/render/camera/enum.RenderTarget.html#variant.Image pub fn new_target_texture(width: u32, height: u32) -> Self { - let mut image = Self::default(); - - image.resize(Extent3d { + let format = TextureFormat::bevy_default(); + let size = Extent3d { width, height, ..Default::default() - }); - + }; // You need to set these texture usage flags in order to use the image as a render target - image.texture_descriptor.usage = TextureUsages::TEXTURE_BINDING + let usage = TextureUsages::TEXTURE_BINDING | TextureUsages::COPY_DST | TextureUsages::RENDER_ATTACHMENT; + // Fill with zeroes + let data = vec![0; format.pixel_size() * size.volume()]; - image + Image { + data, + texture_descriptor: TextureDescriptor { + size, + format, + dimension: TextureDimension::D2, + label: None, + mip_level_count: 1, + sample_count: 1, + usage, + view_formats: &[], + }, + sampler: ImageSampler::Default, + texture_view_descriptor: None, + asset_usage: RenderAssetUsages::default(), + } } /// Returns the width of a 2D image. From 3396f812ef3e1ab3f71bd90664c550db80e61339 Mon Sep 17 00:00:00 2001 From: tigregalis Date: Wed, 8 Jan 2025 11:29:27 +0800 Subject: [PATCH 05/14] add hdr flag --- crates/bevy_image/src/image.rs | 8 ++++++-- examples/3d/render_to_texture.rs | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/bevy_image/src/image.rs b/crates/bevy_image/src/image.rs index e39522a822..7e8633151d 100644 --- a/crates/bevy_image/src/image.rs +++ b/crates/bevy_image/src/image.rs @@ -848,8 +848,12 @@ impl Image { /// /// [`Camera`]: https://docs.rs/bevy/latest/bevy/render/camera/struct.Camera.html /// [`RenderTarget::Image`]: https://docs.rs/bevy/latest/bevy/render/camera/enum.RenderTarget.html#variant.Image - pub fn new_target_texture(width: u32, height: u32) -> Self { - let format = TextureFormat::bevy_default(); + pub fn new_target_texture(width: u32, height: u32, hdr: bool) -> Self { + let format = if hdr { + TEXTURE_FORMAT_HDR + } else { + TEXTURE_FORMAT_SDR + }; let size = Extent3d { width, height, diff --git a/examples/3d/render_to_texture.rs b/examples/3d/render_to_texture.rs index 3cc1a96078..f5e7d2667d 100644 --- a/examples/3d/render_to_texture.rs +++ b/examples/3d/render_to_texture.rs @@ -27,7 +27,7 @@ fn setup( mut images: ResMut>, ) { // This is the texture that will be rendered to. - let image = Image::new_target_texture(512, 512); + let image = Image::new_target_texture(512, 512, false); let image_handle = images.add(image); From c4672a34d2206331fa99c4aa68728e0dad90b439 Mon Sep 17 00:00:00 2001 From: tigregalis Date: Wed, 8 Jan 2025 13:00:41 +0800 Subject: [PATCH 06/14] fix headless_renderer example exiting immediately --- examples/app/headless_renderer.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/app/headless_renderer.rs b/examples/app/headless_renderer.rs index 5d027b2115..9ab3b9b83d 100644 --- a/examples/app/headless_renderer.rs +++ b/examples/app/headless_renderer.rs @@ -29,6 +29,7 @@ use bevy::{ renderer::{RenderContext, RenderDevice, RenderQueue}, Extract, Render, RenderApp, RenderSystems, }, + window::ExitCondition, winit::WinitPlugin, }; use crossbeam_channel::{Receiver, Sender}; @@ -92,7 +93,7 @@ fn main() { primary_window: None, // Don’t automatically exit due to having no windows. // Instead, the code in `update()` will explicitly produce an `AppExit` event. - exit_condition: bevy::window::ExitCondition::DontExit, + exit_condition: ExitCondition::DontExit, ..default() }) // WinitPlugin will panic in environments without a display server. From a2d8f253a9b1970ba687112bd9b6ec3226a34169 Mon Sep 17 00:00:00 2001 From: tigregalis Date: Wed, 8 Jan 2025 13:09:58 +0800 Subject: [PATCH 07/14] update compute_shader_game_of_life example --- examples/shader/compute_shader_game_of_life.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/examples/shader/compute_shader_game_of_life.rs b/examples/shader/compute_shader_game_of_life.rs index 575a09f1d1..5f209e73c9 100644 --- a/examples/shader/compute_shader_game_of_life.rs +++ b/examples/shader/compute_shader_game_of_life.rs @@ -51,17 +51,9 @@ fn main() { } fn setup(mut commands: Commands, mut images: ResMut>) { - let mut image = Image::new_fill( - Extent3d { - width: SIZE.0, - height: SIZE.1, - depth_or_array_layers: 1, - }, - TextureDimension::D2, - &[0, 0, 0, 255], - TextureFormat::R32Float, - RenderAssetUsages::RENDER_WORLD, - ); + let mut image = Image::new_target_texture(SIZE.0, SIZE.1, false); + image.asset_usage = RenderAssetUsages::RENDER_WORLD; + image.texture_descriptor.format = TextureFormat::R32Float; image.texture_descriptor.usage = TextureUsages::COPY_DST | TextureUsages::STORAGE_BINDING | TextureUsages::TEXTURE_BINDING; let image0 = images.add(image.clone()); From ae0ee4f0e2f4cc72ab411c9f7adaaa2e6acdc9aa Mon Sep 17 00:00:00 2001 From: tigregalis Date: Mon, 21 Apr 2025 09:26:48 +0800 Subject: [PATCH 08/14] change new_target_texture to take TextureFormat --- crates/bevy_image/src/image.rs | 12 +++++------- examples/3d/render_to_texture.rs | 4 ++-- examples/shader/compute_shader_game_of_life.rs | 3 +-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/crates/bevy_image/src/image.rs b/crates/bevy_image/src/image.rs index 7e8633151d..af328d0d76 100644 --- a/crates/bevy_image/src/image.rs +++ b/crates/bevy_image/src/image.rs @@ -846,14 +846,12 @@ impl Image { /// Create a new zero-filled image with a given size, which can be rendered to. This is primarily /// for use as a render target for a [`Camera`]. See [`RenderTarget::Image`]. /// + /// You can use [`TEXTURE_FORMAT_SDR`] and [`TEXTURE_FORMAT_HDR`] + /// for Standard Dynamic Range (SDR) and High Dynamic Range (HDR) respectively. + /// /// [`Camera`]: https://docs.rs/bevy/latest/bevy/render/camera/struct.Camera.html /// [`RenderTarget::Image`]: https://docs.rs/bevy/latest/bevy/render/camera/enum.RenderTarget.html#variant.Image - pub fn new_target_texture(width: u32, height: u32, hdr: bool) -> Self { - let format = if hdr { - TEXTURE_FORMAT_HDR - } else { - TEXTURE_FORMAT_SDR - }; + pub fn new_target_texture(width: u32, height: u32, format: TextureFormat) -> Self { let size = Extent3d { width, height, @@ -867,7 +865,7 @@ impl Image { let data = vec![0; format.pixel_size() * size.volume()]; Image { - data, + data: Some(data), texture_descriptor: TextureDescriptor { size, format, diff --git a/examples/3d/render_to_texture.rs b/examples/3d/render_to_texture.rs index f5e7d2667d..5ba3ec7010 100644 --- a/examples/3d/render_to_texture.rs +++ b/examples/3d/render_to_texture.rs @@ -2,7 +2,7 @@ use std::f32::consts::PI; -use bevy::{prelude::*, render::view::RenderLayers}; +use bevy::{image::TEXTURE_FORMAT_SDR, prelude::*, render::view::RenderLayers}; fn main() { App::new() @@ -27,7 +27,7 @@ fn setup( mut images: ResMut>, ) { // This is the texture that will be rendered to. - let image = Image::new_target_texture(512, 512, false); + let image = Image::new_target_texture(512, 512, TEXTURE_FORMAT_SDR); let image_handle = images.add(image); diff --git a/examples/shader/compute_shader_game_of_life.rs b/examples/shader/compute_shader_game_of_life.rs index 5f209e73c9..a11767f06f 100644 --- a/examples/shader/compute_shader_game_of_life.rs +++ b/examples/shader/compute_shader_game_of_life.rs @@ -51,9 +51,8 @@ fn main() { } fn setup(mut commands: Commands, mut images: ResMut>) { - let mut image = Image::new_target_texture(SIZE.0, SIZE.1, false); + let mut image = Image::new_target_texture(SIZE.0, SIZE.1, TextureFormat::R32Float); image.asset_usage = RenderAssetUsages::RENDER_WORLD; - image.texture_descriptor.format = TextureFormat::R32Float; image.texture_descriptor.usage = TextureUsages::COPY_DST | TextureUsages::STORAGE_BINDING | TextureUsages::TEXTURE_BINDING; let image0 = images.add(image.clone()); From 301dc28371fa1db9721dd906318a2e0d684f38ce Mon Sep 17 00:00:00 2001 From: tigregalis Date: Mon, 21 Apr 2025 11:01:36 +0800 Subject: [PATCH 09/14] Update new_target_texture doc comment --- crates/bevy_image/src/image.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/bevy_image/src/image.rs b/crates/bevy_image/src/image.rs index af328d0d76..ab962c69ea 100644 --- a/crates/bevy_image/src/image.rs +++ b/crates/bevy_image/src/image.rs @@ -843,12 +843,18 @@ impl Image { Image::new(size, dimension, data, format, asset_usage) } - /// Create a new zero-filled image with a given size, which can be rendered to. This is primarily - /// for use as a render target for a [`Camera`]. See [`RenderTarget::Image`]. + /// Create a new zero-filled image with a given size, which can be rendered to. + /// This is primarily for use as a render target for a [`Camera`]. + /// See [`RenderTarget::Image`]. /// /// You can use [`TEXTURE_FORMAT_SDR`] and [`TEXTURE_FORMAT_HDR`] /// for Standard Dynamic Range (SDR) and High Dynamic Range (HDR) respectively. /// + /// The default texture usages are + /// [`TEXTURE_BINDING`](TextureUsages::TEXTURE_BINDING), + /// [`COPY_DST`](TextureUsages::COPY_DST), + /// [`RENDER_ATTACHMENT`](TextureUsages::RENDER_ATTACHMENT). + /// /// [`Camera`]: https://docs.rs/bevy/latest/bevy/render/camera/struct.Camera.html /// [`RenderTarget::Image`]: https://docs.rs/bevy/latest/bevy/render/camera/enum.RenderTarget.html#variant.Image pub fn new_target_texture(width: u32, height: u32, format: TextureFormat) -> Self { From 71125663004daf450a98f68c724b30223049c514 Mon Sep 17 00:00:00 2001 From: tigregalis Date: Thu, 24 Apr 2025 01:45:33 +0800 Subject: [PATCH 10/14] update new_target_texture docs --- crates/bevy_image/src/image.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/bevy_image/src/image.rs b/crates/bevy_image/src/image.rs index ab962c69ea..fc3efa63ec 100644 --- a/crates/bevy_image/src/image.rs +++ b/crates/bevy_image/src/image.rs @@ -844,17 +844,22 @@ impl Image { } /// Create a new zero-filled image with a given size, which can be rendered to. + /// Useful for mirrors, UI, or exporting images for example. /// This is primarily for use as a render target for a [`Camera`]. /// See [`RenderTarget::Image`]. /// - /// You can use [`TEXTURE_FORMAT_SDR`] and [`TEXTURE_FORMAT_HDR`] - /// for Standard Dynamic Range (SDR) and High Dynamic Range (HDR) respectively. + /// For Standard Dynamic Range (SDR) images you can use [`TextureFormat::Rgba8UnormSrgb`]. + /// For High Dynamic Range (HDR) images you can use [`TextureFormat::Rgba16Float`]. /// - /// The default texture usages are + /// The default [`TextureUsages`] are /// [`TEXTURE_BINDING`](TextureUsages::TEXTURE_BINDING), /// [`COPY_DST`](TextureUsages::COPY_DST), /// [`RENDER_ATTACHMENT`](TextureUsages::RENDER_ATTACHMENT). /// + /// The default [`RenderAssetUsages`] is [`MAIN_WORLD | RENDER_WORLD`](RenderAssetUsages::default) + /// so that it is accessible from the CPU and GPU. + /// You can customise this by changing the [`asset_usage`](Image::asset_usage) field. + /// /// [`Camera`]: https://docs.rs/bevy/latest/bevy/render/camera/struct.Camera.html /// [`RenderTarget::Image`]: https://docs.rs/bevy/latest/bevy/render/camera/enum.RenderTarget.html#variant.Image pub fn new_target_texture(width: u32, height: u32, format: TextureFormat) -> Self { From a2b7a08a05e7efe1ad378da524d1ad1454f2cd0d Mon Sep 17 00:00:00 2001 From: tigregalis Date: Thu, 24 Apr 2025 01:46:06 +0800 Subject: [PATCH 11/14] update render_to_texture example --- examples/3d/render_to_texture.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/3d/render_to_texture.rs b/examples/3d/render_to_texture.rs index 5ba3ec7010..419c748881 100644 --- a/examples/3d/render_to_texture.rs +++ b/examples/3d/render_to_texture.rs @@ -2,7 +2,10 @@ use std::f32::consts::PI; -use bevy::{image::TEXTURE_FORMAT_SDR, prelude::*, render::view::RenderLayers}; +use bevy::{ + prelude::*, + render::{render_resource::TextureFormat, view::RenderLayers}, +}; fn main() { App::new() @@ -27,7 +30,7 @@ fn setup( mut images: ResMut>, ) { // This is the texture that will be rendered to. - let image = Image::new_target_texture(512, 512, TEXTURE_FORMAT_SDR); + let image = Image::new_target_texture(512, 512, TextureFormat::bevy_default()); let image_handle = images.add(image); From eb48989b46e5331315cb0bc12a586c806ed0a1f8 Mon Sep 17 00:00:00 2001 From: tigregalis Date: Thu, 24 Apr 2025 01:50:36 +0800 Subject: [PATCH 12/14] use American spelling --- crates/bevy_image/src/image.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_image/src/image.rs b/crates/bevy_image/src/image.rs index fc3efa63ec..a1469e7d92 100644 --- a/crates/bevy_image/src/image.rs +++ b/crates/bevy_image/src/image.rs @@ -858,7 +858,7 @@ impl Image { /// /// The default [`RenderAssetUsages`] is [`MAIN_WORLD | RENDER_WORLD`](RenderAssetUsages::default) /// so that it is accessible from the CPU and GPU. - /// You can customise this by changing the [`asset_usage`](Image::asset_usage) field. + /// You can customize this by changing the [`asset_usage`](Image::asset_usage) field. /// /// [`Camera`]: https://docs.rs/bevy/latest/bevy/render/camera/struct.Camera.html /// [`RenderTarget::Image`]: https://docs.rs/bevy/latest/bevy/render/camera/enum.RenderTarget.html#variant.Image From 78c5f97cd4ecdbd3b07900c5d112d7f7fa0d1cc8 Mon Sep 17 00:00:00 2001 From: tigregalis Date: Thu, 10 Jul 2025 13:52:30 +0800 Subject: [PATCH 13/14] bring in new Image fields --- crates/bevy_image/src/image.rs | 2 ++ examples/app/headless_renderer.rs | 23 ++++++----------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/crates/bevy_image/src/image.rs b/crates/bevy_image/src/image.rs index a1469e7d92..3aa96dd3b5 100644 --- a/crates/bevy_image/src/image.rs +++ b/crates/bevy_image/src/image.rs @@ -877,6 +877,7 @@ impl Image { Image { data: Some(data), + data_order: TextureDataOrder::default(), texture_descriptor: TextureDescriptor { size, format, @@ -890,6 +891,7 @@ impl Image { sampler: ImageSampler::Default, texture_view_descriptor: None, asset_usage: RenderAssetUsages::default(), + copy_on_resize: true, } } diff --git a/examples/app/headless_renderer.rs b/examples/app/headless_renderer.rs index 9ab3b9b83d..936582417e 100644 --- a/examples/app/headless_renderer.rs +++ b/examples/app/headless_renderer.rs @@ -19,7 +19,7 @@ use bevy::{ prelude::*, render::{ camera::RenderTarget, - render_asset::{RenderAssetUsages, RenderAssets}, + render_asset::RenderAssets, render_graph::{self, NodeRunError, RenderGraph, RenderGraphContext, RenderLabel}, render_resource::{ Buffer, BufferDescriptor, BufferUsages, CommandEncoderDescriptor, Extent3d, MapMode, @@ -248,25 +248,14 @@ fn setup_render_target( }; // This is the texture that will be rendered to. - let mut render_target_image = Image::new_fill( - size, - TextureDimension::D2, - &[0; 4], - TextureFormat::bevy_default(), - RenderAssetUsages::default(), - ); - render_target_image.texture_descriptor.usage |= - TextureUsages::COPY_SRC | TextureUsages::RENDER_ATTACHMENT | TextureUsages::TEXTURE_BINDING; + let mut render_target_image = + Image::new_target_texture(size.width, size.height, TextureFormat::bevy_default()); + render_target_image.texture_descriptor.usage |= TextureUsages::COPY_SRC; let render_target_image_handle = images.add(render_target_image); // This is the texture that will be copied to. - let cpu_image = Image::new_fill( - size, - TextureDimension::D2, - &[0; 4], - TextureFormat::bevy_default(), - RenderAssetUsages::default(), - ); + let cpu_image = + Image::new_target_texture(size.width, size.height, TextureFormat::bevy_default()); let cpu_image_handle = images.add(cpu_image); commands.spawn(ImageCopier::new( From e2dbe752d683d26201c0edc88904cb535633fa84 Mon Sep 17 00:00:00 2001 From: tigregalis Date: Tue, 15 Jul 2025 21:45:15 +0800 Subject: [PATCH 14/14] remove unused import --- examples/app/headless_renderer.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/app/headless_renderer.rs b/examples/app/headless_renderer.rs index 936582417e..a4c6ebb113 100644 --- a/examples/app/headless_renderer.rs +++ b/examples/app/headless_renderer.rs @@ -23,8 +23,7 @@ use bevy::{ render_graph::{self, NodeRunError, RenderGraph, RenderGraphContext, RenderLabel}, render_resource::{ Buffer, BufferDescriptor, BufferUsages, CommandEncoderDescriptor, Extent3d, MapMode, - PollType, TexelCopyBufferInfo, TexelCopyBufferLayout, TextureDimension, TextureFormat, - TextureUsages, + PollType, TexelCopyBufferInfo, TexelCopyBufferLayout, TextureFormat, TextureUsages, }, renderer::{RenderContext, RenderDevice, RenderQueue}, Extract, Render, RenderApp, RenderSystems,