diff --git a/crates/bevy_gltf/src/loader.rs b/crates/bevy_gltf/src/loader.rs index 090cd51eb40c4..1687569e314c9 100644 --- a/crates/bevy_gltf/src/loader.rs +++ b/crates/bevy_gltf/src/loader.rs @@ -116,35 +116,35 @@ async fn load_gltf<'a, 'b>( if let Some(vertex_attribute) = reader .read_positions() - .map(|v| VertexAttributeValues::Float3(v.collect())) + .map(|v| VertexAttributeValues::Float32x3(v.collect())) { mesh.set_attribute(Mesh::ATTRIBUTE_POSITION, vertex_attribute); } if let Some(vertex_attribute) = reader .read_normals() - .map(|v| VertexAttributeValues::Float3(v.collect())) + .map(|v| VertexAttributeValues::Float32x3(v.collect())) { mesh.set_attribute(Mesh::ATTRIBUTE_NORMAL, vertex_attribute); } if let Some(vertex_attribute) = reader .read_tangents() - .map(|v| VertexAttributeValues::Float4(v.collect())) + .map(|v| VertexAttributeValues::Float32x4(v.collect())) { mesh.set_attribute(Mesh::ATTRIBUTE_TANGENT, vertex_attribute); } if let Some(vertex_attribute) = reader .read_tex_coords(0) - .map(|v| VertexAttributeValues::Float2(v.into_f32().collect())) + .map(|v| VertexAttributeValues::Float32x2(v.into_f32().collect())) { mesh.set_attribute(Mesh::ATTRIBUTE_UV_0, vertex_attribute); } if let Some(vertex_attribute) = reader .read_colors(0) - .map(|v| VertexAttributeValues::Float4(v.into_rgba_f32().collect())) + .map(|v| VertexAttributeValues::Float32x4(v.into_rgba_f32().collect())) { mesh.set_attribute(Mesh::ATTRIBUTE_COLOR, vertex_attribute); } diff --git a/crates/bevy_render/src/mesh/mesh.rs b/crates/bevy_render/src/mesh/mesh.rs index bc74be7b1d228..4c460976bd503 100644 --- a/crates/bevy_render/src/mesh/mesh.rs +++ b/crates/bevy_render/src/mesh/mesh.rs @@ -27,34 +27,34 @@ pub const VERTEX_ATTRIBUTE_BUFFER_ID: u64 = 10; /// An array where each entry describes a property of a single vertex. #[derive(Clone, Debug, EnumVariantMeta)] pub enum VertexAttributeValues { - Float(Vec), - Int(Vec), - Uint(Vec), - Float2(Vec<[f32; 2]>), - Int2(Vec<[i32; 2]>), - Uint2(Vec<[u32; 2]>), - Float3(Vec<[f32; 3]>), - Int3(Vec<[i32; 3]>), - Uint3(Vec<[u32; 3]>), - Float4(Vec<[f32; 4]>), - Int4(Vec<[i32; 4]>), - Uint4(Vec<[u32; 4]>), - Short2(Vec<[i16; 2]>), - Short2Norm(Vec<[i16; 2]>), - Ushort2(Vec<[u16; 2]>), - Ushort2Norm(Vec<[u16; 2]>), - Short4(Vec<[i16; 4]>), - Short4Norm(Vec<[i16; 4]>), - Ushort4(Vec<[u16; 4]>), - Ushort4Norm(Vec<[u16; 4]>), - Char2(Vec<[i8; 2]>), - Char2Norm(Vec<[i8; 2]>), - Uchar2(Vec<[u8; 2]>), - Uchar2Norm(Vec<[u8; 2]>), - Char4(Vec<[i8; 4]>), - Char4Norm(Vec<[i8; 4]>), - Uchar4(Vec<[u8; 4]>), - Uchar4Norm(Vec<[u8; 4]>), + Float32(Vec), + Sint32(Vec), + Uint32(Vec), + Float32x2(Vec<[f32; 2]>), + Sint32x2(Vec<[i32; 2]>), + Uint32x2(Vec<[u32; 2]>), + Float32x3(Vec<[f32; 3]>), + Sint32x3(Vec<[i32; 3]>), + Uint32x3(Vec<[u32; 3]>), + Float32x4(Vec<[f32; 4]>), + Sint32x4(Vec<[i32; 4]>), + Uint32x4(Vec<[u32; 4]>), + Sint16x2(Vec<[i16; 2]>), + Snorm16x2(Vec<[i16; 2]>), + Uint16x2(Vec<[u16; 2]>), + Unorm16x2(Vec<[u16; 2]>), + Sint16x4(Vec<[i16; 4]>), + Snorm16x4(Vec<[i16; 4]>), + Uint16x4(Vec<[u16; 4]>), + Unorm16x4(Vec<[u16; 4]>), + Sint8x2(Vec<[i8; 2]>), + Snorm8x2(Vec<[i8; 2]>), + Uint8x2(Vec<[u8; 2]>), + Unorm8x2(Vec<[u8; 2]>), + Sint8x4(Vec<[i8; 4]>), + Snorm8x4(Vec<[i8; 4]>), + Uint8x4(Vec<[u8; 4]>), + Unorm8x4(Vec<[u8; 4]>), } impl VertexAttributeValues { @@ -62,34 +62,34 @@ impl VertexAttributeValues { /// mesh, all of the VertexAttributeValues must have the same length. pub fn len(&self) -> usize { match *self { - VertexAttributeValues::Float(ref values) => values.len(), - VertexAttributeValues::Int(ref values) => values.len(), - VertexAttributeValues::Uint(ref values) => values.len(), - VertexAttributeValues::Float2(ref values) => values.len(), - VertexAttributeValues::Int2(ref values) => values.len(), - VertexAttributeValues::Uint2(ref values) => values.len(), - VertexAttributeValues::Float3(ref values) => values.len(), - VertexAttributeValues::Int3(ref values) => values.len(), - VertexAttributeValues::Uint3(ref values) => values.len(), - VertexAttributeValues::Float4(ref values) => values.len(), - VertexAttributeValues::Int4(ref values) => values.len(), - VertexAttributeValues::Uint4(ref values) => values.len(), - VertexAttributeValues::Short2(ref values) => values.len(), - VertexAttributeValues::Short2Norm(ref values) => values.len(), - VertexAttributeValues::Ushort2(ref values) => values.len(), - VertexAttributeValues::Ushort2Norm(ref values) => values.len(), - VertexAttributeValues::Short4(ref values) => values.len(), - VertexAttributeValues::Short4Norm(ref values) => values.len(), - VertexAttributeValues::Ushort4(ref values) => values.len(), - VertexAttributeValues::Ushort4Norm(ref values) => values.len(), - VertexAttributeValues::Char2(ref values) => values.len(), - VertexAttributeValues::Char2Norm(ref values) => values.len(), - VertexAttributeValues::Uchar2(ref values) => values.len(), - VertexAttributeValues::Uchar2Norm(ref values) => values.len(), - VertexAttributeValues::Char4(ref values) => values.len(), - VertexAttributeValues::Char4Norm(ref values) => values.len(), - VertexAttributeValues::Uchar4(ref values) => values.len(), - VertexAttributeValues::Uchar4Norm(ref values) => values.len(), + VertexAttributeValues::Float32(ref values) => values.len(), + VertexAttributeValues::Sint32(ref values) => values.len(), + VertexAttributeValues::Uint32(ref values) => values.len(), + VertexAttributeValues::Float32x2(ref values) => values.len(), + VertexAttributeValues::Sint32x2(ref values) => values.len(), + VertexAttributeValues::Uint32x2(ref values) => values.len(), + VertexAttributeValues::Float32x3(ref values) => values.len(), + VertexAttributeValues::Sint32x3(ref values) => values.len(), + VertexAttributeValues::Uint32x3(ref values) => values.len(), + VertexAttributeValues::Float32x4(ref values) => values.len(), + VertexAttributeValues::Sint32x4(ref values) => values.len(), + VertexAttributeValues::Uint32x4(ref values) => values.len(), + VertexAttributeValues::Sint16x2(ref values) => values.len(), + VertexAttributeValues::Snorm16x2(ref values) => values.len(), + VertexAttributeValues::Uint16x2(ref values) => values.len(), + VertexAttributeValues::Unorm16x2(ref values) => values.len(), + VertexAttributeValues::Sint16x4(ref values) => values.len(), + VertexAttributeValues::Snorm16x4(ref values) => values.len(), + VertexAttributeValues::Uint16x4(ref values) => values.len(), + VertexAttributeValues::Unorm16x4(ref values) => values.len(), + VertexAttributeValues::Sint8x2(ref values) => values.len(), + VertexAttributeValues::Snorm8x2(ref values) => values.len(), + VertexAttributeValues::Uint8x2(ref values) => values.len(), + VertexAttributeValues::Unorm8x2(ref values) => values.len(), + VertexAttributeValues::Sint8x4(ref values) => values.len(), + VertexAttributeValues::Snorm8x4(ref values) => values.len(), + VertexAttributeValues::Uint8x4(ref values) => values.len(), + VertexAttributeValues::Unorm8x4(ref values) => values.len(), } } @@ -100,7 +100,7 @@ impl VertexAttributeValues { fn as_float3(&self) -> Option<&[[f32; 3]]> { match self { - VertexAttributeValues::Float3(values) => Some(values), + VertexAttributeValues::Float32x3(values) => Some(values), _ => None, } } @@ -110,34 +110,34 @@ impl VertexAttributeValues { /// useful for serialization and sending to the GPU. pub fn get_bytes(&self) -> &[u8] { match self { - VertexAttributeValues::Float(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Int(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Uint(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Float2(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Int2(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Uint2(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Float3(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Int3(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Uint3(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Float4(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Int4(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Uint4(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Short2(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Short2Norm(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Ushort2(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Ushort2Norm(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Short4(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Short4Norm(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Ushort4(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Ushort4Norm(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Char2(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Char2Norm(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Uchar2(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Uchar2Norm(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Char4(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Char4Norm(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Uchar4(values) => values.as_slice().as_bytes(), - VertexAttributeValues::Uchar4Norm(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Float32(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Sint32(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Uint32(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Float32x2(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Sint32x2(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Uint32x2(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Float32x3(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Sint32x3(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Uint32x3(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Float32x4(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Sint32x4(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Uint32x4(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Sint16x2(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Snorm16x2(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Uint16x2(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Unorm16x2(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Sint16x4(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Snorm16x4(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Uint16x4(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Unorm16x4(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Sint8x2(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Snorm8x2(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Uint8x2(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Unorm8x2(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Sint8x4(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Snorm8x4(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Uint8x4(values) => values.as_slice().as_bytes(), + VertexAttributeValues::Unorm8x4(values) => values.as_slice().as_bytes(), } } } @@ -145,34 +145,34 @@ impl VertexAttributeValues { impl From<&VertexAttributeValues> for VertexFormat { fn from(values: &VertexAttributeValues) -> Self { match values { - VertexAttributeValues::Float(_) => VertexFormat::Float, - VertexAttributeValues::Int(_) => VertexFormat::Int, - VertexAttributeValues::Uint(_) => VertexFormat::Uint, - VertexAttributeValues::Float2(_) => VertexFormat::Float2, - VertexAttributeValues::Int2(_) => VertexFormat::Int2, - VertexAttributeValues::Uint2(_) => VertexFormat::Uint2, - VertexAttributeValues::Float3(_) => VertexFormat::Float3, - VertexAttributeValues::Int3(_) => VertexFormat::Int3, - VertexAttributeValues::Uint3(_) => VertexFormat::Uint3, - VertexAttributeValues::Float4(_) => VertexFormat::Float4, - VertexAttributeValues::Int4(_) => VertexFormat::Int4, - VertexAttributeValues::Uint4(_) => VertexFormat::Uint4, - VertexAttributeValues::Short2(_) => VertexFormat::Short2, - VertexAttributeValues::Short2Norm(_) => VertexFormat::Short2Norm, - VertexAttributeValues::Ushort2(_) => VertexFormat::Ushort2, - VertexAttributeValues::Ushort2Norm(_) => VertexFormat::Ushort2Norm, - VertexAttributeValues::Short4(_) => VertexFormat::Short4, - VertexAttributeValues::Short4Norm(_) => VertexFormat::Short4Norm, - VertexAttributeValues::Ushort4(_) => VertexFormat::Ushort4, - VertexAttributeValues::Ushort4Norm(_) => VertexFormat::Ushort4Norm, - VertexAttributeValues::Char2(_) => VertexFormat::Char2, - VertexAttributeValues::Char2Norm(_) => VertexFormat::Char2Norm, - VertexAttributeValues::Uchar2(_) => VertexFormat::Uchar2, - VertexAttributeValues::Uchar2Norm(_) => VertexFormat::Uchar2Norm, - VertexAttributeValues::Char4(_) => VertexFormat::Char4, - VertexAttributeValues::Char4Norm(_) => VertexFormat::Char4Norm, - VertexAttributeValues::Uchar4(_) => VertexFormat::Uchar4, - VertexAttributeValues::Uchar4Norm(_) => VertexFormat::Uchar4Norm, + VertexAttributeValues::Float32(_) => VertexFormat::Float32, + VertexAttributeValues::Sint32(_) => VertexFormat::Sint32, + VertexAttributeValues::Uint32(_) => VertexFormat::Uint32, + VertexAttributeValues::Float32x2(_) => VertexFormat::Float32x2, + VertexAttributeValues::Sint32x2(_) => VertexFormat::Sint32x2, + VertexAttributeValues::Uint32x2(_) => VertexFormat::Uint32x2, + VertexAttributeValues::Float32x3(_) => VertexFormat::Float32x3, + VertexAttributeValues::Sint32x3(_) => VertexFormat::Sint32x3, + VertexAttributeValues::Uint32x3(_) => VertexFormat::Uint32x3, + VertexAttributeValues::Float32x4(_) => VertexFormat::Float32x4, + VertexAttributeValues::Sint32x4(_) => VertexFormat::Sint32x4, + VertexAttributeValues::Uint32x4(_) => VertexFormat::Uint32x4, + VertexAttributeValues::Sint16x2(_) => VertexFormat::Sint16x2, + VertexAttributeValues::Snorm16x2(_) => VertexFormat::Snorm16x2, + VertexAttributeValues::Uint16x2(_) => VertexFormat::Uint16x2, + VertexAttributeValues::Unorm16x2(_) => VertexFormat::Unorm16x2, + VertexAttributeValues::Sint16x4(_) => VertexFormat::Sint16x4, + VertexAttributeValues::Snorm16x4(_) => VertexFormat::Snorm16x4, + VertexAttributeValues::Uint16x4(_) => VertexFormat::Uint16x4, + VertexAttributeValues::Unorm16x4(_) => VertexFormat::Unorm16x4, + VertexAttributeValues::Sint8x2(_) => VertexFormat::Sint8x2, + VertexAttributeValues::Snorm8x2(_) => VertexFormat::Snorm8x2, + VertexAttributeValues::Uint8x2(_) => VertexFormat::Uint8x2, + VertexAttributeValues::Unorm8x2(_) => VertexFormat::Unorm8x2, + VertexAttributeValues::Sint8x4(_) => VertexFormat::Sint8x4, + VertexAttributeValues::Snorm8x4(_) => VertexFormat::Snorm8x4, + VertexAttributeValues::Uint8x4(_) => VertexFormat::Uint8x4, + VertexAttributeValues::Unorm8x4(_) => VertexFormat::Unorm8x4, } } } @@ -408,34 +408,34 @@ impl Mesh { for (_, attributes) in self.attributes.iter_mut() { let indices = indices.iter(); match attributes { - VertexAttributeValues::Float(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Int(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Uint(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Float2(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Int2(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Uint2(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Float3(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Int3(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Uint3(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Int4(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Uint4(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Float4(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Short2(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Short2Norm(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Ushort2(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Ushort2Norm(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Short4(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Short4Norm(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Ushort4(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Ushort4Norm(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Char2(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Char2Norm(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Uchar2(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Uchar2Norm(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Char4(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Char4Norm(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Uchar4(vec) => *vec = duplicate(&vec, indices), - VertexAttributeValues::Uchar4Norm(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Float32(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Sint32(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Uint32(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Float32x2(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Sint32x2(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Uint32x2(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Float32x3(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Sint32x3(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Uint32x3(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Sint32x4(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Uint32x4(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Float32x4(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Sint16x2(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Snorm16x2(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Uint16x2(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Unorm16x2(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Sint16x4(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Snorm16x4(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Uint16x4(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Unorm16x4(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Sint8x2(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Snorm8x2(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Uint8x2(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Unorm8x2(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Sint8x4(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Snorm8x4(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Uint8x4(vec) => *vec = duplicate(&vec, indices), + VertexAttributeValues::Unorm8x4(vec) => *vec = duplicate(&vec, indices), } } } diff --git a/crates/bevy_render/src/mesh/mesh/conversions.rs b/crates/bevy_render/src/mesh/mesh/conversions.rs index df41df5f1da2c..b1a10b596a140 100644 --- a/crates/bevy_render/src/mesh/mesh/conversions.rs +++ b/crates/bevy_render/src/mesh/mesh/conversions.rs @@ -50,79 +50,79 @@ impl FromVertexAttributeError { impl From> for VertexAttributeValues { fn from(vec: Vec) -> Self { - VertexAttributeValues::Float(vec) + VertexAttributeValues::Float32(vec) } } impl From> for VertexAttributeValues { fn from(vec: Vec) -> Self { - VertexAttributeValues::Int(vec) + VertexAttributeValues::Sint32(vec) } } impl From> for VertexAttributeValues { fn from(vec: Vec) -> Self { - VertexAttributeValues::Uint(vec) + VertexAttributeValues::Uint32(vec) } } impl From> for VertexAttributeValues { fn from(vec: Vec<[f32; 2]>) -> Self { - VertexAttributeValues::Float2(vec) + VertexAttributeValues::Float32x2(vec) } } impl From> for VertexAttributeValues { fn from(vec: Vec<[i32; 2]>) -> Self { - VertexAttributeValues::Int2(vec) + VertexAttributeValues::Sint32x2(vec) } } impl From> for VertexAttributeValues { fn from(vec: Vec<[u32; 2]>) -> Self { - VertexAttributeValues::Uint2(vec) + VertexAttributeValues::Uint32x2(vec) } } impl From> for VertexAttributeValues { fn from(vec: Vec<[f32; 3]>) -> Self { - VertexAttributeValues::Float3(vec) + VertexAttributeValues::Float32x3(vec) } } impl From> for VertexAttributeValues { fn from(vec: Vec<[i32; 3]>) -> Self { - VertexAttributeValues::Int3(vec) + VertexAttributeValues::Sint32x3(vec) } } impl From> for VertexAttributeValues { fn from(vec: Vec<[u32; 3]>) -> Self { - VertexAttributeValues::Uint3(vec) + VertexAttributeValues::Uint32x3(vec) } } impl From> for VertexAttributeValues { fn from(vec: Vec<[f32; 4]>) -> Self { - VertexAttributeValues::Float4(vec) + VertexAttributeValues::Float32x4(vec) } } impl From> for VertexAttributeValues { fn from(vec: Vec<[i32; 4]>) -> Self { - VertexAttributeValues::Int4(vec) + VertexAttributeValues::Sint32x4(vec) } } impl From> for VertexAttributeValues { fn from(vec: Vec<[u32; 4]>) -> Self { - VertexAttributeValues::Uint4(vec) + VertexAttributeValues::Uint32x4(vec) } } impl From> for VertexAttributeValues { fn from(vec: Vec<[u8; 4]>) -> Self { - VertexAttributeValues::Uchar4Norm(vec) + VertexAttributeValues::Unorm8x4(vec) } } @@ -131,8 +131,8 @@ impl TryFrom for Vec<[u8; 4]> { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Uchar4(value) => Ok(value), - VertexAttributeValues::Uchar4Norm(value) => Ok(value), + VertexAttributeValues::Uint8x4(value) => Ok(value), + VertexAttributeValues::Unorm8x4(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -143,8 +143,8 @@ impl TryFrom for Vec<[i8; 4]> { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Char4(value) => Ok(value), - VertexAttributeValues::Char4Norm(value) => Ok(value), + VertexAttributeValues::Sint8x4(value) => Ok(value), + VertexAttributeValues::Snorm8x4(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -155,8 +155,8 @@ impl TryFrom for Vec<[u8; 2]> { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Uchar2(value) => Ok(value), - VertexAttributeValues::Uchar2Norm(value) => Ok(value), + VertexAttributeValues::Uint8x2(value) => Ok(value), + VertexAttributeValues::Unorm8x2(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -167,8 +167,8 @@ impl TryFrom for Vec<[i8; 2]> { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Char2(value) => Ok(value), - VertexAttributeValues::Char2Norm(value) => Ok(value), + VertexAttributeValues::Sint8x2(value) => Ok(value), + VertexAttributeValues::Snorm8x2(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -179,8 +179,8 @@ impl TryFrom for Vec<[i16; 4]> { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Short4(value) => Ok(value), - VertexAttributeValues::Short4Norm(value) => Ok(value), + VertexAttributeValues::Sint16x4(value) => Ok(value), + VertexAttributeValues::Snorm16x4(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -191,8 +191,8 @@ impl TryFrom for Vec<[u16; 4]> { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Ushort4(value) => Ok(value), - VertexAttributeValues::Ushort4Norm(value) => Ok(value), + VertexAttributeValues::Uint16x4(value) => Ok(value), + VertexAttributeValues::Unorm16x4(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -203,8 +203,8 @@ impl TryFrom for Vec<[u16; 2]> { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Ushort2(value) => Ok(value), - VertexAttributeValues::Ushort2Norm(value) => Ok(value), + VertexAttributeValues::Uint16x2(value) => Ok(value), + VertexAttributeValues::Unorm16x2(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -215,8 +215,8 @@ impl TryFrom for Vec<[i16; 2]> { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Short2(value) => Ok(value), - VertexAttributeValues::Short2Norm(value) => Ok(value), + VertexAttributeValues::Sint16x2(value) => Ok(value), + VertexAttributeValues::Snorm16x2(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -227,7 +227,7 @@ impl TryFrom for Vec<[u32; 4]> { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Uint4(value) => Ok(value), + VertexAttributeValues::Uint32x4(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -238,7 +238,7 @@ impl TryFrom for Vec<[i32; 4]> { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Int4(value) => Ok(value), + VertexAttributeValues::Sint32x4(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -249,7 +249,7 @@ impl TryFrom for Vec<[f32; 4]> { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Float4(value) => Ok(value), + VertexAttributeValues::Float32x4(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -260,7 +260,7 @@ impl TryFrom for Vec<[u32; 3]> { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Uint3(value) => Ok(value), + VertexAttributeValues::Uint32x3(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -271,7 +271,7 @@ impl TryFrom for Vec<[i32; 3]> { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Int3(value) => Ok(value), + VertexAttributeValues::Sint32x3(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -282,7 +282,7 @@ impl TryFrom for Vec<[f32; 3]> { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Float3(value) => Ok(value), + VertexAttributeValues::Float32x3(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -293,7 +293,7 @@ impl TryFrom for Vec<[u32; 2]> { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Uint2(value) => Ok(value), + VertexAttributeValues::Uint32x2(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -304,7 +304,7 @@ impl TryFrom for Vec<[i32; 2]> { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Int2(value) => Ok(value), + VertexAttributeValues::Sint32x2(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -315,7 +315,7 @@ impl TryFrom for Vec<[f32; 2]> { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Float2(value) => Ok(value), + VertexAttributeValues::Float32x2(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -326,7 +326,7 @@ impl TryFrom for Vec { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Uint(value) => Ok(value), + VertexAttributeValues::Uint32(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -337,7 +337,7 @@ impl TryFrom for Vec { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Int(value) => Ok(value), + VertexAttributeValues::Sint32(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -348,7 +348,7 @@ impl TryFrom for Vec { fn try_from(value: VertexAttributeValues) -> Result { match value { - VertexAttributeValues::Float(value) => Ok(value), + VertexAttributeValues::Float32(value) => Ok(value), _ => Err(FromVertexAttributeError::new::(value)), } } @@ -513,7 +513,7 @@ mod tests { }; assert_eq!( format!("{}", error), - "cannot convert VertexAttributeValues::Uint4 to alloc::vec::Vec" + "cannot convert VertexAttributeValues::Uint32x4 to alloc::vec::Vec" ); assert_eq!(format!("{:?}", error), "FromVertexAttributeError { from: Uint4([[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]), variant: \"Uint4\", into: \"alloc::vec::Vec\" }"); diff --git a/crates/bevy_render/src/pipeline/vertex_format.rs b/crates/bevy_render/src/pipeline/vertex_format.rs index 750ea83c59a0e..cf1159b2a5967 100644 --- a/crates/bevy_render/src/pipeline/vertex_format.rs +++ b/crates/bevy_render/src/pipeline/vertex_format.rs @@ -3,71 +3,71 @@ use bevy_math::{Mat4, Vec2, Vec3, Vec4}; use serde::{Deserialize, Serialize}; #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] pub enum VertexFormat { - Uchar2 = 1, - Uchar4 = 3, - Char2 = 5, - Char4 = 7, - Uchar2Norm = 9, - Uchar4Norm = 11, - Char2Norm = 14, - Char4Norm = 16, - Ushort2 = 18, - Ushort4 = 20, - Short2 = 22, - Short4 = 24, - Ushort2Norm = 26, - Ushort4Norm = 28, - Short2Norm = 30, - Short4Norm = 32, - Half2 = 34, - Half4 = 36, - Float = 37, - Float2 = 38, - Float3 = 39, - Float4 = 40, - Uint = 41, - Uint2 = 42, - Uint3 = 43, - Uint4 = 44, - Int = 45, - Int2 = 46, - Int3 = 47, - Int4 = 48, + Uint8x2 = 1, + Uint8x4 = 3, + Sint8x2 = 5, + Sint8x4 = 7, + Unorm8x2 = 9, + Unorm8x4 = 11, + Snorm8x2 = 14, + Snorm8x4 = 16, + Uint16x2 = 18, + Uint16x4 = 20, + Sint16x2 = 22, + Sint16x4 = 24, + Unorm16x2 = 26, + Unorm16x4 = 28, + Snorm16x2 = 30, + Snorm16x4 = 32, + Float16x2 = 34, + Float16x4 = 36, + Float32 = 37, + Float32x2 = 38, + Float32x3 = 39, + Float32x4 = 40, + Uint32 = 41, + Uint32x2 = 42, + Uint32x3 = 43, + Uint32x4 = 44, + Sint32 = 45, + Sint32x2 = 46, + Sint32x3 = 47, + Sint32x4 = 48, } impl VertexFormat { pub fn get_size(&self) -> u64 { match *self { - VertexFormat::Uchar2 => 2, - VertexFormat::Uchar4 => 4, - VertexFormat::Char2 => 2, - VertexFormat::Char4 => 4, - VertexFormat::Uchar2Norm => 2, - VertexFormat::Uchar4Norm => 4, - VertexFormat::Char2Norm => 2, - VertexFormat::Char4Norm => 4, - VertexFormat::Ushort2 => 2 * 2, - VertexFormat::Ushort4 => 2 * 4, - VertexFormat::Short2 => 2 * 2, - VertexFormat::Short4 => 2 * 4, - VertexFormat::Ushort2Norm => 2 * 2, - VertexFormat::Ushort4Norm => 2 * 4, - VertexFormat::Short2Norm => 2 * 2, - VertexFormat::Short4Norm => 2 * 4, - VertexFormat::Half2 => 2 * 2, - VertexFormat::Half4 => 2 * 4, - VertexFormat::Float => 4, - VertexFormat::Float2 => 4 * 2, - VertexFormat::Float3 => 4 * 3, - VertexFormat::Float4 => 4 * 4, - VertexFormat::Uint => 4, - VertexFormat::Uint2 => 4 * 2, - VertexFormat::Uint3 => 4 * 3, - VertexFormat::Uint4 => 4 * 4, - VertexFormat::Int => 4, - VertexFormat::Int2 => 4 * 2, - VertexFormat::Int3 => 4 * 3, - VertexFormat::Int4 => 4 * 4, + VertexFormat::Uint8x2 => 2, + VertexFormat::Uint8x4 => 4, + VertexFormat::Sint8x2 => 2, + VertexFormat::Sint8x4 => 4, + VertexFormat::Unorm8x2 => 2, + VertexFormat::Unorm8x4 => 4, + VertexFormat::Snorm8x2 => 2, + VertexFormat::Snorm8x4 => 4, + VertexFormat::Uint16x2 => 2 * 2, + VertexFormat::Uint16x4 => 2 * 4, + VertexFormat::Sint16x2 => 2 * 2, + VertexFormat::Sint16x4 => 2 * 4, + VertexFormat::Unorm16x2 => 2 * 2, + VertexFormat::Unorm16x4 => 2 * 4, + VertexFormat::Snorm16x2 => 2 * 2, + VertexFormat::Snorm16x4 => 2 * 4, + VertexFormat::Float16x2 => 2 * 2, + VertexFormat::Float16x4 => 2 * 4, + VertexFormat::Float32 => 4, + VertexFormat::Float32x2 => 4 * 2, + VertexFormat::Float32x3 => 4 * 3, + VertexFormat::Float32x4 => 4 * 4, + VertexFormat::Uint32 => 4, + VertexFormat::Uint32x2 => 4 * 2, + VertexFormat::Uint32x3 => 4 * 3, + VertexFormat::Uint32x4 => 4 * 4, + VertexFormat::Sint32 => 4, + VertexFormat::Sint32x2 => 4 * 2, + VertexFormat::Sint32x3 => 4 * 3, + VertexFormat::Sint32x4 => 4 * 4, } } } @@ -78,59 +78,59 @@ pub trait AsVertexFormats { impl AsVertexFormats for f32 { fn as_vertex_formats() -> &'static [VertexFormat] { - &[VertexFormat::Float] + &[VertexFormat::Float32] } } impl AsVertexFormats for Vec2 { fn as_vertex_formats() -> &'static [VertexFormat] { - &[VertexFormat::Float2] + &[VertexFormat::Float32x2] } } impl AsVertexFormats for Vec3 { fn as_vertex_formats() -> &'static [VertexFormat] { - &[VertexFormat::Float3] + &[VertexFormat::Float32x3] } } impl AsVertexFormats for Vec4 { fn as_vertex_formats() -> &'static [VertexFormat] { - &[VertexFormat::Float4] + &[VertexFormat::Float32x4] } } impl AsVertexFormats for Mat4 { fn as_vertex_formats() -> &'static [VertexFormat] { &[ - VertexFormat::Float4, - VertexFormat::Float4, - VertexFormat::Float4, - VertexFormat::Float4, + VertexFormat::Float32x4, + VertexFormat::Float32x4, + VertexFormat::Float32x4, + VertexFormat::Float32x4, ] } } impl AsVertexFormats for Color { fn as_vertex_formats() -> &'static [VertexFormat] { - &[VertexFormat::Float4] + &[VertexFormat::Float32x4] } } impl AsVertexFormats for [f32; 2] { fn as_vertex_formats() -> &'static [VertexFormat] { - &[VertexFormat::Float2] + &[VertexFormat::Float32x2] } } impl AsVertexFormats for [f32; 3] { fn as_vertex_formats() -> &'static [VertexFormat] { - &[VertexFormat::Float3] + &[VertexFormat::Float32x3] } } impl AsVertexFormats for [f32; 4] { fn as_vertex_formats() -> &'static [VertexFormat] { - &[VertexFormat::Float4] + &[VertexFormat::Float32x4] } } diff --git a/crates/bevy_render/src/shader/shader_reflect.rs b/crates/bevy_render/src/shader/shader_reflect.rs index 01c2e619c240d..25e490f1b4fcf 100644 --- a/crates/bevy_render/src/shader/shader_reflect.rs +++ b/crates/bevy_render/src/shader/shader_reflect.rs @@ -269,28 +269,28 @@ fn reflect_vertex_format(type_description: &ReflectTypeDescription) -> VertexFor let width = traits.numeric.scalar.width; match (number_type, traits.numeric.vector.component_count, width) { - (NumberType::UInt, 2, 8) => VertexFormat::Uchar2, - (NumberType::UInt, 4, 8) => VertexFormat::Uchar4, - (NumberType::Int, 2, 8) => VertexFormat::Char2, - (NumberType::Int, 4, 8) => VertexFormat::Char4, - (NumberType::UInt, 2, 16) => VertexFormat::Ushort2, - (NumberType::UInt, 4, 16) => VertexFormat::Ushort4, - (NumberType::Int, 2, 16) => VertexFormat::Short2, - (NumberType::Int, 8, 16) => VertexFormat::Short4, - (NumberType::Float, 2, 16) => VertexFormat::Half2, - (NumberType::Float, 4, 16) => VertexFormat::Half4, - (NumberType::Float, 0, 32) => VertexFormat::Float, - (NumberType::Float, 2, 32) => VertexFormat::Float2, - (NumberType::Float, 3, 32) => VertexFormat::Float3, - (NumberType::Float, 4, 32) => VertexFormat::Float4, - (NumberType::UInt, 0, 32) => VertexFormat::Uint, - (NumberType::UInt, 2, 32) => VertexFormat::Uint2, - (NumberType::UInt, 3, 32) => VertexFormat::Uint3, - (NumberType::UInt, 4, 32) => VertexFormat::Uint4, - (NumberType::Int, 0, 32) => VertexFormat::Int, - (NumberType::Int, 2, 32) => VertexFormat::Int2, - (NumberType::Int, 3, 32) => VertexFormat::Int3, - (NumberType::Int, 4, 32) => VertexFormat::Int4, + (NumberType::UInt, 2, 8) => VertexFormat::Uint8x2, + (NumberType::UInt, 4, 8) => VertexFormat::Uint8x4, + (NumberType::Int, 2, 8) => VertexFormat::Sint8x2, + (NumberType::Int, 4, 8) => VertexFormat::Sint8x4, + (NumberType::UInt, 2, 16) => VertexFormat::Uint16x2, + (NumberType::UInt, 4, 16) => VertexFormat::Uint16x4, + (NumberType::Int, 2, 16) => VertexFormat::Sint16x2, + (NumberType::Int, 8, 16) => VertexFormat::Sint16x4, + (NumberType::Float, 2, 16) => VertexFormat::Float16x2, + (NumberType::Float, 4, 16) => VertexFormat::Float16x4, + (NumberType::Float, 0, 32) => VertexFormat::Float32, + (NumberType::Float, 2, 32) => VertexFormat::Float32x2, + (NumberType::Float, 3, 32) => VertexFormat::Float32x3, + (NumberType::Float, 4, 32) => VertexFormat::Float32x4, + (NumberType::UInt, 0, 32) => VertexFormat::Uint32, + (NumberType::UInt, 2, 32) => VertexFormat::Uint32x2, + (NumberType::UInt, 3, 32) => VertexFormat::Uint32x3, + (NumberType::UInt, 4, 32) => VertexFormat::Uint32x4, + (NumberType::Int, 0, 32) => VertexFormat::Sint32, + (NumberType::Int, 2, 32) => VertexFormat::Sint32x2, + (NumberType::Int, 3, 32) => VertexFormat::Sint32x3, + (NumberType::Int, 4, 32) => VertexFormat::Sint32x4, (number_type, component_count, width) => panic!( "unexpected uniform property format {:?} {} {}", number_type, component_count, width @@ -343,7 +343,7 @@ mod tests { VertexBufferLayout::new_from_attribute( VertexAttribute { name: "Vertex_Position".into(), - format: VertexFormat::Float4, + format: VertexFormat::Float32x4, offset: 0, shader_location: 0, }, @@ -353,7 +353,7 @@ mod tests { VertexBufferLayout::new_from_attribute( VertexAttribute { name: "Vertex_Normal".into(), - format: VertexFormat::Uint4, + format: VertexFormat::Uint32x4, offset: 0, shader_location: 1, }, @@ -363,7 +363,7 @@ mod tests { VertexBufferLayout::new_from_attribute( VertexAttribute { name: "I_TestInstancing_Property".into(), - format: VertexFormat::Uint4, + format: VertexFormat::Uint32x4, offset: 0, shader_location: 2, }, diff --git a/crates/bevy_wgpu/src/wgpu_type_converter.rs b/crates/bevy_wgpu/src/wgpu_type_converter.rs index 2e9d29087ca57..13ec2a86715b5 100644 --- a/crates/bevy_wgpu/src/wgpu_type_converter.rs +++ b/crates/bevy_wgpu/src/wgpu_type_converter.rs @@ -39,36 +39,36 @@ where impl WgpuFrom for wgpu::VertexFormat { fn from(val: VertexFormat) -> Self { match val { - VertexFormat::Uchar2 => wgpu::VertexFormat::Uint8x2, - VertexFormat::Uchar4 => wgpu::VertexFormat::Uint8x4, - VertexFormat::Char2 => wgpu::VertexFormat::Sint8x2, - VertexFormat::Char4 => wgpu::VertexFormat::Sint8x4, - VertexFormat::Uchar2Norm => wgpu::VertexFormat::Unorm8x2, - VertexFormat::Uchar4Norm => wgpu::VertexFormat::Unorm8x4, - VertexFormat::Char2Norm => wgpu::VertexFormat::Snorm8x2, - VertexFormat::Char4Norm => wgpu::VertexFormat::Snorm8x4, - VertexFormat::Ushort2 => wgpu::VertexFormat::Uint16x2, - VertexFormat::Ushort4 => wgpu::VertexFormat::Uint16x4, - VertexFormat::Short2 => wgpu::VertexFormat::Sint16x2, - VertexFormat::Short4 => wgpu::VertexFormat::Sint16x4, - VertexFormat::Ushort2Norm => wgpu::VertexFormat::Unorm16x2, - VertexFormat::Ushort4Norm => wgpu::VertexFormat::Unorm16x4, - VertexFormat::Short2Norm => wgpu::VertexFormat::Snorm16x2, - VertexFormat::Short4Norm => wgpu::VertexFormat::Snorm16x4, - VertexFormat::Half2 => wgpu::VertexFormat::Float16x2, - VertexFormat::Half4 => wgpu::VertexFormat::Float16x4, - VertexFormat::Float => wgpu::VertexFormat::Float32, - VertexFormat::Float2 => wgpu::VertexFormat::Float32x2, - VertexFormat::Float3 => wgpu::VertexFormat::Float32x3, - VertexFormat::Float4 => wgpu::VertexFormat::Float32x4, - VertexFormat::Uint => wgpu::VertexFormat::Uint32, - VertexFormat::Uint2 => wgpu::VertexFormat::Uint32x2, - VertexFormat::Uint3 => wgpu::VertexFormat::Uint32x3, - VertexFormat::Uint4 => wgpu::VertexFormat::Uint32x4, - VertexFormat::Int => wgpu::VertexFormat::Sint32, - VertexFormat::Int2 => wgpu::VertexFormat::Sint32x2, - VertexFormat::Int3 => wgpu::VertexFormat::Sint32x3, - VertexFormat::Int4 => wgpu::VertexFormat::Sint32x4, + VertexFormat::Uint8x2 => wgpu::VertexFormat::Uint8x2, + VertexFormat::Uint8x4 => wgpu::VertexFormat::Uint8x4, + VertexFormat::Sint8x2 => wgpu::VertexFormat::Sint8x2, + VertexFormat::Sint8x4 => wgpu::VertexFormat::Sint8x4, + VertexFormat::Unorm8x2 => wgpu::VertexFormat::Unorm8x2, + VertexFormat::Unorm8x4 => wgpu::VertexFormat::Unorm8x4, + VertexFormat::Snorm8x2 => wgpu::VertexFormat::Snorm8x2, + VertexFormat::Snorm8x4 => wgpu::VertexFormat::Snorm8x4, + VertexFormat::Uint16x2 => wgpu::VertexFormat::Uint16x2, + VertexFormat::Uint16x4 => wgpu::VertexFormat::Uint16x4, + VertexFormat::Sint16x2 => wgpu::VertexFormat::Sint16x2, + VertexFormat::Sint16x4 => wgpu::VertexFormat::Sint16x4, + VertexFormat::Unorm16x2 => wgpu::VertexFormat::Unorm16x2, + VertexFormat::Unorm16x4 => wgpu::VertexFormat::Unorm16x4, + VertexFormat::Snorm16x2 => wgpu::VertexFormat::Snorm16x2, + VertexFormat::Snorm16x4 => wgpu::VertexFormat::Snorm16x4, + VertexFormat::Float16x2 => wgpu::VertexFormat::Float16x2, + VertexFormat::Float16x4 => wgpu::VertexFormat::Float16x4, + VertexFormat::Float32 => wgpu::VertexFormat::Float32, + VertexFormat::Float32x2 => wgpu::VertexFormat::Float32x2, + VertexFormat::Float32x3 => wgpu::VertexFormat::Float32x3, + VertexFormat::Float32x4 => wgpu::VertexFormat::Float32x4, + VertexFormat::Uint32 => wgpu::VertexFormat::Uint32, + VertexFormat::Uint32x2 => wgpu::VertexFormat::Uint32x2, + VertexFormat::Uint32x3 => wgpu::VertexFormat::Uint32x3, + VertexFormat::Uint32x4 => wgpu::VertexFormat::Uint32x4, + VertexFormat::Sint32 => wgpu::VertexFormat::Sint32, + VertexFormat::Sint32x2 => wgpu::VertexFormat::Sint32x2, + VertexFormat::Sint32x3 => wgpu::VertexFormat::Sint32x3, + VertexFormat::Sint32x4 => wgpu::VertexFormat::Sint32x4, } } }