Skip to content

Commit

Permalink
Only bevy_render should depend directly on wgpu (bevyengine#3393)
Browse files Browse the repository at this point in the history
# Objective

- Only bevy_render should depend directly on wgpu
- This helps to make sure bevy_render re-exports everything needed from wgpu

## Solution

- Remove bevy_pbr, bevy_sprite and bevy_ui dependency on wgpu


Co-authored-by: François <[email protected]>
  • Loading branch information
mockersf and mockersf committed Dec 20, 2021
1 parent 1ef028d commit c61fbcb
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 12 deletions.
1 change: 0 additions & 1 deletion crates/bevy_gltf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ thiserror = "1.0"
anyhow = "1.0.4"
base64 = "0.13.0"
percent-encoding = "2.1"
wgpu = "0.12.0"
4 changes: 3 additions & 1 deletion crates/bevy_gltf/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ use bevy_render::{
color::Color,
mesh::{Indices, Mesh, VertexAttributeValues},
primitives::{Aabb, Frustum},
render_resource::{
AddressMode, FilterMode, PrimitiveTopology, SamplerDescriptor, TextureFormat,
},
texture::{Image, ImageType, TextureError},
view::VisibleEntities,
};
Expand All @@ -30,7 +33,6 @@ use gltf::{
};
use std::{collections::VecDeque, path::Path};
use thiserror::Error;
use wgpu::{AddressMode, FilterMode, PrimitiveTopology, SamplerDescriptor, TextureFormat};

use crate::{Gltf, GltfNode};

Expand Down
12 changes: 6 additions & 6 deletions crates/bevy_render/src/render_resource/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ pub use wgpu::{
Limits as WgpuLimits, LoadOp, MultisampleState, Operations, Origin3d, PipelineLayout,
PipelineLayoutDescriptor, PolygonMode, PrimitiveState, PrimitiveTopology,
RenderPassColorAttachment, RenderPassDepthStencilAttachment, RenderPassDescriptor,
RenderPipelineDescriptor as RawRenderPipelineDescriptor, SamplerDescriptor, ShaderModule,
ShaderModuleDescriptor, ShaderSource, ShaderStages, StencilFaceState, StencilOperation,
StencilState, StorageTextureAccess, TextureAspect, TextureDescriptor, TextureDimension,
TextureFormat, TextureSampleType, TextureUsages, TextureViewDescriptor, TextureViewDimension,
VertexAttribute, VertexBufferLayout as RawVertexBufferLayout, VertexFormat,
VertexState as RawVertexState, VertexStepMode,
RenderPipelineDescriptor as RawRenderPipelineDescriptor, SamplerBindingType, SamplerDescriptor,
ShaderModule, ShaderModuleDescriptor, ShaderSource, ShaderStages, StencilFaceState,
StencilOperation, StencilState, StorageTextureAccess, TextureAspect, TextureDescriptor,
TextureDimension, TextureFormat, TextureSampleType, TextureUsages, TextureViewDescriptor,
TextureViewDimension, VertexAttribute, VertexBufferLayout as RawVertexBufferLayout,
VertexFormat, VertexState as RawVertexState, VertexStepMode,
};
1 change: 0 additions & 1 deletion crates/bevy_sprite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ guillotiere = "0.6.0"
thiserror = "1.0"
rectangle-pack = "0.4"
serde = { version = "1", features = ["derive"] }
wgpu = "0.12.0"
1 change: 0 additions & 1 deletion crates/bevy_sprite/src/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use bevy_transform::components::GlobalTransform;
use bevy_utils::HashMap;
use bytemuck::{Pod, Zeroable};
use crevice::std140::AsStd140;
use wgpu::SamplerBindingType;

pub struct SpritePipeline {
view_layout: BindGroupLayout,
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ serde = { version = "1", features = ["derive"] }
smallvec = { version = "1.6", features = ["union", "const_generics"] }
bytemuck = { version = "1.5", features = ["derive"] }
crevice = { path = "../crevice", version = "0.8.0", features = ["glam"] }
wgpu = "0.12.0"
1 change: 0 additions & 1 deletion crates/bevy_ui/src/render/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use bevy_render::{
};

use crevice::std140::AsStd140;
use wgpu::SamplerBindingType;

pub struct UiPipeline {
pub view_layout: BindGroupLayout,
Expand Down

0 comments on commit c61fbcb

Please sign in to comment.