Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Use crevice std140_size_static everywhere #3168

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pipelined/bevy_pbr2/src/render/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ use bevy_render2::{
render_resource::*,
renderer::{RenderContext, RenderDevice, RenderQueue},
texture::*,
view::{ExtractedView, ViewUniformOffset, ViewUniforms, VisibleEntities, VisibleEntity},
view::{
ExtractedView, ViewUniform, ViewUniformOffset, ViewUniforms, VisibleEntities, VisibleEntity,
},
};
use bevy_transform::components::GlobalTransform;
use crevice::std140::AsStd140;
Expand Down Expand Up @@ -155,9 +157,7 @@ impl FromWorld for ShadowPipeline {
ty: BindingType::Buffer {
ty: BufferBindingType::Uniform,
has_dynamic_offset: true,
// TODO: change this to ViewUniform::std140_size_static once crevice fixes this!
// Context: https://github.com/LPGhatguy/crevice/issues/29
min_binding_size: BufferSize::new(144),
min_binding_size: BufferSize::new(ViewUniform::std140_size_static() as u64),
},
count: None,
},
Expand Down
18 changes: 6 additions & 12 deletions pipelined/bevy_pbr2/src/render/mesh.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
LightMeta, NotShadowCaster, NotShadowReceiver, ShadowPipeline, ViewLightsUniformOffset,
ViewShadowBindings,
GpuLights, LightMeta, NotShadowCaster, NotShadowReceiver, ShadowPipeline,
ViewLightsUniformOffset, ViewShadowBindings,
};
use bevy_app::Plugin;
use bevy_asset::{Assets, Handle, HandleUntyped};
Expand All @@ -18,7 +18,7 @@ use bevy_render2::{
render_resource::*,
renderer::{RenderDevice, RenderQueue},
texture::{BevyDefault, GpuImage, Image, TextureFormatPixelInfo},
view::{ComputedVisibility, ViewUniformOffset, ViewUniforms},
view::{ComputedVisibility, ViewUniform, ViewUniformOffset, ViewUniforms},
RenderApp, RenderStage,
};
use bevy_transform::components::GlobalTransform;
Expand Down Expand Up @@ -180,9 +180,7 @@ impl FromWorld for MeshPipeline {
ty: BindingType::Buffer {
ty: BufferBindingType::Uniform,
has_dynamic_offset: true,
// TODO: change this to ViewUniform::std140_size_static once crevice fixes this!
// Context: https://github.com/LPGhatguy/crevice/issues/29
min_binding_size: BufferSize::new(144),
min_binding_size: BufferSize::new(ViewUniform::std140_size_static() as u64),
},
count: None,
},
Expand All @@ -193,9 +191,7 @@ impl FromWorld for MeshPipeline {
ty: BindingType::Buffer {
ty: BufferBindingType::Uniform,
has_dynamic_offset: true,
// TODO: change this to GpuLights::std140_size_static once crevice fixes this!
// Context: https://github.com/LPGhatguy/crevice/issues/29
min_binding_size: BufferSize::new(1424),
min_binding_size: BufferSize::new(GpuLights::std140_size_static() as u64),
},
count: None,
},
Expand Down Expand Up @@ -252,9 +248,7 @@ impl FromWorld for MeshPipeline {
ty: BindingType::Buffer {
ty: BufferBindingType::Uniform,
has_dynamic_offset: true,
// TODO: change this to MeshUniform::std140_size_static once crevice fixes this!
// Context: https://github.com/LPGhatguy/crevice/issues/29
min_binding_size: BufferSize::new(144),
min_binding_size: BufferSize::new(MeshUniform::std140_size_static() as u64),
},
count: None,
}],
Expand Down
1 change: 1 addition & 0 deletions pipelined/bevy_sprite2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ bevy_utils = { path = "../../crates/bevy_utils", version = "0.5.0" }

# other
bytemuck = { version = "1.5", features = ["derive"] }
crevice = { path = "../../crates/crevice", version = "0.8.0", features = ["glam"] }
guillotiere = "0.6.0"
thiserror = "1.0"
rectangle-pack = "0.4"
Expand Down
7 changes: 3 additions & 4 deletions pipelined/bevy_sprite2/src/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ use bevy_render2::{
render_resource::*,
renderer::{RenderDevice, RenderQueue},
texture::{BevyDefault, Image},
view::{ComputedVisibility, ViewUniformOffset, ViewUniforms},
view::{ComputedVisibility, ViewUniform, ViewUniformOffset, ViewUniforms},
RenderWorld,
};
use bevy_transform::components::GlobalTransform;
use bevy_utils::HashMap;
use bytemuck::{Pod, Zeroable};
use crevice::std140::AsStd140;

pub struct SpritePipeline {
view_layout: BindGroupLayout,
Expand All @@ -43,9 +44,7 @@ impl FromWorld for SpritePipeline {
ty: BindingType::Buffer {
ty: BufferBindingType::Uniform,
has_dynamic_offset: true,
// TODO: change this to ViewUniform::std140_size_static once crevice fixes this!
// Context: https://github.com/LPGhatguy/crevice/issues/29
min_binding_size: BufferSize::new(144),
min_binding_size: BufferSize::new(ViewUniform::std140_size_static() as u64),
},
count: None,
}],
Expand Down