Skip to content

Commit

Permalink
Remove padding from triangle
Browse files Browse the repository at this point in the history
  • Loading branch information
Dispersia committed May 20, 2021
1 parent b40c441 commit 2d549d8
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions wgpu/src/triangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,18 +425,12 @@ impl Pipeline {
#[derive(Debug, Clone, Copy, Zeroable, Pod)]
struct Uniforms {
transform: [f32; 16],
// We need to align this to 256 bytes to please `wgpu`...
// TODO: Be smarter and stop wasting memory!
_padding_a: [f32; 32],
_padding_b: [f32; 16],
}

impl Default for Uniforms {
fn default() -> Self {
Self {
transform: *Transformation::identity().as_ref(),
_padding_a: [0.0; 32],
_padding_b: [0.0; 16],
}
}
}
Expand All @@ -445,8 +439,6 @@ impl From<Transformation> for Uniforms {
fn from(transformation: Transformation) -> Uniforms {
Self {
transform: transformation.into(),
_padding_a: [0.0; 32],
_padding_b: [0.0; 16],
}
}
}

0 comments on commit 2d549d8

Please sign in to comment.