From 31ec5751f591e30bec9acbb13187c254a1f61390 Mon Sep 17 00:00:00 2001 From: Benjamin Brienen Date: Sun, 10 Nov 2024 07:54:38 +0100 Subject: [PATCH] =?UTF-8?q?Don't=20re=C3=ABxport=20`bevy=5Fimage`=20from?= =?UTF-8?q?=20`bevy=5Frender`=20(#16163)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #15940 Remove the `pub use` and fix the compile errors. Make `bevy_image` available as `bevy::image`. Feature Frenzy would be good here! Maybe I'll learn how to use it if I have some time this weekend, or maybe a reviewer can use it. Use `bevy_image` instead of `bevy_render::texture` items. --------- Co-authored-by: chompaa Co-authored-by: Carter Anderson --- .../src/auto_exposure/pipeline.rs | 2 +- .../src/auto_exposure/settings.rs | 3 +- .../src/contrast_adaptive_sharpening/mod.rs | 2 +- crates/bevy_core_pipeline/src/core_3d/mod.rs | 7 ++-- crates/bevy_core_pipeline/src/dof/mod.rs | 3 +- crates/bevy_core_pipeline/src/fxaa/mod.rs | 2 +- .../src/motion_blur/pipeline.rs | 2 +- .../bevy_core_pipeline/src/oit/resolve/mod.rs | 2 +- .../src/post_process/mod.rs | 3 +- crates/bevy_core_pipeline/src/skybox/mod.rs | 3 +- crates/bevy_core_pipeline/src/smaa/mod.rs | 35 ++++++++----------- crates/bevy_core_pipeline/src/taa/mod.rs | 3 +- .../bevy_core_pipeline/src/tonemapping/mod.rs | 17 ++++----- crates/bevy_gizmos/Cargo.toml | 1 + crates/bevy_gizmos/src/pipeline_2d.rs | 2 +- crates/bevy_gizmos/src/pipeline_3d.rs | 2 +- crates/bevy_gltf/src/lib.rs | 2 +- crates/bevy_gltf/src/loader.rs | 8 ++--- crates/bevy_image/src/image.rs | 1 + crates/bevy_image/src/lib.rs | 4 +++ crates/bevy_internal/src/lib.rs | 2 ++ crates/bevy_internal/src/prelude.rs | 4 +++ crates/bevy_pbr/Cargo.toml | 1 + crates/bevy_pbr/src/deferred/mod.rs | 9 +++-- crates/bevy_pbr/src/lib.rs | 4 ++- .../src/light_probe/environment_map.rs | 3 +- .../src/light_probe/irradiance_volume.rs | 3 +- crates/bevy_pbr/src/light_probe/mod.rs | 3 +- crates/bevy_pbr/src/lightmap/mod.rs | 3 +- crates/bevy_pbr/src/material.rs | 3 +- crates/bevy_pbr/src/render/mesh.rs | 3 +- .../bevy_pbr/src/render/mesh_view_bindings.rs | 3 +- crates/bevy_pbr/src/ssr/mod.rs | 2 +- crates/bevy_pbr/src/volumetric_fog/mod.rs | 2 +- crates/bevy_pbr/src/volumetric_fog/render.rs | 3 +- .../bevy_render/macros/src/as_bind_group.rs | 7 ++-- crates/bevy_render/src/camera/camera.rs | 2 +- .../src/camera/manual_texture_view.rs | 5 ++- crates/bevy_render/src/gpu_readback.rs | 4 +-- crates/bevy_render/src/lib.rs | 3 +- .../src/render_resource/bind_group.rs | 17 +++++---- crates/bevy_render/src/texture/mod.rs | 19 ++++------ crates/bevy_render/src/view/mod.rs | 5 +-- .../bevy_render/src/view/window/screenshot.rs | 5 +-- crates/bevy_sprite/Cargo.toml | 1 + .../src/dynamic_texture_atlas_builder.rs | 3 +- crates/bevy_sprite/src/lib.rs | 2 +- .../bevy_sprite/src/mesh2d/color_material.rs | 7 ++-- crates/bevy_sprite/src/mesh2d/material.rs | 3 +- crates/bevy_sprite/src/mesh2d/mesh.rs | 8 ++--- crates/bevy_sprite/src/picking_backend.rs | 1 + crates/bevy_sprite/src/render/mod.rs | 6 ++-- crates/bevy_sprite/src/sprite.rs | 3 +- crates/bevy_sprite/src/texture_atlas.rs | 2 +- .../bevy_sprite/src/texture_atlas_builder.rs | 3 +- .../src/texture_slice/computed_slices.rs | 2 +- crates/bevy_text/Cargo.toml | 1 + crates/bevy_text/src/font_atlas.rs | 2 +- crates/bevy_text/src/font_atlas_set.rs | 2 +- crates/bevy_text/src/glyph.rs | 2 +- crates/bevy_text/src/pipeline.rs | 2 +- crates/bevy_text/src/text2d.rs | 2 +- crates/bevy_ui/Cargo.toml | 1 + crates/bevy_ui/src/layout/mod.rs | 2 +- crates/bevy_ui/src/render/box_shadow.rs | 2 +- crates/bevy_ui/src/render/mod.rs | 4 +-- crates/bevy_ui/src/render/pipeline.rs | 2 +- .../src/render/ui_material_pipeline.rs | 2 +- .../src/render/ui_texture_slice_pipeline.rs | 3 +- crates/bevy_ui/src/ui_material.rs | 3 +- crates/bevy_ui/src/widget/image.rs | 3 +- crates/bevy_ui/src/widget/text.rs | 3 +- examples/2d/mesh2d_manual.rs | 1 - examples/2d/texture_atlas.rs | 2 +- examples/3d/anti_aliasing.rs | 2 +- examples/3d/clearcoat.rs | 2 +- examples/3d/deferred_rendering.rs | 2 +- examples/3d/motion_blur.rs | 9 +++-- examples/3d/parallax_mapping.rs | 2 +- examples/3d/rotate_environment_map.rs | 2 +- examples/3d/scrolling_fog.rs | 6 ++-- examples/3d/skybox.rs | 2 +- examples/3d/ssr.rs | 12 +++---- examples/app/headless_renderer.rs | 2 +- examples/asset/alter_sprite.rs | 5 ++- examples/asset/asset_settings.rs | 2 +- examples/asset/repeated_texture.rs | 4 +-- examples/shader/custom_phase_item.rs | 1 - examples/shader/custom_post_processing.rs | 1 - examples/shader/gpu_readback.rs | 3 +- examples/shader/specialized_mesh_pipeline.rs | 1 - examples/ui/ui_texture_slice_flip_and_tile.rs | 2 +- 92 files changed, 189 insertions(+), 170 deletions(-) diff --git a/crates/bevy_core_pipeline/src/auto_exposure/pipeline.rs b/crates/bevy_core_pipeline/src/auto_exposure/pipeline.rs index 798bb368e17bd..87d6abd8cf8c5 100644 --- a/crates/bevy_core_pipeline/src/auto_exposure/pipeline.rs +++ b/crates/bevy_core_pipeline/src/auto_exposure/pipeline.rs @@ -3,11 +3,11 @@ use super::compensation_curve::{ }; use bevy_asset::prelude::*; use bevy_ecs::prelude::*; +use bevy_image::Image; use bevy_render::{ globals::GlobalsUniform, render_resource::{binding_types::*, *}, renderer::RenderDevice, - texture::Image, view::ViewUniform, }; use core::num::NonZero; diff --git a/crates/bevy_core_pipeline/src/auto_exposure/settings.rs b/crates/bevy_core_pipeline/src/auto_exposure/settings.rs index 066e8d3c8867b..91bdf836eebee 100644 --- a/crates/bevy_core_pipeline/src/auto_exposure/settings.rs +++ b/crates/bevy_core_pipeline/src/auto_exposure/settings.rs @@ -3,8 +3,9 @@ use core::ops::RangeInclusive; use super::compensation_curve::AutoExposureCompensationCurve; use bevy_asset::Handle; use bevy_ecs::{prelude::Component, reflect::ReflectComponent}; +use bevy_image::Image; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; -use bevy_render::{extract_component::ExtractComponent, texture::Image}; +use bevy_render::extract_component::ExtractComponent; use bevy_utils::default; /// Component that enables auto exposure for an HDR-enabled 2d or 3d camera. diff --git a/crates/bevy_core_pipeline/src/contrast_adaptive_sharpening/mod.rs b/crates/bevy_core_pipeline/src/contrast_adaptive_sharpening/mod.rs index 093c6fa9a32fd..e76be196d59f8 100644 --- a/crates/bevy_core_pipeline/src/contrast_adaptive_sharpening/mod.rs +++ b/crates/bevy_core_pipeline/src/contrast_adaptive_sharpening/mod.rs @@ -6,6 +6,7 @@ use crate::{ use bevy_app::prelude::*; use bevy_asset::{load_internal_asset, Handle}; use bevy_ecs::{prelude::*, query::QueryItem}; +use bevy_image::BevyDefault as _; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_render::{ extract_component::{ExtractComponent, ExtractComponentPlugin, UniformComponentPlugin}, @@ -16,7 +17,6 @@ use bevy_render::{ *, }, renderer::RenderDevice, - texture::BevyDefault, view::{ExtractedView, ViewTarget}, Render, RenderApp, RenderSet, }; diff --git a/crates/bevy_core_pipeline/src/core_3d/mod.rs b/crates/bevy_core_pipeline/src/core_3d/mod.rs index ae88905bacd49..4a616226d150f 100644 --- a/crates/bevy_core_pipeline/src/core_3d/mod.rs +++ b/crates/bevy_core_pipeline/src/core_3d/mod.rs @@ -65,14 +65,15 @@ pub const DEPTH_TEXTURE_SAMPLING_SUPPORTED: bool = true; use core::ops::Range; -use bevy_asset::{AssetId, UntypedAssetId}; -use bevy_color::LinearRgba; pub use camera_3d::*; pub use main_opaque_pass_3d_node::*; pub use main_transparent_pass_3d_node::*; use bevy_app::{App, Plugin, PostUpdate}; +use bevy_asset::{AssetId, UntypedAssetId}; +use bevy_color::LinearRgba; use bevy_ecs::{entity::EntityHashSet, prelude::*}; +use bevy_image::{BevyDefault, Image}; use bevy_math::FloatOrd; use bevy_render::sync_world::MainEntity; use bevy_render::{ @@ -91,7 +92,7 @@ use bevy_render::{ }, renderer::RenderDevice, sync_world::RenderEntity, - texture::{BevyDefault, ColorAttachment, Image, TextureCache}, + texture::{ColorAttachment, TextureCache}, view::{ExtractedView, ViewDepthTexture, ViewTarget}, Extract, ExtractSchedule, Render, RenderApp, RenderSet, }; diff --git a/crates/bevy_core_pipeline/src/dof/mod.rs b/crates/bevy_core_pipeline/src/dof/mod.rs index d4ed35e64eed1..06cbbe3e9d312 100644 --- a/crates/bevy_core_pipeline/src/dof/mod.rs +++ b/crates/bevy_core_pipeline/src/dof/mod.rs @@ -26,6 +26,7 @@ use bevy_ecs::{ system::{lifetimeless::Read, Commands, Query, Res, ResMut, Resource}, world::{FromWorld, World}, }; +use bevy_image::BevyDefault as _; use bevy_math::ops; use bevy_reflect::{prelude::ReflectDefault, Reflect}; use bevy_render::{ @@ -48,7 +49,7 @@ use bevy_render::{ renderer::{RenderContext, RenderDevice}, sync_component::SyncComponentPlugin, sync_world::RenderEntity, - texture::{BevyDefault, CachedTexture, TextureCache}, + texture::{CachedTexture, TextureCache}, view::{ prepare_view_targets, ExtractedView, Msaa, ViewDepthTexture, ViewTarget, ViewUniform, ViewUniformOffset, ViewUniforms, diff --git a/crates/bevy_core_pipeline/src/fxaa/mod.rs b/crates/bevy_core_pipeline/src/fxaa/mod.rs index 076d40dcfc653..547b59762442f 100644 --- a/crates/bevy_core_pipeline/src/fxaa/mod.rs +++ b/crates/bevy_core_pipeline/src/fxaa/mod.rs @@ -6,6 +6,7 @@ use crate::{ use bevy_app::prelude::*; use bevy_asset::{load_internal_asset, Handle}; use bevy_ecs::prelude::*; +use bevy_image::BevyDefault as _; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_render::{ extract_component::{ExtractComponent, ExtractComponentPlugin}, @@ -16,7 +17,6 @@ use bevy_render::{ *, }, renderer::RenderDevice, - texture::BevyDefault, view::{ExtractedView, ViewTarget}, Render, RenderApp, RenderSet, }; diff --git a/crates/bevy_core_pipeline/src/motion_blur/pipeline.rs b/crates/bevy_core_pipeline/src/motion_blur/pipeline.rs index c4fbd1c5721c7..8109beeb4eb3a 100644 --- a/crates/bevy_core_pipeline/src/motion_blur/pipeline.rs +++ b/crates/bevy_core_pipeline/src/motion_blur/pipeline.rs @@ -5,6 +5,7 @@ use bevy_ecs::{ system::{Commands, Query, Res, ResMut, Resource}, world::FromWorld, }; +use bevy_image::BevyDefault as _; use bevy_render::{ globals::GlobalsUniform, render_resource::{ @@ -19,7 +20,6 @@ use bevy_render::{ TextureFormat, TextureSampleType, }, renderer::RenderDevice, - texture::BevyDefault, view::{ExtractedView, Msaa, ViewTarget}, }; diff --git a/crates/bevy_core_pipeline/src/oit/resolve/mod.rs b/crates/bevy_core_pipeline/src/oit/resolve/mod.rs index e86ef1259aba2..101f7b1ed941e 100644 --- a/crates/bevy_core_pipeline/src/oit/resolve/mod.rs +++ b/crates/bevy_core_pipeline/src/oit/resolve/mod.rs @@ -9,6 +9,7 @@ use bevy_ecs::{ entity::{EntityHashMap, EntityHashSet}, prelude::*, }; +use bevy_image::BevyDefault as _; use bevy_render::{ render_resource::{ binding_types::{storage_buffer_sized, texture_depth_2d, uniform_buffer}, @@ -18,7 +19,6 @@ use bevy_render::{ Shader, ShaderDefVal, ShaderStages, TextureFormat, }, renderer::{RenderAdapter, RenderDevice}, - texture::BevyDefault, view::{ExtractedView, ViewTarget, ViewUniform, ViewUniforms}, Render, RenderApp, RenderSet, }; diff --git a/crates/bevy_core_pipeline/src/post_process/mod.rs b/crates/bevy_core_pipeline/src/post_process/mod.rs index f7131482ae8a3..a633134b276d2 100644 --- a/crates/bevy_core_pipeline/src/post_process/mod.rs +++ b/crates/bevy_core_pipeline/src/post_process/mod.rs @@ -14,6 +14,7 @@ use bevy_ecs::{ system::{lifetimeless::Read, Commands, Query, Res, ResMut, Resource}, world::{FromWorld, World}, }; +use bevy_image::{BevyDefault, Image}; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_render::{ camera::Camera, @@ -32,7 +33,7 @@ use bevy_render::{ TextureDimension, TextureFormat, TextureSampleType, }, renderer::{RenderContext, RenderDevice, RenderQueue}, - texture::{BevyDefault, GpuImage, Image}, + texture::GpuImage, view::{ExtractedView, ViewTarget}, Render, RenderApp, RenderSet, }; diff --git a/crates/bevy_core_pipeline/src/skybox/mod.rs b/crates/bevy_core_pipeline/src/skybox/mod.rs index de74cb62cb662..5ca7c3fce2d26 100644 --- a/crates/bevy_core_pipeline/src/skybox/mod.rs +++ b/crates/bevy_core_pipeline/src/skybox/mod.rs @@ -6,6 +6,7 @@ use bevy_ecs::{ schedule::IntoSystemConfigs, system::{Commands, Query, Res, ResMut, Resource}, }; +use bevy_image::{BevyDefault, Image}; use bevy_math::{Mat4, Quat}; use bevy_render::{ camera::Exposure, @@ -19,7 +20,7 @@ use bevy_render::{ *, }, renderer::RenderDevice, - texture::{BevyDefault, GpuImage, Image}, + texture::GpuImage, view::{ExtractedView, Msaa, ViewTarget, ViewUniform, ViewUniforms}, Render, RenderApp, RenderSet, }; diff --git a/crates/bevy_core_pipeline/src/smaa/mod.rs b/crates/bevy_core_pipeline/src/smaa/mod.rs index 2338ecfcedac1..ae294c19b2995 100644 --- a/crates/bevy_core_pipeline/src/smaa/mod.rs +++ b/crates/bevy_core_pipeline/src/smaa/mod.rs @@ -30,6 +30,10 @@ //! //! [SMAA]: https://www.iryoku.com/smaa/ +use crate::{ + core_2d::graph::{Core2d, Node2d}, + core_3d::graph::{Core3d, Node3d}, +}; use bevy_app::{App, Plugin}; #[cfg(feature = "smaa_luts")] use bevy_asset::load_internal_binary_asset; @@ -44,6 +48,7 @@ use bevy_ecs::{ system::{lifetimeless::Read, Commands, Query, Res, ResMut, Resource}, world::{FromWorld, World}, }; +use bevy_image::{BevyDefault, Image}; use bevy_math::{vec4, Vec4}; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_render::{ @@ -67,24 +72,12 @@ use bevy_render::{ VertexState, }, renderer::{RenderContext, RenderDevice, RenderQueue}, - texture::{BevyDefault, CachedTexture, GpuImage, Image, TextureCache}, + texture::{CachedTexture, GpuImage, TextureCache}, view::{ExtractedView, ViewTarget}, Render, RenderApp, RenderSet, }; -#[cfg(feature = "smaa_luts")] -use bevy_render::{ - render_asset::RenderAssetUsages, - texture::{CompressedImageFormats, ImageFormat, ImageSampler, ImageType}, -}; use bevy_utils::prelude::default; -#[cfg(not(feature = "smaa_luts"))] -use crate::tonemapping::lut_placeholder; -use crate::{ - core_2d::graph::{Core2d, Node2d}, - core_3d::graph::{Core3d, Node3d}, -}; - /// The handle of the `smaa.wgsl` shader. const SMAA_SHADER_HANDLE: Handle = Handle::weak_from_u128(12247928498010601081); /// The handle of the area LUT, a KTX2 format texture that SMAA uses internally. @@ -306,11 +299,11 @@ impl Plugin for SmaaPlugin { #[cfg(all(debug_assertions, feature = "dds"))] "SMAAAreaLUT".to_owned(), bytes, - ImageType::Format(ImageFormat::Ktx2), - CompressedImageFormats::NONE, + bevy_image::ImageType::Format(bevy_image::ImageFormat::Ktx2), + bevy_image::CompressedImageFormats::NONE, false, - ImageSampler::Default, - RenderAssetUsages::RENDER_WORLD, + bevy_image::ImageSampler::Default, + bevy_asset::RenderAssetUsages::RENDER_WORLD, ) .expect("Failed to load SMAA area LUT") ); @@ -324,11 +317,11 @@ impl Plugin for SmaaPlugin { #[cfg(all(debug_assertions, feature = "dds"))] "SMAASearchLUT".to_owned(), bytes, - ImageType::Format(ImageFormat::Ktx2), - CompressedImageFormats::NONE, + bevy_image::ImageType::Format(bevy_image::ImageFormat::Ktx2), + bevy_image::CompressedImageFormats::NONE, false, - ImageSampler::Default, - RenderAssetUsages::RENDER_WORLD, + bevy_image::ImageSampler::Default, + bevy_asset::RenderAssetUsages::RENDER_WORLD, ) .expect("Failed to load SMAA search LUT") ); diff --git a/crates/bevy_core_pipeline/src/taa/mod.rs b/crates/bevy_core_pipeline/src/taa/mod.rs index 193cd66aaf019..e9f8f1ac3d6a2 100644 --- a/crates/bevy_core_pipeline/src/taa/mod.rs +++ b/crates/bevy_core_pipeline/src/taa/mod.rs @@ -16,6 +16,7 @@ use bevy_ecs::{ system::{Commands, Query, Res, ResMut, Resource}, world::{FromWorld, World}, }; +use bevy_image::BevyDefault as _; use bevy_math::vec2; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_render::{ @@ -34,7 +35,7 @@ use bevy_render::{ renderer::{RenderContext, RenderDevice}, sync_component::SyncComponentPlugin, sync_world::RenderEntity, - texture::{BevyDefault, CachedTexture, TextureCache}, + texture::{CachedTexture, TextureCache}, view::{ExtractedView, Msaa, ViewTarget}, ExtractSchedule, MainWorld, Render, RenderApp, RenderSet, }; diff --git a/crates/bevy_core_pipeline/src/tonemapping/mod.rs b/crates/bevy_core_pipeline/src/tonemapping/mod.rs index 16fecb014015f..c6fb3217253f9 100644 --- a/crates/bevy_core_pipeline/src/tonemapping/mod.rs +++ b/crates/bevy_core_pipeline/src/tonemapping/mod.rs @@ -2,6 +2,7 @@ use crate::fullscreen_vertex_shader::fullscreen_shader_vertex_state; use bevy_app::prelude::*; use bevy_asset::{load_internal_asset, Assets, Handle}; use bevy_ecs::prelude::*; +use bevy_image::{CompressedImageFormats, Image, ImageSampler, ImageType}; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_render::{ camera::Camera, @@ -13,7 +14,7 @@ use bevy_render::{ *, }, renderer::RenderDevice, - texture::{CompressedImageFormats, FallbackImage, GpuImage, Image, ImageSampler, ImageType}, + texture::{FallbackImage, GpuImage}, view::{ExtractedView, ViewTarget, ViewUniform}, Render, RenderApp, RenderSet, }; @@ -433,14 +434,14 @@ pub fn get_lut_bind_group_layout_entries() -> [BindGroupLayoutEntryBuilder; 2] { // allow(dead_code) so it doesn't complain when the tonemapping_luts feature is disabled #[allow(dead_code)] fn setup_tonemapping_lut_image(bytes: &[u8], image_type: ImageType) -> Image { - let image_sampler = ImageSampler::Descriptor(bevy_render::texture::ImageSamplerDescriptor { + let image_sampler = ImageSampler::Descriptor(bevy_image::ImageSamplerDescriptor { label: Some("Tonemapping LUT sampler".to_string()), - address_mode_u: bevy_render::texture::ImageAddressMode::ClampToEdge, - address_mode_v: bevy_render::texture::ImageAddressMode::ClampToEdge, - address_mode_w: bevy_render::texture::ImageAddressMode::ClampToEdge, - mag_filter: bevy_render::texture::ImageFilterMode::Linear, - min_filter: bevy_render::texture::ImageFilterMode::Linear, - mipmap_filter: bevy_render::texture::ImageFilterMode::Linear, + address_mode_u: bevy_image::ImageAddressMode::ClampToEdge, + address_mode_v: bevy_image::ImageAddressMode::ClampToEdge, + address_mode_w: bevy_image::ImageAddressMode::ClampToEdge, + mag_filter: bevy_image::ImageFilterMode::Linear, + min_filter: bevy_image::ImageFilterMode::Linear, + mipmap_filter: bevy_image::ImageFilterMode::Linear, ..default() }); Image::from_buffer( diff --git a/crates/bevy_gizmos/Cargo.toml b/crates/bevy_gizmos/Cargo.toml index b36fcac5d42ca..d8f8a6c112e10 100644 --- a/crates/bevy_gizmos/Cargo.toml +++ b/crates/bevy_gizmos/Cargo.toml @@ -20,6 +20,7 @@ bevy_sprite = { path = "../bevy_sprite", version = "0.15.0-rc.3", optional = tru bevy_app = { path = "../bevy_app", version = "0.15.0-rc.3" } bevy_color = { path = "../bevy_color", version = "0.15.0-rc.3" } bevy_ecs = { path = "../bevy_ecs", version = "0.15.0-rc.3" } +bevy_image = { path = "../bevy_image", version = "0.15.0-rc.3" } bevy_math = { path = "../bevy_math", version = "0.15.0-rc.3" } bevy_asset = { path = "../bevy_asset", version = "0.15.0-rc.3" } bevy_render = { path = "../bevy_render", version = "0.15.0-rc.3", optional = true } diff --git a/crates/bevy_gizmos/src/pipeline_2d.rs b/crates/bevy_gizmos/src/pipeline_2d.rs index ff38abf031efc..9e122782f7fc5 100644 --- a/crates/bevy_gizmos/src/pipeline_2d.rs +++ b/crates/bevy_gizmos/src/pipeline_2d.rs @@ -13,6 +13,7 @@ use bevy_ecs::{ system::{Query, Res, ResMut, Resource}, world::{FromWorld, World}, }; +use bevy_image::BevyDefault as _; use bevy_math::FloatOrd; use bevy_render::sync_world::MainEntity; use bevy_render::{ @@ -22,7 +23,6 @@ use bevy_render::{ ViewSortedRenderPhases, }, render_resource::*, - texture::BevyDefault, view::{ExtractedView, Msaa, RenderLayers, ViewTarget}, Render, RenderApp, RenderSet, }; diff --git a/crates/bevy_gizmos/src/pipeline_3d.rs b/crates/bevy_gizmos/src/pipeline_3d.rs index 5e7a322f2a73d..2d3f2bbd8d583 100644 --- a/crates/bevy_gizmos/src/pipeline_3d.rs +++ b/crates/bevy_gizmos/src/pipeline_3d.rs @@ -17,6 +17,7 @@ use bevy_ecs::{ system::{Query, Res, ResMut, Resource}, world::{FromWorld, World}, }; +use bevy_image::BevyDefault as _; use bevy_pbr::{MeshPipeline, MeshPipelineKey, SetMeshViewBindGroup}; use bevy_render::sync_world::MainEntity; use bevy_render::{ @@ -26,7 +27,6 @@ use bevy_render::{ ViewSortedRenderPhases, }, render_resource::*, - texture::BevyDefault, view::{ExtractedView, Msaa, RenderLayers, ViewTarget}, Render, RenderApp, RenderSet, }; diff --git a/crates/bevy_gltf/src/lib.rs b/crates/bevy_gltf/src/lib.rs index 05d4c596f8469..46f9ad3ae90fb 100644 --- a/crates/bevy_gltf/src/lib.rs +++ b/crates/bevy_gltf/src/lib.rs @@ -103,12 +103,12 @@ pub use loader::*; use bevy_app::prelude::*; use bevy_asset::{Asset, AssetApp, AssetPath, Handle}; use bevy_ecs::{prelude::Component, reflect::ReflectComponent}; +use bevy_image::CompressedImageFormats; use bevy_pbr::StandardMaterial; use bevy_reflect::{std_traits::ReflectDefault, Reflect, TypePath}; use bevy_render::{ mesh::{skinning::SkinnedMeshInverseBindposes, Mesh, MeshVertexAttribute}, renderer::RenderDevice, - texture::CompressedImageFormats, }; use bevy_scene::Scene; diff --git a/crates/bevy_gltf/src/loader.rs b/crates/bevy_gltf/src/loader.rs index 1cc747264e7a7..d9d1571ce9c06 100644 --- a/crates/bevy_gltf/src/loader.rs +++ b/crates/bevy_gltf/src/loader.rs @@ -15,6 +15,10 @@ use bevy_ecs::{ world::World, }; use bevy_hierarchy::{BuildChildren, ChildBuild, WorldChildBuilder}; +use bevy_image::{ + CompressedImageFormats, Image, ImageAddressMode, ImageFilterMode, ImageLoaderSettings, + ImageSampler, ImageSamplerDescriptor, ImageType, TextureError, +}; use bevy_math::{Affine2, Mat4, Vec3}; use bevy_pbr::{ DirectionalLight, MeshMaterial3d, PointLight, SpotLight, StandardMaterial, UvChannel, @@ -31,10 +35,6 @@ use bevy_render::{ primitives::Aabb, render_asset::RenderAssetUsages, render_resource::{Face, PrimitiveTopology}, - texture::{ - CompressedImageFormats, Image, ImageAddressMode, ImageFilterMode, ImageLoaderSettings, - ImageSampler, ImageSamplerDescriptor, ImageType, TextureError, - }, view::Visibility, }; use bevy_scene::Scene; diff --git a/crates/bevy_image/src/image.rs b/crates/bevy_image/src/image.rs index abf504536e2e7..cfe3a768d6f55 100644 --- a/crates/bevy_image/src/image.rs +++ b/crates/bevy_image/src/image.rs @@ -14,6 +14,7 @@ use core::hash::Hash; use derive_more::derive::{Display, Error, From}; use serde::{Deserialize, Serialize}; use wgpu::{Extent3d, TextureDimension, TextureFormat, TextureViewDescriptor}; + pub trait BevyDefault { fn bevy_default() -> Self; } diff --git a/crates/bevy_image/src/lib.rs b/crates/bevy_image/src/lib.rs index ac5510e5e335b..ce2e932826067 100644 --- a/crates/bevy_image/src/lib.rs +++ b/crates/bevy_image/src/lib.rs @@ -2,6 +2,10 @@ #![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")] #![allow(unsafe_code)] +pub mod prelude { + pub use crate::{BevyDefault as _, Image, ImageFormat, TextureError}; +} + mod image; pub use self::image::*; #[cfg(feature = "basis-universal")] diff --git a/crates/bevy_internal/src/lib.rs b/crates/bevy_internal/src/lib.rs index bc553af972223..aa9ad4c830ef7 100644 --- a/crates/bevy_internal/src/lib.rs +++ b/crates/bevy_internal/src/lib.rs @@ -37,6 +37,8 @@ pub use bevy_gizmos as gizmos; #[cfg(feature = "bevy_gltf")] pub use bevy_gltf as gltf; pub use bevy_hierarchy as hierarchy; +#[cfg(feature = "bevy_image")] +pub use bevy_image as image; pub use bevy_input as input; pub use bevy_log as log; pub use bevy_math as math; diff --git a/crates/bevy_internal/src/prelude.rs b/crates/bevy_internal/src/prelude.rs index bec80694fd490..6d8830eb4d844 100644 --- a/crates/bevy_internal/src/prelude.rs +++ b/crates/bevy_internal/src/prelude.rs @@ -6,6 +6,10 @@ pub use crate::{ MinimalPlugins, }; +#[doc(hidden)] +#[cfg(feature = "bevy_image")] +pub use crate::image::prelude::*; + pub use bevy_derive::{bevy_main, Deref, DerefMut}; #[doc(hidden)] diff --git a/crates/bevy_pbr/Cargo.toml b/crates/bevy_pbr/Cargo.toml index 952d43e2fceab..d137167702a01 100644 --- a/crates/bevy_pbr/Cargo.toml +++ b/crates/bevy_pbr/Cargo.toml @@ -37,6 +37,7 @@ bevy_color = { path = "../bevy_color", version = "0.15.0-rc.3" } bevy_core_pipeline = { path = "../bevy_core_pipeline", version = "0.15.0-rc.3" } bevy_derive = { path = "../bevy_derive", version = "0.15.0-rc.3" } bevy_ecs = { path = "../bevy_ecs", version = "0.15.0-rc.3" } +bevy_image = { path = "../bevy_image", version = "0.15.0-rc.3" } bevy_math = { path = "../bevy_math", version = "0.15.0-rc.3" } bevy_reflect = { path = "../bevy_reflect", version = "0.15.0-rc.3", features = [ "bevy", diff --git a/crates/bevy_pbr/src/deferred/mod.rs b/crates/bevy_pbr/src/deferred/mod.rs index 243183e9d020d..67271a916f400 100644 --- a/crates/bevy_pbr/src/deferred/mod.rs +++ b/crates/bevy_pbr/src/deferred/mod.rs @@ -5,6 +5,9 @@ use crate::{ ViewScreenSpaceReflectionsUniformOffset, TONEMAPPING_LUT_SAMPLER_BINDING_INDEX, TONEMAPPING_LUT_TEXTURE_BINDING_INDEX, }; +use crate::{ + MeshPipelineKey, ShadowFilteringMethod, ViewFogUniformOffset, ViewLightsUniformOffset, +}; use bevy_app::prelude::*; use bevy_asset::{load_internal_asset, Handle}; use bevy_core_pipeline::{ @@ -16,6 +19,7 @@ use bevy_core_pipeline::{ tonemapping::{DebandDither, Tonemapping}, }; use bevy_ecs::{prelude::*, query::QueryItem}; +use bevy_image::BevyDefault as _; use bevy_render::{ extract_component::{ ComponentUniforms, ExtractComponent, ExtractComponentPlugin, UniformComponentPlugin, @@ -23,15 +27,10 @@ use bevy_render::{ render_graph::{NodeRunError, RenderGraphApp, RenderGraphContext, ViewNode, ViewNodeRunner}, render_resource::{binding_types::uniform_buffer, *}, renderer::{RenderContext, RenderDevice}, - texture::BevyDefault, view::{ExtractedView, ViewTarget, ViewUniformOffset}, Render, RenderApp, RenderSet, }; -use crate::{ - MeshPipelineKey, ShadowFilteringMethod, ViewFogUniformOffset, ViewLightsUniformOffset, -}; - pub struct DeferredPbrLightingPlugin; pub const DEFERRED_LIGHTING_SHADER_HANDLE: Handle = diff --git a/crates/bevy_pbr/src/lib.rs b/crates/bevy_pbr/src/lib.rs index 559fa99dcc2bf..7526f384e2fe5 100644 --- a/crates/bevy_pbr/src/lib.rs +++ b/crates/bevy_pbr/src/lib.rs @@ -116,6 +116,7 @@ use bevy_app::prelude::*; use bevy_asset::{load_internal_asset, AssetApp, Assets, Handle}; use bevy_core_pipeline::core_3d::graph::{Core3d, Node3d}; use bevy_ecs::prelude::*; +use bevy_image::Image; use bevy_render::{ alpha::AlphaMode, camera::{ @@ -128,10 +129,11 @@ use bevy_render::{ render_graph::RenderGraph, render_resource::Shader, sync_component::SyncComponentPlugin, - texture::{GpuImage, Image}, + texture::GpuImage, view::{check_visibility, VisibilitySystems}, ExtractSchedule, Render, RenderApp, RenderSet, }; + use bevy_transform::TransformSystem; pub const PBR_TYPES_SHADER_HANDLE: Handle = Handle::weak_from_u128(1708015359337029744); diff --git a/crates/bevy_pbr/src/light_probe/environment_map.rs b/crates/bevy_pbr/src/light_probe/environment_map.rs index 4fff505427642..6b47c9915a836 100644 --- a/crates/bevy_pbr/src/light_probe/environment_map.rs +++ b/crates/bevy_pbr/src/light_probe/environment_map.rs @@ -51,6 +51,7 @@ use bevy_ecs::{ bundle::Bundle, component::Component, query::QueryItem, reflect::ReflectComponent, system::lifetimeless::Read, }; +use bevy_image::Image; use bevy_math::Quat; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_render::{ @@ -63,7 +64,7 @@ use bevy_render::{ TextureSampleType, TextureView, }, renderer::RenderDevice, - texture::{FallbackImage, GpuImage, Image}, + texture::{FallbackImage, GpuImage}, }; use core::{num::NonZero, ops::Deref}; diff --git a/crates/bevy_pbr/src/light_probe/irradiance_volume.rs b/crates/bevy_pbr/src/light_probe/irradiance_volume.rs index f43d84d4e7c39..bc8fc542fb32d 100644 --- a/crates/bevy_pbr/src/light_probe/irradiance_volume.rs +++ b/crates/bevy_pbr/src/light_probe/irradiance_volume.rs @@ -133,6 +133,7 @@ //! [Why ambient cubes?]: #why-ambient-cubes use bevy_ecs::{component::Component, reflect::ReflectComponent}; +use bevy_image::Image; use bevy_render::{ render_asset::RenderAssets, render_resource::{ @@ -140,7 +141,7 @@ use bevy_render::{ TextureSampleType, TextureView, }, renderer::RenderDevice, - texture::{FallbackImage, GpuImage, Image}, + texture::{FallbackImage, GpuImage}, }; use core::{num::NonZero, ops::Deref}; diff --git a/crates/bevy_pbr/src/light_probe/mod.rs b/crates/bevy_pbr/src/light_probe/mod.rs index 0cda05f055eae..cab462c2801bf 100644 --- a/crates/bevy_pbr/src/light_probe/mod.rs +++ b/crates/bevy_pbr/src/light_probe/mod.rs @@ -12,6 +12,7 @@ use bevy_ecs::{ schedule::IntoSystemConfigs, system::{Commands, Local, Query, Res, ResMut, Resource}, }; +use bevy_image::Image; use bevy_math::{Affine3A, FloatOrd, Mat4, Vec3A, Vec4}; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_render::{ @@ -22,7 +23,7 @@ use bevy_render::{ renderer::{RenderDevice, RenderQueue}, settings::WgpuFeatures, sync_world::RenderEntity, - texture::{FallbackImage, GpuImage, Image}, + texture::{FallbackImage, GpuImage}, view::{ExtractedView, Visibility}, Extract, ExtractSchedule, Render, RenderApp, RenderSet, }; diff --git a/crates/bevy_pbr/src/lightmap/mod.rs b/crates/bevy_pbr/src/lightmap/mod.rs index 982f7214a8c81..0e0debc92e3f3 100644 --- a/crates/bevy_pbr/src/lightmap/mod.rs +++ b/crates/bevy_pbr/src/lightmap/mod.rs @@ -39,6 +39,7 @@ use bevy_ecs::{ schedule::IntoSystemConfigs, system::{Query, Res, ResMut, Resource}, }; +use bevy_image::Image; use bevy_math::{uvec2, vec4, Rect, UVec2}; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_render::sync_world::MainEntityHashMap; @@ -46,7 +47,7 @@ use bevy_render::{ mesh::{Mesh, RenderMesh}, render_asset::RenderAssets, render_resource::Shader, - texture::{GpuImage, Image}, + texture::GpuImage, view::ViewVisibility, Extract, ExtractSchedule, RenderApp, }; diff --git a/crates/bevy_pbr/src/material.rs b/crates/bevy_pbr/src/material.rs index 916b5a4676476..65d935226e7ab 100644 --- a/crates/bevy_pbr/src/material.rs +++ b/crates/bevy_pbr/src/material.rs @@ -60,8 +60,9 @@ use core::{ /// ``` /// # use bevy_pbr::{Material, MeshMaterial3d}; /// # use bevy_ecs::prelude::*; +/// # use bevy_image::Image; /// # use bevy_reflect::TypePath; -/// # use bevy_render::{mesh::{Mesh, Mesh3d}, render_resource::{AsBindGroup, ShaderRef}, texture::Image}; +/// # use bevy_render::{mesh::{Mesh, Mesh3d}, render_resource::{AsBindGroup, ShaderRef}}; /// # use bevy_color::LinearRgba; /// # use bevy_color::palettes::basic::RED; /// # use bevy_asset::{Handle, AssetServer, Assets, Asset}; diff --git a/crates/bevy_pbr/src/render/mesh.rs b/crates/bevy_pbr/src/render/mesh.rs index db9c03180166b..06a1de09e2a6b 100644 --- a/crates/bevy_pbr/src/render/mesh.rs +++ b/crates/bevy_pbr/src/render/mesh.rs @@ -14,6 +14,7 @@ use bevy_ecs::{ query::ROQueryItem, system::{lifetimeless::*, SystemParamItem, SystemState}, }; +use bevy_image::{BevyDefault, ImageSampler, TextureFormatPixelInfo}; use bevy_math::{Affine3, Rect, UVec2, Vec3, Vec4}; use bevy_render::{ batching::{ @@ -32,7 +33,7 @@ use bevy_render::{ }, render_resource::*, renderer::{RenderDevice, RenderQueue}, - texture::{BevyDefault, DefaultImageSampler, ImageSampler, TextureFormatPixelInfo}, + texture::DefaultImageSampler, view::{ prepare_view_targets, GpuCulling, RenderVisibilityRanges, ViewTarget, ViewUniformOffset, ViewVisibility, VisibilityRange, diff --git a/crates/bevy_pbr/src/render/mesh_view_bindings.rs b/crates/bevy_pbr/src/render/mesh_view_bindings.rs index 159a87bd1c25b..bbf158564d43b 100644 --- a/crates/bevy_pbr/src/render/mesh_view_bindings.rs +++ b/crates/bevy_pbr/src/render/mesh_view_bindings.rs @@ -15,13 +15,14 @@ use bevy_ecs::{ system::{Commands, Query, Res, Resource}, world::{FromWorld, World}, }; +use bevy_image::BevyDefault as _; use bevy_math::Vec4; use bevy_render::{ globals::{GlobalsBuffer, GlobalsUniform}, render_asset::RenderAssets, render_resource::{binding_types::*, *}, renderer::RenderDevice, - texture::{BevyDefault, FallbackImage, FallbackImageMsaa, FallbackImageZero, GpuImage}, + texture::{FallbackImage, FallbackImageMsaa, FallbackImageZero, GpuImage}, view::{ Msaa, RenderVisibilityRanges, ViewUniform, ViewUniforms, VISIBILITY_RANGES_STORAGE_BUFFER_COUNT, diff --git a/crates/bevy_pbr/src/ssr/mod.rs b/crates/bevy_pbr/src/ssr/mod.rs index 26fcb27802314..935e5f5b8f22e 100644 --- a/crates/bevy_pbr/src/ssr/mod.rs +++ b/crates/bevy_pbr/src/ssr/mod.rs @@ -23,6 +23,7 @@ use bevy_ecs::{ system::{lifetimeless::Read, Commands, Query, Res, ResMut, Resource}, world::{FromWorld, World}, }; +use bevy_image::BevyDefault as _; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_render::{ extract_component::{ExtractComponent, ExtractComponentPlugin}, @@ -36,7 +37,6 @@ use bevy_render::{ TextureFormat, TextureSampleType, }, renderer::{RenderContext, RenderDevice, RenderQueue}, - texture::BevyDefault as _, view::{ExtractedView, Msaa, ViewTarget, ViewUniformOffset}, Render, RenderApp, RenderSet, }; diff --git a/crates/bevy_pbr/src/volumetric_fog/mod.rs b/crates/bevy_pbr/src/volumetric_fog/mod.rs index 7a94a1e135797..529127649529c 100644 --- a/crates/bevy_pbr/src/volumetric_fog/mod.rs +++ b/crates/bevy_pbr/src/volumetric_fog/mod.rs @@ -42,6 +42,7 @@ use bevy_ecs::{ bundle::Bundle, component::Component, reflect::ReflectComponent, schedule::IntoSystemConfigs as _, }; +use bevy_image::Image; use bevy_math::{ primitives::{Cuboid, Plane3d}, Vec2, Vec3, @@ -52,7 +53,6 @@ use bevy_render::{ render_graph::{RenderGraphApp, ViewNodeRunner}, render_resource::{Shader, SpecializedRenderPipelines}, sync_component::SyncComponentPlugin, - texture::Image, view::{InheritedVisibility, ViewVisibility, Visibility}, ExtractSchedule, Render, RenderApp, RenderSet, }; diff --git a/crates/bevy_pbr/src/volumetric_fog/render.rs b/crates/bevy_pbr/src/volumetric_fog/render.rs index a18d206c5dd40..76039bbbe448b 100644 --- a/crates/bevy_pbr/src/volumetric_fog/render.rs +++ b/crates/bevy_pbr/src/volumetric_fog/render.rs @@ -16,6 +16,7 @@ use bevy_ecs::{ system::{lifetimeless::Read, Commands, Local, Query, Res, ResMut, Resource}, world::{FromWorld, World}, }; +use bevy_image::{BevyDefault, Image}; use bevy_math::{vec4, Mat3A, Mat4, Vec3, Vec3A, Vec4, Vec4Swizzles as _}; use bevy_render::{ mesh::{ @@ -37,7 +38,7 @@ use bevy_render::{ }, renderer::{RenderContext, RenderDevice, RenderQueue}, sync_world::RenderEntity, - texture::{BevyDefault as _, GpuImage, Image}, + texture::GpuImage, view::{ExtractedView, Msaa, ViewDepthTexture, ViewTarget, ViewUniformOffset}, Extract, }; diff --git a/crates/bevy_render/macros/src/as_bind_group.rs b/crates/bevy_render/macros/src/as_bind_group.rs index d0edd18dd633c..8f871bd0e00c6 100644 --- a/crates/bevy_render/macros/src/as_bind_group.rs +++ b/crates/bevy_render/macros/src/as_bind_group.rs @@ -41,6 +41,7 @@ enum BindingState<'a> { pub fn derive_as_bind_group(ast: syn::DeriveInput) -> Result { let manifest = BevyManifest::default(); let render_path = manifest.get_path("bevy_render"); + let image_path = manifest.get_path("bevy_image"); let asset_path = manifest.get_path("bevy_asset"); let ecs_path = manifest.get_path("bevy_ecs"); @@ -264,7 +265,7 @@ pub fn derive_as_bind_group(ast: syn::DeriveInput) -> Result { binding_impls.insert(0, quote! { ( #binding_index, #render_path::render_resource::OwnedBindingResource::TextureView({ - let handle: Option<&#asset_path::Handle<#render_path::texture::Image>> = (&self.#field_name).into(); + let handle: Option<&#asset_path::Handle<#image_path::Image>> = (&self.#field_name).into(); if let Some(handle) = handle { images.get(handle).ok_or_else(|| #render_path::render_resource::AsBindGroupError::RetryNextUpdate)?.texture_view.clone() } else { @@ -305,7 +306,7 @@ pub fn derive_as_bind_group(ast: syn::DeriveInput) -> Result { ( #binding_index, #render_path::render_resource::OwnedBindingResource::TextureView({ - let handle: Option<&#asset_path::Handle<#render_path::texture::Image>> = (&self.#field_name).into(); + let handle: Option<&#asset_path::Handle<#image_path::Image>> = (&self.#field_name).into(); if let Some(handle) = handle { images.get(handle).ok_or_else(|| #render_path::render_resource::AsBindGroupError::RetryNextUpdate)?.texture_view.clone() } else { @@ -362,7 +363,7 @@ pub fn derive_as_bind_group(ast: syn::DeriveInput) -> Result { ( #binding_index, #render_path::render_resource::OwnedBindingResource::Sampler({ - let handle: Option<&#asset_path::Handle<#render_path::texture::Image>> = (&self.#field_name).into(); + let handle: Option<&#asset_path::Handle<#image_path::Image>> = (&self.#field_name).into(); if let Some(handle) = handle { let image = images.get(handle).ok_or_else(|| #render_path::render_resource::AsBindGroupError::RetryNextUpdate)?; diff --git a/crates/bevy_render/src/camera/camera.rs b/crates/bevy_render/src/camera/camera.rs index f00ebb5e9d5f3..7e7036d1e8261 100644 --- a/crates/bevy_render/src/camera/camera.rs +++ b/crates/bevy_render/src/camera/camera.rs @@ -4,7 +4,6 @@ use crate::view::RenderVisibleEntities; use crate::{ batching::gpu_preprocessing::GpuPreprocessingSupport, camera::{CameraProjection, ManualTextureViewHandle, ManualTextureViews}, - prelude::Image, primitives::Frustum, render_asset::RenderAssets, render_graph::{InternedRenderSubGraph, RenderSubGraph}, @@ -30,6 +29,7 @@ use bevy_ecs::{ system::{Commands, Query, Res, ResMut, Resource}, world::DeferredWorld, }; +use bevy_image::Image; use bevy_math::{ops, vec2, Dir3, Mat4, Ray3d, Rect, URect, UVec2, UVec4, Vec2, Vec3}; use bevy_reflect::prelude::*; use bevy_render_macros::ExtractComponent; diff --git a/crates/bevy_render/src/camera/manual_texture_view.rs b/crates/bevy_render/src/camera/manual_texture_view.rs index a1353b9d0f9c9..11d82364a611a 100644 --- a/crates/bevy_render/src/camera/manual_texture_view.rs +++ b/crates/bevy_render/src/camera/manual_texture_view.rs @@ -1,7 +1,6 @@ -use crate::{ - extract_resource::ExtractResource, render_resource::TextureView, texture::BevyDefault, -}; +use crate::{extract_resource::ExtractResource, render_resource::TextureView}; use bevy_ecs::{prelude::Component, reflect::ReflectComponent, system::Resource}; +use bevy_image::BevyDefault as _; use bevy_math::UVec2; use bevy_reflect::prelude::*; use bevy_utils::HashMap; diff --git a/crates/bevy_render/src/gpu_readback.rs b/crates/bevy_render/src/gpu_readback.rs index 434b4603cac7c..bb0092edf15bf 100644 --- a/crates/bevy_render/src/gpu_readback.rs +++ b/crates/bevy_render/src/gpu_readback.rs @@ -1,12 +1,11 @@ use crate::{ extract_component::ExtractComponentPlugin, - prelude::Image, render_asset::RenderAssets, render_resource::{Buffer, BufferUsages, Extent3d, ImageDataLayout, Texture, TextureFormat}, renderer::{render_system, RenderDevice}, storage::{GpuShaderStorageBuffer, ShaderStorageBuffer}, sync_world::MainEntity, - texture::{GpuImage, TextureFormatPixelInfo}, + texture::GpuImage, ExtractSchedule, MainWorld, Render, RenderApp, RenderSet, }; use async_channel::{Receiver, Sender}; @@ -21,6 +20,7 @@ use bevy_ecs::{ prelude::{Component, Resource, World}, system::{Query, Res}, }; +use bevy_image::{Image, TextureFormatPixelInfo}; use bevy_reflect::Reflect; use bevy_render_macros::ExtractComponent; use bevy_utils::{default, tracing::warn, HashMap}; diff --git a/crates/bevy_render/src/lib.rs b/crates/bevy_render/src/lib.rs index a682f2b954413..c220470e48635 100644 --- a/crates/bevy_render/src/lib.rs +++ b/crates/bevy_render/src/lib.rs @@ -61,12 +61,11 @@ pub mod prelude { }, render_resource::Shader, spatial_bundle::SpatialBundle, - texture::{Image, ImagePlugin, IntoDynamicImageError}, + texture::ImagePlugin, view::{InheritedVisibility, Msaa, ViewVisibility, Visibility, VisibilityBundle}, ExtractSchedule, }; } - use batching::gpu_preprocessing::BatchingPlugin; use bevy_ecs::schedule::ScheduleBuildSettings; use bevy_utils::prelude::default; diff --git a/crates/bevy_render/src/render_resource/bind_group.rs b/crates/bevy_render/src/render_resource/bind_group.rs index 73e25794066b8..2753616aa0a4a 100644 --- a/crates/bevy_render/src/render_resource/bind_group.rs +++ b/crates/bevy_render/src/render_resource/bind_group.rs @@ -78,7 +78,7 @@ impl Deref for BindGroup { /// ok to do "expensive" work here, such as creating a [`Buffer`] for a uniform. /// /// If for some reason a [`BindGroup`] cannot be created yet (for example, the [`Texture`](crate::render_resource::Texture) -/// for an [`Image`](crate::texture::Image) hasn't loaded yet), just return [`AsBindGroupError::RetryNextUpdate`], which signals that the caller +/// for an [`Image`](bevy_image::Image) hasn't loaded yet), just return [`AsBindGroupError::RetryNextUpdate`], which signals that the caller /// should retry again later. /// /// # Deriving @@ -87,7 +87,8 @@ impl Deref for BindGroup { /// what their binding type is, and what index they should be bound at: /// /// ``` -/// # use bevy_render::{render_resource::*, texture::Image}; +/// # use bevy_render::render_resource::*; +/// # use bevy_image::Image; /// # use bevy_color::LinearRgba; /// # use bevy_asset::Handle; /// # use bevy_render::storage::ShaderStorageBuffer; @@ -133,7 +134,7 @@ impl Deref for BindGroup { /// GPU resource, which will be bound as a texture in shaders. The field will be assumed to implement [`Into>>`]. In practice, /// most fields should be a [`Handle`](bevy_asset::Handle) or [`Option>`]. If the value of an [`Option>`] is /// [`None`], the [`crate::texture::FallbackImage`] resource will be used instead. This attribute can be used in conjunction with a `sampler` binding attribute -/// (with a different binding index) if a binding of the sampler for the [`Image`](crate::texture::Image) is also required. +/// (with a different binding index) if a binding of the sampler for the [`Image`](bevy_image::Image) is also required. /// /// | Arguments | Values | Default | /// |-----------------------|-------------------------------------------------------------------------|----------------------| @@ -161,7 +162,7 @@ impl Deref for BindGroup { /// resource, which will be bound as a sampler in shaders. The field will be assumed to implement [`Into>>`]. In practice, /// most fields should be a [`Handle`](bevy_asset::Handle) or [`Option>`]. If the value of an [`Option>`] is /// [`None`], the [`crate::texture::FallbackImage`] resource will be used instead. This attribute can be used in conjunction with a `texture` binding attribute -/// (with a different binding index) if a binding of the texture for the [`Image`](crate::texture::Image) is also required. +/// (with a different binding index) if a binding of the texture for the [`Image`](bevy_image::Image) is also required. /// /// | Arguments | Values | Default | /// |------------------------|-------------------------------------------------------------------------|------------------------| @@ -194,9 +195,10 @@ impl Deref for BindGroup { /// /// As mentioned above, [`Option>`] is also supported: /// ``` -/// # use bevy_render::{render_resource::AsBindGroup, texture::Image}; -/// # use bevy_color::LinearRgba; /// # use bevy_asset::Handle; +/// # use bevy_color::LinearRgba; +/// # use bevy_image::Image; +/// # use bevy_render::render_resource::AsBindGroup; /// #[derive(AsBindGroup)] /// struct CoolMaterial { /// #[uniform(0)] @@ -433,8 +435,9 @@ where #[cfg(test)] mod test { use super::*; - use crate::{self as bevy_render, prelude::Image}; + use crate as bevy_render; use bevy_asset::Handle; + use bevy_image::Image; #[test] fn texture_visibility() { diff --git a/crates/bevy_render/src/texture/mod.rs b/crates/bevy_render/src/texture/mod.rs index 351a356be24a1..3671b7a0c83db 100644 --- a/crates/bevy_render/src/texture/mod.rs +++ b/crates/bevy_render/src/texture/mod.rs @@ -4,18 +4,11 @@ mod texture_attachment; mod texture_cache; pub use crate::render_resource::DefaultImageSampler; -#[cfg(feature = "exr")] -pub use bevy_image::ExrTextureLoader; -#[cfg(feature = "hdr")] -pub use bevy_image::HdrTextureLoader; -pub use bevy_image::{ - BevyDefault, CompressedImageFormats, FileTextureError, Image, ImageAddressMode, - ImageFilterMode, ImageFormat, ImageFormatSetting, ImageLoader, ImageLoaderError, - ImageLoaderSettings, ImageSampler, ImageSamplerDescriptor, ImageType, IntoDynamicImageError, - TextureError, TextureFormatPixelInfo, -}; #[cfg(feature = "basis-universal")] -pub use bevy_image::{CompressedImageSaver, CompressedImageSaverError}; +use bevy_image::CompressedImageSaver; +#[cfg(feature = "hdr")] +use bevy_image::HdrTextureLoader; +use bevy_image::{CompressedImageFormats, Image, ImageLoader, ImageSamplerDescriptor}; pub use fallback_image::*; pub use gpu_image::*; pub use texture_attachment::*; @@ -39,7 +32,7 @@ pub const TRANSPARENT_IMAGE_HANDLE: Handle = // TODO: replace Texture names with Image names? /// Adds the [`Image`] as an asset and makes sure that they are extracted and prepared for the GPU. pub struct ImagePlugin { - /// The default image sampler to use when [`ImageSampler`] is set to `Default`. + /// The default image sampler to use when [`bevy_image::ImageSampler`] is set to `Default`. pub default_sampler: ImageSamplerDescriptor, } @@ -69,7 +62,7 @@ impl Plugin for ImagePlugin { fn build(&self, app: &mut App) { #[cfg(feature = "exr")] { - app.init_asset_loader::(); + app.init_asset_loader::(); } #[cfg(feature = "hdr")] diff --git a/crates/bevy_render/src/view/mod.rs b/crates/bevy_render/src/view/mod.rs index 2e306d610f369..572a1db7b81cf 100644 --- a/crates/bevy_render/src/view/mod.rs +++ b/crates/bevy_render/src/view/mod.rs @@ -18,8 +18,8 @@ use crate::{ render_resource::{DynamicUniformBuffer, ShaderType, Texture, TextureView}, renderer::{RenderDevice, RenderQueue}, texture::{ - BevyDefault, CachedTexture, ColorAttachment, DepthAttachment, GpuImage, - OutputColorAttachment, TextureCache, + CachedTexture, ColorAttachment, DepthAttachment, GpuImage, OutputColorAttachment, + TextureCache, }, Render, RenderApp, RenderSet, }; @@ -28,6 +28,7 @@ use bevy_app::{App, Plugin}; use bevy_color::LinearRgba; use bevy_derive::{Deref, DerefMut}; use bevy_ecs::prelude::*; +use bevy_image::BevyDefault as _; use bevy_math::{mat3, vec2, vec3, Mat3, Mat4, UVec4, Vec2, Vec3, Vec4, Vec4Swizzles}; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_render_macros::ExtractComponent; diff --git a/crates/bevy_render/src/view/window/screenshot.rs b/crates/bevy_render/src/view/window/screenshot.rs index 6303456bd8b4b..ad03ca0920937 100644 --- a/crates/bevy_render/src/view/window/screenshot.rs +++ b/crates/bevy_render/src/view/window/screenshot.rs @@ -2,7 +2,7 @@ use super::ExtractedWindows; use crate::{ camera::{ManualTextureViewHandle, ManualTextureViews, NormalizedRenderTarget, RenderTarget}, gpu_readback, - prelude::{Image, Shader}, + prelude::Shader, render_asset::{RenderAssetUsages, RenderAssets}, render_resource::{ binding_types::texture_2d, BindGroup, BindGroupEntries, BindGroupLayout, @@ -11,7 +11,7 @@ use crate::{ SpecializedRenderPipelines, Texture, TextureUsages, TextureView, VertexState, }, renderer::RenderDevice, - texture::{GpuImage, OutputColorAttachment, TextureFormatPixelInfo}, + texture::{GpuImage, OutputColorAttachment}, view::{prepare_view_attachments, prepare_view_targets, ViewTargetAttachments, WindowSurfaces}, ExtractSchedule, MainWorld, Render, RenderApp, RenderSet, }; @@ -23,6 +23,7 @@ use bevy_ecs::{ entity::EntityHashMap, event::event_update_system, prelude::*, system::SystemState, }; use bevy_hierarchy::DespawnRecursiveExt; +use bevy_image::{Image, TextureFormatPixelInfo}; use bevy_reflect::Reflect; use bevy_tasks::AsyncComputeTaskPool; use bevy_utils::{ diff --git a/crates/bevy_sprite/Cargo.toml b/crates/bevy_sprite/Cargo.toml index 9b830b4f92597..e53d5c6aaff6d 100644 --- a/crates/bevy_sprite/Cargo.toml +++ b/crates/bevy_sprite/Cargo.toml @@ -22,6 +22,7 @@ bevy_asset = { path = "../bevy_asset", version = "0.15.0-rc.3" } bevy_color = { path = "../bevy_color", version = "0.15.0-rc.3" } bevy_core_pipeline = { path = "../bevy_core_pipeline", version = "0.15.0-rc.3" } bevy_ecs = { path = "../bevy_ecs", version = "0.15.0-rc.3" } +bevy_image = { path = "../bevy_image", version = "0.15.0-rc.3" } bevy_math = { path = "../bevy_math", version = "0.15.0-rc.3" } bevy_picking = { path = "../bevy_picking", version = "0.15.0-rc.3", optional = true } bevy_reflect = { path = "../bevy_reflect", version = "0.15.0-rc.3", features = [ diff --git a/crates/bevy_sprite/src/dynamic_texture_atlas_builder.rs b/crates/bevy_sprite/src/dynamic_texture_atlas_builder.rs index 879a9af3a497a..4c53e321ae4a7 100644 --- a/crates/bevy_sprite/src/dynamic_texture_atlas_builder.rs +++ b/crates/bevy_sprite/src/dynamic_texture_atlas_builder.rs @@ -1,8 +1,9 @@ use crate::TextureAtlasLayout; +use bevy_image::{Image, TextureFormatPixelInfo}; use bevy_math::{URect, UVec2}; use bevy_render::{ render_asset::{RenderAsset, RenderAssetUsages}, - texture::{GpuImage, Image, TextureFormatPixelInfo}, + texture::GpuImage, }; use guillotiere::{size2, Allocation, AtlasAllocator}; diff --git a/crates/bevy_sprite/src/lib.rs b/crates/bevy_sprite/src/lib.rs index 265be52209a1e..8ea962eec291c 100644 --- a/crates/bevy_sprite/src/lib.rs +++ b/crates/bevy_sprite/src/lib.rs @@ -51,13 +51,13 @@ use bevy_app::prelude::*; use bevy_asset::{load_internal_asset, AssetApp, Assets, Handle}; use bevy_core_pipeline::core_2d::Transparent2d; use bevy_ecs::{prelude::*, query::QueryItem}; +use bevy_image::Image; use bevy_render::{ extract_component::{ExtractComponent, ExtractComponentPlugin}, mesh::{Mesh, Mesh2d, MeshAabb}, primitives::Aabb, render_phase::AddRenderCommand, render_resource::{Shader, SpecializedRenderPipelines}, - texture::Image, view::{check_visibility, NoFrustumCulling, VisibilitySystems}, ExtractSchedule, Render, RenderApp, RenderSet, }; diff --git a/crates/bevy_sprite/src/mesh2d/color_material.rs b/crates/bevy_sprite/src/mesh2d/color_material.rs index 3b4ce7641627a..8c3267c40ba4d 100644 --- a/crates/bevy_sprite/src/mesh2d/color_material.rs +++ b/crates/bevy_sprite/src/mesh2d/color_material.rs @@ -4,13 +4,10 @@ use crate::{AlphaMode2d, Material2d, Material2dPlugin, MaterialMesh2dBundle}; use bevy_app::{App, Plugin}; use bevy_asset::{load_internal_asset, Asset, AssetApp, Assets, Handle}; use bevy_color::{Alpha, Color, ColorToComponents, LinearRgba}; +use bevy_image::Image; use bevy_math::Vec4; use bevy_reflect::prelude::*; -use bevy_render::{ - render_asset::RenderAssets, - render_resource::*, - texture::{GpuImage, Image}, -}; +use bevy_render::{render_asset::RenderAssets, render_resource::*, texture::GpuImage}; pub const COLOR_MATERIAL_SHADER_HANDLE: Handle = Handle::weak_from_u128(3253086872234592509); diff --git a/crates/bevy_sprite/src/mesh2d/material.rs b/crates/bevy_sprite/src/mesh2d/material.rs index cfef74be398f3..4eb064de206b4 100644 --- a/crates/bevy_sprite/src/mesh2d/material.rs +++ b/crates/bevy_sprite/src/mesh2d/material.rs @@ -58,8 +58,9 @@ use derive_more::derive::From; /// ``` /// # use bevy_sprite::{Material2d, MeshMaterial2d}; /// # use bevy_ecs::prelude::*; +/// # use bevy_image::Image; /// # use bevy_reflect::TypePath; -/// # use bevy_render::{mesh::{Mesh, Mesh2d}, render_resource::{AsBindGroup, ShaderRef}, texture::Image}; +/// # use bevy_render::{mesh::{Mesh, Mesh2d}, render_resource::{AsBindGroup, ShaderRef}}; /// # use bevy_color::LinearRgba; /// # use bevy_color::palettes::basic::RED; /// # use bevy_asset::{Handle, AssetServer, Assets, Asset}; diff --git a/crates/bevy_sprite/src/mesh2d/mesh.rs b/crates/bevy_sprite/src/mesh2d/mesh.rs index 85e057f639e1a..bc67c75aa5466 100644 --- a/crates/bevy_sprite/src/mesh2d/mesh.rs +++ b/crates/bevy_sprite/src/mesh2d/mesh.rs @@ -14,8 +14,8 @@ use bevy_ecs::{ query::ROQueryItem, system::{lifetimeless::*, SystemParamItem, SystemState}, }; +use bevy_image::{BevyDefault, Image, ImageSampler, TextureFormatPixelInfo}; use bevy_math::{Affine3, Vec4}; -use bevy_render::sync_world::{MainEntity, MainEntityHashMap}; use bevy_render::{ batching::{ gpu_preprocessing::IndirectParameters, @@ -34,10 +34,8 @@ use bevy_render::{ render_phase::{PhaseItem, RenderCommand, RenderCommandResult, TrackedRenderPass}, render_resource::{binding_types::uniform_buffer, *}, renderer::{RenderDevice, RenderQueue}, - texture::{ - BevyDefault, DefaultImageSampler, FallbackImage, GpuImage, Image, ImageSampler, - TextureFormatPixelInfo, - }, + sync_world::{MainEntity, MainEntityHashMap}, + texture::{DefaultImageSampler, FallbackImage, GpuImage}, view::{ ExtractedView, ViewTarget, ViewUniform, ViewUniformOffset, ViewUniforms, ViewVisibility, }, diff --git a/crates/bevy_sprite/src/picking_backend.rs b/crates/bevy_sprite/src/picking_backend.rs index 55c06a8ec9ac3..ad2afc33d1954 100644 --- a/crates/bevy_sprite/src/picking_backend.rs +++ b/crates/bevy_sprite/src/picking_backend.rs @@ -8,6 +8,7 @@ use crate::{Sprite, TextureAtlasLayout}; use bevy_app::prelude::*; use bevy_asset::prelude::*; use bevy_ecs::prelude::*; +use bevy_image::Image; use bevy_math::{prelude::*, FloatExt, FloatOrd}; use bevy_picking::backend::prelude::*; use bevy_render::prelude::*; diff --git a/crates/bevy_sprite/src/render/mod.rs b/crates/bevy_sprite/src/render/mod.rs index 98c38a7130731..9ef692452fcc9 100644 --- a/crates/bevy_sprite/src/render/mod.rs +++ b/crates/bevy_sprite/src/render/mod.rs @@ -18,6 +18,7 @@ use bevy_ecs::{ query::ROQueryItem, system::{lifetimeless::*, SystemParamItem, SystemState}, }; +use bevy_image::{BevyDefault, Image, ImageSampler, TextureFormatPixelInfo}; use bevy_math::{Affine3A, FloatOrd, Quat, Rect, Vec2, Vec4}; use bevy_render::sync_world::MainEntity; use bevy_render::view::RenderVisibleEntities; @@ -33,10 +34,7 @@ use bevy_render::{ }, renderer::{RenderDevice, RenderQueue}, sync_world::{RenderEntity, TemporaryRenderEntity}, - texture::{ - BevyDefault, DefaultImageSampler, FallbackImage, GpuImage, Image, ImageSampler, - TextureFormatPixelInfo, - }, + texture::{DefaultImageSampler, FallbackImage, GpuImage}, view::{ ExtractedView, Msaa, ViewTarget, ViewUniform, ViewUniformOffset, ViewUniforms, ViewVisibility, diff --git a/crates/bevy_sprite/src/sprite.rs b/crates/bevy_sprite/src/sprite.rs index 88faf4af100f5..f6b8b266d57ea 100644 --- a/crates/bevy_sprite/src/sprite.rs +++ b/crates/bevy_sprite/src/sprite.rs @@ -1,9 +1,10 @@ use bevy_asset::Handle; use bevy_color::Color; use bevy_ecs::{component::Component, reflect::ReflectComponent}; +use bevy_image::Image; use bevy_math::{Rect, Vec2}; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; -use bevy_render::{sync_world::SyncToRenderWorld, texture::Image, view::Visibility}; +use bevy_render::{sync_world::SyncToRenderWorld, view::Visibility}; use bevy_transform::components::Transform; use crate::{TextureAtlas, TextureSlicer}; diff --git a/crates/bevy_sprite/src/texture_atlas.rs b/crates/bevy_sprite/src/texture_atlas.rs index a4d82b2ca1874..797fb4aa206ff 100644 --- a/crates/bevy_sprite/src/texture_atlas.rs +++ b/crates/bevy_sprite/src/texture_atlas.rs @@ -1,9 +1,9 @@ use bevy_asset::{Asset, AssetId, Assets, Handle}; +use bevy_image::Image; use bevy_math::{URect, UVec2}; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; #[cfg(feature = "serialize")] use bevy_reflect::{ReflectDeserialize, ReflectSerialize}; -use bevy_render::texture::Image; use bevy_utils::HashMap; /// Stores a mapping from sub texture handles to the related area index. diff --git a/crates/bevy_sprite/src/texture_atlas_builder.rs b/crates/bevy_sprite/src/texture_atlas_builder.rs index 2428fd4b15298..b59c9423b90e0 100644 --- a/crates/bevy_sprite/src/texture_atlas_builder.rs +++ b/crates/bevy_sprite/src/texture_atlas_builder.rs @@ -1,9 +1,9 @@ use bevy_asset::AssetId; +use bevy_image::{Image, TextureFormatPixelInfo}; use bevy_math::{URect, UVec2}; use bevy_render::{ render_asset::RenderAssetUsages, render_resource::{Extent3d, TextureDimension, TextureFormat}, - texture::{Image, TextureFormatPixelInfo}, }; use bevy_utils::{ tracing::{debug, error, warn}, @@ -179,6 +179,7 @@ impl<'a> TextureAtlasBuilder<'a> { /// # use bevy_ecs::prelude::*; /// # use bevy_asset::*; /// # use bevy_render::prelude::*; + /// # use bevy_image::Image; /// /// fn my_system(mut commands: Commands, mut textures: ResMut>, mut layouts: ResMut>) { /// // Declare your builder diff --git a/crates/bevy_sprite/src/texture_slice/computed_slices.rs b/crates/bevy_sprite/src/texture_slice/computed_slices.rs index 6e2d94198c9d8..490071a6005ed 100644 --- a/crates/bevy_sprite/src/texture_slice/computed_slices.rs +++ b/crates/bevy_sprite/src/texture_slice/computed_slices.rs @@ -3,8 +3,8 @@ use crate::{ExtractedSprite, Sprite, SpriteImageMode, TextureAtlasLayout}; use super::TextureSlice; use bevy_asset::{AssetEvent, Assets}; use bevy_ecs::prelude::*; +use bevy_image::Image; use bevy_math::{Rect, Vec2}; -use bevy_render::texture::Image; use bevy_transform::prelude::*; use bevy_utils::HashSet; diff --git a/crates/bevy_text/Cargo.toml b/crates/bevy_text/Cargo.toml index b1836dd5b4433..8edec011ac9f2 100644 --- a/crates/bevy_text/Cargo.toml +++ b/crates/bevy_text/Cargo.toml @@ -18,6 +18,7 @@ bevy_asset = { path = "../bevy_asset", version = "0.15.0-rc.3" } bevy_color = { path = "../bevy_color", version = "0.15.0-rc.3" } bevy_derive = { path = "../bevy_derive", version = "0.15.0-rc.3" } bevy_ecs = { path = "../bevy_ecs", version = "0.15.0-rc.3" } +bevy_image = { path = "../bevy_image", version = "0.15.0-rc.3" } bevy_hierarchy = { path = "../bevy_hierarchy", version = "0.15.0-rc.3" } bevy_math = { path = "../bevy_math", version = "0.15.0-rc.3" } bevy_reflect = { path = "../bevy_reflect", version = "0.15.0-rc.3", features = [ diff --git a/crates/bevy_text/src/font_atlas.rs b/crates/bevy_text/src/font_atlas.rs index 8f32dade935f1..4ce4ea62072db 100644 --- a/crates/bevy_text/src/font_atlas.rs +++ b/crates/bevy_text/src/font_atlas.rs @@ -1,9 +1,9 @@ use bevy_asset::{Assets, Handle}; +use bevy_image::{Image, ImageSampler}; use bevy_math::{IVec2, UVec2}; use bevy_render::{ render_asset::RenderAssetUsages, render_resource::{Extent3d, TextureDimension, TextureFormat}, - texture::{Image, ImageSampler}, }; use bevy_sprite::{DynamicTextureAtlasBuilder, TextureAtlasLayout}; use bevy_utils::HashMap; diff --git a/crates/bevy_text/src/font_atlas_set.rs b/crates/bevy_text/src/font_atlas_set.rs index 3be8cf74b7fe5..5547ea5fdbd83 100644 --- a/crates/bevy_text/src/font_atlas_set.rs +++ b/crates/bevy_text/src/font_atlas_set.rs @@ -3,12 +3,12 @@ use bevy_ecs::{ event::EventReader, system::{ResMut, Resource}, }; +use bevy_image::Image; use bevy_math::{IVec2, UVec2}; use bevy_reflect::TypePath; use bevy_render::{ render_asset::RenderAssetUsages, render_resource::{Extent3d, TextureDimension, TextureFormat}, - texture::Image, }; use bevy_sprite::TextureAtlasLayout; use bevy_utils::HashMap; diff --git a/crates/bevy_text/src/glyph.rs b/crates/bevy_text/src/glyph.rs index 4b264a8c8909c..b5295c655e76a 100644 --- a/crates/bevy_text/src/glyph.rs +++ b/crates/bevy_text/src/glyph.rs @@ -1,9 +1,9 @@ //! This module exports types related to rendering glyphs. use bevy_asset::Handle; +use bevy_image::Image; use bevy_math::{IVec2, Vec2}; use bevy_reflect::Reflect; -use bevy_render::texture::Image; use bevy_sprite::TextureAtlasLayout; /// A glyph of a font, typically representing a single character, positioned in screen space. diff --git a/crates/bevy_text/src/pipeline.rs b/crates/bevy_text/src/pipeline.rs index cf5fe2f90c2d9..92b5cd902e814 100644 --- a/crates/bevy_text/src/pipeline.rs +++ b/crates/bevy_text/src/pipeline.rs @@ -9,9 +9,9 @@ use bevy_ecs::{ reflect::ReflectComponent, system::{ResMut, Resource}, }; +use bevy_image::Image; use bevy_math::{UVec2, Vec2}; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; -use bevy_render::texture::Image; use bevy_sprite::TextureAtlasLayout; use bevy_utils::HashMap; diff --git a/crates/bevy_text/src/text2d.rs b/crates/bevy_text/src/text2d.rs index 509108cb501e2..36448baab7ad2 100644 --- a/crates/bevy_text/src/text2d.rs +++ b/crates/bevy_text/src/text2d.rs @@ -16,13 +16,13 @@ use bevy_ecs::{ query::{Changed, Without}, system::{Commands, Local, Query, Res, ResMut}, }; +use bevy_image::Image; use bevy_math::Vec2; use bevy_reflect::{prelude::ReflectDefault, Reflect}; use bevy_render::sync_world::TemporaryRenderEntity; use bevy_render::view::Visibility; use bevy_render::{ primitives::Aabb, - texture::Image, view::{NoFrustumCulling, ViewVisibility}, Extract, }; diff --git a/crates/bevy_ui/Cargo.toml b/crates/bevy_ui/Cargo.toml index 0316c8f94d138..f6e7f8928531d 100644 --- a/crates/bevy_ui/Cargo.toml +++ b/crates/bevy_ui/Cargo.toml @@ -18,6 +18,7 @@ bevy_core_pipeline = { path = "../bevy_core_pipeline", version = "0.15.0-rc.3" } bevy_derive = { path = "../bevy_derive", version = "0.15.0-rc.3" } bevy_ecs = { path = "../bevy_ecs", version = "0.15.0-rc.3" } bevy_hierarchy = { path = "../bevy_hierarchy", version = "0.15.0-rc.3" } +bevy_image = { path = "../bevy_image", version = "0.15.0-rc.3" } bevy_input = { path = "../bevy_input", version = "0.15.0-rc.3" } bevy_math = { path = "../bevy_math", version = "0.15.0-rc.3" } bevy_reflect = { path = "../bevy_reflect", version = "0.15.0-rc.3", features = [ diff --git a/crates/bevy_ui/src/layout/mod.rs b/crates/bevy_ui/src/layout/mod.rs index 5d163a34f1540..c4a5d63880e2d 100644 --- a/crates/bevy_ui/src/layout/mod.rs +++ b/crates/bevy_ui/src/layout/mod.rs @@ -463,11 +463,11 @@ mod tests { use bevy_hierarchy::{ despawn_with_children_recursive, BuildChildren, ChildBuild, Children, Parent, }; + use bevy_image::Image; use bevy_math::{Rect, UVec2, Vec2}; use bevy_render::{ camera::{ManualTextureViews, OrthographicProjection}, prelude::Camera, - texture::Image, }; use bevy_transform::{ prelude::GlobalTransform, diff --git a/crates/bevy_ui/src/render/box_shadow.rs b/crates/bevy_ui/src/render/box_shadow.rs index 067afa7688970..7896520b7a787 100644 --- a/crates/bevy_ui/src/render/box_shadow.rs +++ b/crates/bevy_ui/src/render/box_shadow.rs @@ -16,6 +16,7 @@ use bevy_ecs::{ *, }, }; +use bevy_image::BevyDefault as _; use bevy_math::{vec2, FloatOrd, Mat4, Rect, Vec2, Vec3Swizzles, Vec4Swizzles}; use bevy_render::sync_world::MainEntity; use bevy_render::RenderApp; @@ -25,7 +26,6 @@ use bevy_render::{ render_resource::{binding_types::uniform_buffer, *}, renderer::{RenderDevice, RenderQueue}, sync_world::{RenderEntity, TemporaryRenderEntity}, - texture::BevyDefault, view::*, Extract, ExtractSchedule, Render, RenderSet, }; diff --git a/crates/bevy_ui/src/render/mod.rs b/crates/bevy_ui/src/render/mod.rs index 9407da2b9f3a4..05befe25ce6d5 100644 --- a/crates/bevy_ui/src/render/mod.rs +++ b/crates/bevy_ui/src/render/mod.rs @@ -17,6 +17,7 @@ use bevy_core_pipeline::core_3d::graph::{Core3d, Node3d}; use bevy_core_pipeline::{core_2d::Camera2d, core_3d::Camera3d}; use bevy_ecs::entity::{EntityHashMap, EntityHashSet}; use bevy_ecs::prelude::*; +use bevy_image::Image; use bevy_math::{FloatOrd, Mat4, Rect, URect, UVec4, Vec2, Vec3, Vec3Swizzles, Vec4Swizzles}; use bevy_render::render_phase::ViewSortedRenderPhases; use bevy_render::sync_world::MainEntity; @@ -28,7 +29,6 @@ use bevy_render::{ render_phase::{sort_phase_system, AddRenderCommand, DrawFunctions}, render_resource::*, renderer::{RenderDevice, RenderQueue}, - texture::Image, view::{ExtractedView, ViewUniforms}, Extract, RenderApp, RenderSet, }; @@ -205,7 +205,7 @@ pub enum ExtractedUiItem { flip_x: bool, flip_y: bool, /// Border radius of the UI node. - /// Ordering: top left, top right, bottom right, bottom left. + /// Ordering: top left, top right, bottom right, bottom left. border_radius: ResolvedBorderRadius, /// Border thickness of the UI node. /// Ordering: left, top, right, bottom. diff --git a/crates/bevy_ui/src/render/pipeline.rs b/crates/bevy_ui/src/render/pipeline.rs index 633559cb9b19e..dd465515c51f2 100644 --- a/crates/bevy_ui/src/render/pipeline.rs +++ b/crates/bevy_ui/src/render/pipeline.rs @@ -1,11 +1,11 @@ use bevy_ecs::prelude::*; +use bevy_image::BevyDefault as _; use bevy_render::{ render_resource::{ binding_types::{sampler, texture_2d, uniform_buffer}, *, }, renderer::RenderDevice, - texture::BevyDefault, view::{ViewTarget, ViewUniform}, }; diff --git a/crates/bevy_ui/src/render/ui_material_pipeline.rs b/crates/bevy_ui/src/render/ui_material_pipeline.rs index f5379b2e5c57b..23be50063c401 100644 --- a/crates/bevy_ui/src/render/ui_material_pipeline.rs +++ b/crates/bevy_ui/src/render/ui_material_pipeline.rs @@ -11,6 +11,7 @@ use bevy_ecs::{ *, }, }; +use bevy_image::BevyDefault as _; use bevy_math::{FloatOrd, Mat4, Rect, Vec2, Vec4Swizzles}; use bevy_render::sync_world::MainEntity; use bevy_render::{ @@ -21,7 +22,6 @@ use bevy_render::{ render_resource::{binding_types::uniform_buffer, *}, renderer::{RenderDevice, RenderQueue}, sync_world::{RenderEntity, TemporaryRenderEntity}, - texture::BevyDefault, view::*, Extract, ExtractSchedule, Render, RenderSet, }; diff --git a/crates/bevy_ui/src/render/ui_texture_slice_pipeline.rs b/crates/bevy_ui/src/render/ui_texture_slice_pipeline.rs index d07575d44937b..3893aaedecb07 100644 --- a/crates/bevy_ui/src/render/ui_texture_slice_pipeline.rs +++ b/crates/bevy_ui/src/render/ui_texture_slice_pipeline.rs @@ -11,6 +11,7 @@ use bevy_ecs::{ *, }, }; +use bevy_image::{BevyDefault, Image}; use bevy_math::{FloatOrd, Mat4, Rect, Vec2, Vec4Swizzles}; use bevy_render::sync_world::MainEntity; use bevy_render::{ @@ -19,7 +20,7 @@ use bevy_render::{ render_resource::{binding_types::uniform_buffer, *}, renderer::{RenderDevice, RenderQueue}, sync_world::{RenderEntity, TemporaryRenderEntity}, - texture::{BevyDefault, GpuImage, Image, TRANSPARENT_IMAGE_HANDLE}, + texture::{GpuImage, TRANSPARENT_IMAGE_HANDLE}, view::*, Extract, ExtractSchedule, Render, RenderSet, }; diff --git a/crates/bevy_ui/src/ui_material.rs b/crates/bevy_ui/src/ui_material.rs index 9c26f242e48f4..741bddfa29f2d 100644 --- a/crates/bevy_ui/src/ui_material.rs +++ b/crates/bevy_ui/src/ui_material.rs @@ -30,8 +30,9 @@ use derive_more::derive::From; /// ``` /// # use bevy_ui::prelude::*; /// # use bevy_ecs::prelude::*; +/// # use bevy_image::Image; /// # use bevy_reflect::TypePath; -/// # use bevy_render::{render_resource::{AsBindGroup, ShaderRef}, texture::Image}; +/// # use bevy_render::render_resource::{AsBindGroup, ShaderRef}; /// # use bevy_color::LinearRgba; /// # use bevy_asset::{Handle, AssetServer, Assets, Asset}; /// diff --git a/crates/bevy_ui/src/widget/image.rs b/crates/bevy_ui/src/widget/image.rs index a45e8c8e7d9bd..70995e3c937be 100644 --- a/crates/bevy_ui/src/widget/image.rs +++ b/crates/bevy_ui/src/widget/image.rs @@ -2,9 +2,10 @@ use crate::{ContentSize, Measure, MeasureArgs, Node, NodeMeasure, UiScale}; use bevy_asset::{Assets, Handle}; use bevy_color::Color; use bevy_ecs::prelude::*; +use bevy_image::Image; use bevy_math::{Rect, UVec2, Vec2}; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; -use bevy_render::texture::{Image, TRANSPARENT_IMAGE_HANDLE}; +use bevy_render::texture::TRANSPARENT_IMAGE_HANDLE; use bevy_sprite::{TextureAtlas, TextureAtlasLayout, TextureSlicer}; use bevy_window::{PrimaryWindow, Window}; use taffy::{MaybeMath, MaybeResolve}; diff --git a/crates/bevy_ui/src/widget/text.rs b/crates/bevy_ui/src/widget/text.rs index 30817e05da835..1007a4cc785a2 100644 --- a/crates/bevy_ui/src/widget/text.rs +++ b/crates/bevy_ui/src/widget/text.rs @@ -14,9 +14,10 @@ use bevy_ecs::{ system::{Local, Query, Res, ResMut}, world::{Mut, Ref}, }; +use bevy_image::Image; use bevy_math::Vec2; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; -use bevy_render::{camera::Camera, texture::Image}; +use bevy_render::camera::Camera; use bevy_sprite::TextureAtlasLayout; use bevy_text::{ scale_value, ComputedTextBlock, CosmicFontSystem, Font, FontAtlasSets, LineBreak, SwashCache, diff --git a/examples/2d/mesh2d_manual.rs b/examples/2d/mesh2d_manual.rs index 6be6ca5f07053..f12e6a27cbad5 100644 --- a/examples/2d/mesh2d_manual.rs +++ b/examples/2d/mesh2d_manual.rs @@ -25,7 +25,6 @@ use bevy::{ TextureFormat, VertexBufferLayout, VertexFormat, VertexState, VertexStepMode, }, sync_world::MainEntityHashMap, - texture::BevyDefault, view::{ExtractedView, RenderVisibleEntities, ViewTarget}, Extract, Render, RenderApp, RenderSet, }, diff --git a/examples/2d/texture_atlas.rs b/examples/2d/texture_atlas.rs index 532903c0ad161..502285c9acb75 100644 --- a/examples/2d/texture_atlas.rs +++ b/examples/2d/texture_atlas.rs @@ -7,7 +7,7 @@ //! Only one padded and one unpadded texture atlas are rendered to the screen. //! An upscaled sprite from each of the four atlases are rendered to the screen. -use bevy::{asset::LoadedFolder, prelude::*, render::texture::ImageSampler}; +use bevy::{asset::LoadedFolder, image::ImageSampler, prelude::*}; fn main() { App::new() diff --git a/examples/3d/anti_aliasing.rs b/examples/3d/anti_aliasing.rs index 19659ac3a5d70..f41ca3576fe99 100644 --- a/examples/3d/anti_aliasing.rs +++ b/examples/3d/anti_aliasing.rs @@ -10,13 +10,13 @@ use bevy::{ prepass::{DepthPrepass, MotionVectorPrepass}, smaa::{Smaa, SmaaPreset}, }, + image::{ImageSampler, ImageSamplerDescriptor}, pbr::CascadeShadowConfigBuilder, prelude::*, render::{ camera::TemporalJitter, render_asset::RenderAssetUsages, render_resource::{Extent3d, TextureDimension, TextureFormat}, - texture::{ImageSampler, ImageSamplerDescriptor}, }, }; diff --git a/examples/3d/clearcoat.rs b/examples/3d/clearcoat.rs index 1cd825285a9cc..c04b12d5814ed 100644 --- a/examples/3d/clearcoat.rs +++ b/examples/3d/clearcoat.rs @@ -22,9 +22,9 @@ use std::f32::consts::PI; use bevy::{ color::palettes::css::{BLUE, GOLD, WHITE}, core_pipeline::{tonemapping::Tonemapping::AcesFitted, Skybox}, + image::ImageLoaderSettings, math::vec3, prelude::*, - render::texture::ImageLoaderSettings, }; /// The size of each sphere. diff --git a/examples/3d/deferred_rendering.rs b/examples/3d/deferred_rendering.rs index 769d617495a8c..2bca5a5be7b6b 100644 --- a/examples/3d/deferred_rendering.rs +++ b/examples/3d/deferred_rendering.rs @@ -7,13 +7,13 @@ use bevy::{ fxaa::Fxaa, prepass::{DeferredPrepass, DepthPrepass, MotionVectorPrepass, NormalPrepass}, }, + image::ImageLoaderSettings, math::ops, pbr::{ CascadeShadowConfigBuilder, DefaultOpaqueRendererMethod, DirectionalLightShadowMap, NotShadowCaster, NotShadowReceiver, OpaqueRendererMethod, }, prelude::*, - render::texture::ImageLoaderSettings, }; fn main() { diff --git a/examples/3d/motion_blur.rs b/examples/3d/motion_blur.rs index caea6835aca13..94a203ea69301 100644 --- a/examples/3d/motion_blur.rs +++ b/examples/3d/motion_blur.rs @@ -1,7 +1,12 @@ //! Demonstrates how to enable per-object motion blur. This rendering feature can be configured per //! camera using the [`MotionBlur`] component.z -use bevy::{core_pipeline::motion_blur::MotionBlur, math::ops, prelude::*}; +use bevy::{ + core_pipeline::motion_blur::MotionBlur, + image::{ImageAddressMode, ImageFilterMode, ImageSampler, ImageSamplerDescriptor}, + math::ops, + prelude::*, +}; fn main() { let mut app = App::new(); @@ -350,7 +355,7 @@ fn move_camera( } fn uv_debug_texture() -> Image { - use bevy::render::{render_asset::RenderAssetUsages, render_resource::*, texture::*}; + use bevy::render::{render_asset::RenderAssetUsages, render_resource::*}; const TEXTURE_SIZE: usize = 7; let mut palette = [ diff --git a/examples/3d/parallax_mapping.rs b/examples/3d/parallax_mapping.rs index 1d4daad5dba7c..47d83a4e76960 100644 --- a/examples/3d/parallax_mapping.rs +++ b/examples/3d/parallax_mapping.rs @@ -3,7 +3,7 @@ use std::fmt; -use bevy::{math::ops, prelude::*, render::texture::ImageLoaderSettings}; +use bevy::{image::ImageLoaderSettings, math::ops, prelude::*}; fn main() { App::new() diff --git a/examples/3d/rotate_environment_map.rs b/examples/3d/rotate_environment_map.rs index 0e7f4a5e55633..68ecceeccf7de 100644 --- a/examples/3d/rotate_environment_map.rs +++ b/examples/3d/rotate_environment_map.rs @@ -5,8 +5,8 @@ use std::f32::consts::PI; use bevy::{ color::palettes::css::{GOLD, WHITE}, core_pipeline::{tonemapping::Tonemapping::AcesFitted, Skybox}, + image::ImageLoaderSettings, prelude::*, - render::texture::ImageLoaderSettings, }; /// Entry point. diff --git a/examples/3d/scrolling_fog.rs b/examples/3d/scrolling_fog.rs index 5e66bc25cb83a..55118625721fd 100644 --- a/examples/3d/scrolling_fog.rs +++ b/examples/3d/scrolling_fog.rs @@ -15,12 +15,12 @@ use bevy::{ bloom::Bloom, experimental::taa::{TemporalAntiAliasPlugin, TemporalAntiAliasing}, }, - pbr::{DirectionalLightShadowMap, FogVolume, VolumetricFog, VolumetricLight}, - prelude::*, - render::texture::{ + image::{ ImageAddressMode, ImageFilterMode, ImageLoaderSettings, ImageSampler, ImageSamplerDescriptor, }, + pbr::{DirectionalLightShadowMap, FogVolume, VolumetricFog, VolumetricLight}, + prelude::*, }; /// Initializes the example. diff --git a/examples/3d/skybox.rs b/examples/3d/skybox.rs index d2593f7741e86..8dc94d9f94aff 100644 --- a/examples/3d/skybox.rs +++ b/examples/3d/skybox.rs @@ -5,11 +5,11 @@ mod camera_controller; use bevy::{ core_pipeline::Skybox, + image::CompressedImageFormats, prelude::*, render::{ render_resource::{TextureViewDescriptor, TextureViewDimension}, renderer::RenderDevice, - texture::CompressedImageFormats, }, }; use camera_controller::{CameraController, CameraControllerPlugin}; diff --git a/examples/3d/ssr.rs b/examples/3d/ssr.rs index 8f4ae85fe1b79..1cc3695354553 100644 --- a/examples/3d/ssr.rs +++ b/examples/3d/ssr.rs @@ -5,19 +5,17 @@ use std::ops::Range; use bevy::{ color::palettes::css::{BLACK, WHITE}, core_pipeline::{fxaa::Fxaa, Skybox}, + image::{ + ImageAddressMode, ImageFilterMode, ImageLoaderSettings, ImageSampler, + ImageSamplerDescriptor, + }, input::mouse::MouseWheel, math::{vec3, vec4}, pbr::{ DefaultOpaqueRendererMethod, ExtendedMaterial, MaterialExtension, ScreenSpaceReflections, }, prelude::*, - render::{ - render_resource::{AsBindGroup, ShaderRef, ShaderType}, - texture::{ - ImageAddressMode, ImageFilterMode, ImageLoaderSettings, ImageSampler, - ImageSamplerDescriptor, - }, - }, + render::render_resource::{AsBindGroup, ShaderRef, ShaderType}, }; /// This example uses a shader source file from the assets subdirectory diff --git a/examples/app/headless_renderer.rs b/examples/app/headless_renderer.rs index cf7d6732bafac..a384d018b6bd0 100644 --- a/examples/app/headless_renderer.rs +++ b/examples/app/headless_renderer.rs @@ -10,6 +10,7 @@ use bevy::{ app::{AppExit, ScheduleRunnerPlugin}, core_pipeline::tonemapping::Tonemapping, + image::TextureFormatPixelInfo, prelude::*, render::{ camera::RenderTarget, @@ -21,7 +22,6 @@ use bevy::{ TextureUsages, }, renderer::{RenderContext, RenderDevice, RenderQueue}, - texture::{BevyDefault, TextureFormatPixelInfo}, Extract, Render, RenderApp, RenderSet, }, }; diff --git a/examples/asset/alter_sprite.rs b/examples/asset/alter_sprite.rs index 76a1d88a4aa02..746643a077481 100644 --- a/examples/asset/alter_sprite.rs +++ b/examples/asset/alter_sprite.rs @@ -1,9 +1,8 @@ //! Shows how to modify texture assets after spawning. use bevy::{ - input::common_conditions::input_just_pressed, - prelude::*, - render::{render_asset::RenderAssetUsages, texture::ImageLoaderSettings}, + image::ImageLoaderSettings, input::common_conditions::input_just_pressed, prelude::*, + render::render_asset::RenderAssetUsages, }; fn main() { diff --git a/examples/asset/asset_settings.rs b/examples/asset/asset_settings.rs index cf8182f4f9898..cfc76d774a960 100644 --- a/examples/asset/asset_settings.rs +++ b/examples/asset/asset_settings.rs @@ -1,8 +1,8 @@ //! This example demonstrates the usage of '.meta' files and [`AssetServer::load_with_settings`] to override the default settings for loading an asset use bevy::{ + image::{ImageLoaderSettings, ImageSampler}, prelude::*, - render::texture::{ImageLoaderSettings, ImageSampler}, }; fn main() { diff --git a/examples/asset/repeated_texture.rs b/examples/asset/repeated_texture.rs index aed3215ab536d..34664a9e42b5c 100644 --- a/examples/asset/repeated_texture.rs +++ b/examples/asset/repeated_texture.rs @@ -2,11 +2,9 @@ //! This example shows how to configure it to repeat the image instead. use bevy::{ + image::{ImageAddressMode, ImageLoaderSettings, ImageSampler, ImageSamplerDescriptor}, math::Affine2, prelude::*, - render::texture::{ - ImageAddressMode, ImageLoaderSettings, ImageSampler, ImageSamplerDescriptor, - }, }; fn main() { diff --git a/examples/shader/custom_phase_item.rs b/examples/shader/custom_phase_item.rs index f4b9a8723678f..088265ef4eeb3 100644 --- a/examples/shader/custom_phase_item.rs +++ b/examples/shader/custom_phase_item.rs @@ -30,7 +30,6 @@ use bevy::{ VertexFormat, VertexState, VertexStepMode, }, renderer::{RenderDevice, RenderQueue}, - texture::BevyDefault as _, view::{self, ExtractedView, RenderVisibleEntities, VisibilitySystems}, Render, RenderApp, RenderSet, }, diff --git a/examples/shader/custom_post_processing.rs b/examples/shader/custom_post_processing.rs index 8567f45d26c66..ec532071bf2b8 100644 --- a/examples/shader/custom_post_processing.rs +++ b/examples/shader/custom_post_processing.rs @@ -26,7 +26,6 @@ use bevy::{ *, }, renderer::{RenderContext, RenderDevice}, - texture::BevyDefault, view::ViewTarget, RenderApp, }, diff --git a/examples/shader/gpu_readback.rs b/examples/shader/gpu_readback.rs index a83f01dcae014..5a33f93743794 100644 --- a/examples/shader/gpu_readback.rs +++ b/examples/shader/gpu_readback.rs @@ -7,8 +7,7 @@ use bevy::{ extract_resource::{ExtractResource, ExtractResourcePlugin}, gpu_readback::{Readback, ReadbackComplete}, render_asset::{RenderAssetUsages, RenderAssets}, - render_graph, - render_graph::{RenderGraph, RenderLabel}, + render_graph::{self, RenderGraph, RenderLabel}, render_resource::{ binding_types::{storage_buffer, texture_storage_2d}, *, diff --git a/examples/shader/specialized_mesh_pipeline.rs b/examples/shader/specialized_mesh_pipeline.rs index dd097a0b66809..2d30f605d1f9e 100644 --- a/examples/shader/specialized_mesh_pipeline.rs +++ b/examples/shader/specialized_mesh_pipeline.rs @@ -28,7 +28,6 @@ use bevy::{ RenderPipelineDescriptor, SpecializedMeshPipeline, SpecializedMeshPipelineError, SpecializedMeshPipelines, TextureFormat, VertexState, }, - texture::BevyDefault as _, view::{self, ExtractedView, RenderVisibleEntities, ViewTarget, VisibilitySystems}, Render, RenderApp, RenderSet, }, diff --git a/examples/ui/ui_texture_slice_flip_and_tile.rs b/examples/ui/ui_texture_slice_flip_and_tile.rs index 07f81f14edbf3..ccf9e7d174f6e 100644 --- a/examples/ui/ui_texture_slice_flip_and_tile.rs +++ b/examples/ui/ui_texture_slice_flip_and_tile.rs @@ -1,8 +1,8 @@ //! This example illustrates how to how to flip and tile images with 9-slicing in the UI. use bevy::{ + image::{ImageLoaderSettings, ImageSampler}, prelude::*, - render::texture::{ImageLoaderSettings, ImageSampler}, ui::widget::NodeImageMode, winit::WinitSettings, };