Skip to content

Commit

Permalink
Simplify name of struct
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Nov 22, 2024
1 parent 0861be4 commit 81e4cb1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions experiments/2024-10-30/src/render/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct Geometry<V> {
_vertex: PhantomData<V>,
}

impl Geometry<vertices::VerticesVertex> {
impl Geometry<vertices::Vertex> {
pub fn vertices(device: &wgpu::Device, operation: &impl Operation) -> Self {
let mut mesh_vertices = Vec::new();
operation.vertices(&mut mesh_vertices);
Expand All @@ -35,7 +35,7 @@ impl Geometry<vertices::VerticesVertex> {
for vertex in [a, b, c, c, b, d] {
let index = vertices.len() as u32;

let vertex = vertices::VerticesVertex {
let vertex = vertices::Vertex {
position: vertex,
center: p.coords.components.map(|s| s.value() as f32),
radius: s as f32,
Expand Down
2 changes: 1 addition & 1 deletion experiments/2024-10-30/src/render/pipelines/pipelines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use wgpu::util::DeviceExt;
use super::{triangles, vertices, Pipeline};

pub struct Pipelines {
pub vertices: Pipeline<vertices::VerticesVertex>,
pub vertices: Pipeline<vertices::Vertex>,
pub triangles: Pipeline<triangles::TrianglesVertex>,
}

Expand Down
4 changes: 2 additions & 2 deletions experiments/2024-10-30/src/render/pipelines/vertices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ use super::pipeline::IsVertex;

#[derive(Clone, Copy, bytemuck::Pod, bytemuck::Zeroable)]
#[repr(C)]
pub struct VerticesVertex {
pub struct Vertex {
pub position: [f32; 3],
pub center: [f32; 3],
pub radius: f32,
}

impl IsVertex for VerticesVertex {
impl IsVertex for Vertex {
const ATTRIBUTES: &[wgpu::VertexAttribute] = &wgpu::vertex_attr_array![
0 => Float32x3,
1 => Float32x3,
Expand Down

0 comments on commit 81e4cb1

Please sign in to comment.