Skip to content

Commit

Permalink
gpu: Delete unused PaddedVec3.
Browse files Browse the repository at this point in the history
  • Loading branch information
kpreid committed Jul 25, 2024
1 parent a804503 commit 4cb3c83
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions all-is-cubes-gpu/src/in_wgpu/glue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,10 @@ use core::ops::Range;
use bytemuck::Pod;
use wgpu::util::DeviceExt as _;

use all_is_cubes::euclid::{Point3D, Vector3D};
use all_is_cubes::euclid::Point3D;
use all_is_cubes::math::{GridAab, GridCoordinate, GridSize, Rgba};
use all_is_cubes_mesh::IndexSlice;

/// A vector of 3 f32s padded to resemble a vector of 4, to satisfy
/// GPU alignment expectations.
#[repr(C, align(16))]
#[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub(crate) struct PaddedVec3 {
pub data: [f32; 3],
padding: f32,
}

impl PartialEq for PaddedVec3 {
fn eq(&self, other: &Self) -> bool {
self.data == other.data
}
}
impl Eq for PaddedVec3 {}

impl<U> From<Vector3D<f32, U>> for PaddedVec3 {
fn from(data: Vector3D<f32, U>) -> Self {
Self {
data: data.into(),
padding: 0.,
}
}
}

pub fn to_wgpu_color(color: Rgba) -> wgpu::Color {
// TODO: Check whether this is gamma-correct
wgpu::Color {
Expand Down

0 comments on commit 4cb3c83

Please sign in to comment.