From cf8a4ffc23bd750539d00741c71c15d08eb8ffd6 Mon Sep 17 00:00:00 2001 From: Robert Swain Date: Thu, 26 Aug 2021 11:40:25 +0200 Subject: [PATCH] bevy_pbr2: Cleanup --- pipelined/bevy_pbr2/src/render/depth.wgsl | 4 ++-- pipelined/bevy_pbr2/src/render/mod.rs | 2 ++ pipelined/bevy_sprite2/src/render/mod.rs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pipelined/bevy_pbr2/src/render/depth.wgsl b/pipelined/bevy_pbr2/src/render/depth.wgsl index 9313118d16f1d..b8bb0eec23948 100644 --- a/pipelined/bevy_pbr2/src/render/depth.wgsl +++ b/pipelined/bevy_pbr2/src/render/depth.wgsl @@ -9,7 +9,7 @@ var view: View; [[block]] struct Mesh { - transform: mat4x4; + model: mat4x4; }; [[group(1), binding(0)]] var mesh: Mesh; @@ -25,6 +25,6 @@ struct VertexOutput { [[stage(vertex)]] fn vertex(vertex: Vertex) -> VertexOutput { var out: VertexOutput; - out.clip_position = view.view_proj * mesh.transform * vec4(vertex.position, 1.0); + out.clip_position = view.view_proj * mesh.model * vec4(vertex.position, 1.0); return out; } diff --git a/pipelined/bevy_pbr2/src/render/mod.rs b/pipelined/bevy_pbr2/src/render/mod.rs index d52031c054b7f..f2009b145a36a 100644 --- a/pipelined/bevy_pbr2/src/render/mod.rs +++ b/pipelined/bevy_pbr2/src/render/mod.rs @@ -225,6 +225,8 @@ impl FromWorld for PbrShaders { 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), }, count: None, diff --git a/pipelined/bevy_sprite2/src/render/mod.rs b/pipelined/bevy_sprite2/src/render/mod.rs index 50569f3eb8dc2..5455eb1bb57b7 100644 --- a/pipelined/bevy_sprite2/src/render/mod.rs +++ b/pipelined/bevy_sprite2/src/render/mod.rs @@ -15,7 +15,7 @@ use bevy_render2::{ renderer::{RenderContext, RenderDevice}, shader::Shader, texture::{BevyDefault, Image}, - view::{ViewMeta, ViewUniform, ViewUniformOffset}, + view::{ViewMeta, ViewUniformOffset}, RenderWorld, }; use bevy_transform::components::GlobalTransform;