diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index 63ffa4df27..4ea6c2b551 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -26,20 +26,20 @@ webgl = ["wgc"] [target.'cfg(not(target_arch = "wasm32"))'.dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "ce4668a7ac6a2cd43e0081166f6d0b7c4b7c2cde" +rev = "ecbddedfaf67299bc2c507f69d138b2c3e3226b3" features = ["raw-window-handle", "cross"] [target.'cfg(target_arch = "wasm32")'.dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "ce4668a7ac6a2cd43e0081166f6d0b7c4b7c2cde" +rev = "ecbddedfaf67299bc2c507f69d138b2c3e3226b3" features = ["raw-window-handle", "cross"] optional = true [dependencies.wgt] package = "wgpu-types" git = "https://github.com/gfx-rs/wgpu" -rev = "ce4668a7ac6a2cd43e0081166f6d0b7c4b7c2cde" +rev = "ecbddedfaf67299bc2c507f69d138b2c3e3226b3" [dependencies] arrayvec = "0.5" diff --git a/wgpu/examples/README.md b/wgpu/examples/README.md index 3174616ea3..e1740072e6 100644 --- a/wgpu/examples/README.md +++ b/wgpu/examples/README.md @@ -41,6 +41,7 @@ All framework-based examples render to the window. | - polygon mode | | :star: | | | | | | | | - queries | | | :star: | | | | | | | *integrations* | | | | | | | | | +| - staging belt | | | | | | | | | | - typed arena | | | | | | | | | | - obj loading | | | | | | :star: | | | diff --git a/wgpu/examples/boids/main.rs b/wgpu/examples/boids/main.rs index 7269577044..0a40797643 100644 --- a/wgpu/examples/boids/main.rs +++ b/wgpu/examples/boids/main.rs @@ -137,12 +137,12 @@ impl framework::Example for Example { wgpu::VertexBufferLayout { array_stride: 4 * 4, step_mode: wgpu::InputStepMode::Instance, - attributes: &wgpu::vertex_attr_array![0 => Float2, 1 => Float2], + attributes: &wgpu::vertex_attr_array![0 => Float32x2, 1 => Float32x2], }, wgpu::VertexBufferLayout { array_stride: 2 * 4, step_mode: wgpu::InputStepMode::Vertex, - attributes: &wgpu::vertex_attr_array![2 => Float2], + attributes: &wgpu::vertex_attr_array![2 => Float32x2], }, ], }, diff --git a/wgpu/examples/cube/main.rs b/wgpu/examples/cube/main.rs index 36b62ca061..b923f18aa8 100644 --- a/wgpu/examples/cube/main.rs +++ b/wgpu/examples/cube/main.rs @@ -266,12 +266,12 @@ impl framework::Example for Example { step_mode: wgpu::InputStepMode::Vertex, attributes: &[ wgpu::VertexAttribute { - format: wgpu::VertexFormat::Float4, + format: wgpu::VertexFormat::Float32x4, offset: 0, shader_location: 0, }, wgpu::VertexAttribute { - format: wgpu::VertexFormat::Float2, + format: wgpu::VertexFormat::Float32x2, offset: 4 * 4, shader_location: 1, }, diff --git a/wgpu/examples/msaa-line/main.rs b/wgpu/examples/msaa-line/main.rs index 2a77871352..666f8f971d 100644 --- a/wgpu/examples/msaa-line/main.rs +++ b/wgpu/examples/msaa-line/main.rs @@ -54,7 +54,7 @@ impl Example { buffers: &[wgpu::VertexBufferLayout { array_stride: std::mem::size_of::() as wgpu::BufferAddress, step_mode: wgpu::InputStepMode::Vertex, - attributes: &wgpu::vertex_attr_array![0 => Float2, 1 => Float4], + attributes: &wgpu::vertex_attr_array![0 => Float32x2, 1 => Float32x4], }], }, fragment: Some(wgpu::FragmentState { diff --git a/wgpu/examples/shadow/main.rs b/wgpu/examples/shadow/main.rs index b00a83022d..3b64bd08ea 100644 --- a/wgpu/examples/shadow/main.rs +++ b/wgpu/examples/shadow/main.rs @@ -412,7 +412,7 @@ impl framework::Example for Example { mapped_at_creation: false, }); - let vertex_attr = wgpu::vertex_attr_array![0 => Char4, 1 => Char4]; + let vertex_attr = wgpu::vertex_attr_array![0 => Sint8x4, 1 => Sint8x4]; let vb_desc = wgpu::VertexBufferLayout { array_stride: vertex_size as wgpu::BufferAddress, step_mode: wgpu::InputStepMode::Vertex, diff --git a/wgpu/examples/skybox/main.rs b/wgpu/examples/skybox/main.rs index 092ff1749c..fd777e91ee 100644 --- a/wgpu/examples/skybox/main.rs +++ b/wgpu/examples/skybox/main.rs @@ -222,7 +222,7 @@ impl framework::Example for Skybox { buffers: &[wgpu::VertexBufferLayout { array_stride: std::mem::size_of::() as wgpu::BufferAddress, step_mode: wgpu::InputStepMode::Vertex, - attributes: &wgpu::vertex_attr_array![0 => Float3, 1 => Float3], + attributes: &wgpu::vertex_attr_array![0 => Float32x3, 1 => Float32x3], }], }, fragment: Some(wgpu::FragmentState { diff --git a/wgpu/examples/texture-arrays/main.rs b/wgpu/examples/texture-arrays/main.rs index 8ef4d6b331..26b5bf1d04 100644 --- a/wgpu/examples/texture-arrays/main.rs +++ b/wgpu/examples/texture-arrays/main.rs @@ -260,7 +260,7 @@ impl framework::Example for Example { buffers: &[wgpu::VertexBufferLayout { array_stride: vertex_size as wgpu::BufferAddress, step_mode: wgpu::InputStepMode::Vertex, - attributes: &wgpu::vertex_attr_array![0 => Float2, 1 => Float2, 2 => Int], + attributes: &wgpu::vertex_attr_array![0 => Float32x2, 1 => Float32x2, 2 => Sint32], }], }, fragment: Some(wgpu::FragmentState { diff --git a/wgpu/examples/water/main.rs b/wgpu/examples/water/main.rs index 2fa86b05d5..f9c7f1b10f 100644 --- a/wgpu/examples/water/main.rs +++ b/wgpu/examples/water/main.rs @@ -513,7 +513,7 @@ impl framework::Example for Example { buffers: &[wgpu::VertexBufferLayout { array_stride: water_vertex_size as wgpu::BufferAddress, step_mode: wgpu::InputStepMode::Vertex, - attributes: &wgpu::vertex_attr_array![0 => Short2, 1 => Char4], + attributes: &wgpu::vertex_attr_array![0 => Sint16x2, 1 => Sint8x4], }], }, // Fragment shader and output targets @@ -577,7 +577,7 @@ impl framework::Example for Example { buffers: &[wgpu::VertexBufferLayout { array_stride: terrain_vertex_size as wgpu::BufferAddress, step_mode: wgpu::InputStepMode::Vertex, - attributes: &wgpu::vertex_attr_array![0 => Float3, 1 => Float3, 2 => Uchar4Norm], + attributes: &wgpu::vertex_attr_array![0 => Float32x3, 1 => Float32x3, 2 => Unorm8x4], }], }, fragment: Some(wgpu::FragmentState { diff --git a/wgpu/src/backend/web.rs b/wgpu/src/backend/web.rs index dd205d0569..81d04017f0 100644 --- a/wgpu/src/backend/web.rs +++ b/wgpu/src/backend/web.rs @@ -647,40 +647,40 @@ fn map_vertex_format(format: wgt::VertexFormat) -> web_sys::GpuVertexFormat { use web_sys::GpuVertexFormat as vf; use wgt::VertexFormat; match format { - VertexFormat::Uchar2 => vf::Uchar2, - VertexFormat::Uchar4 => vf::Uchar4, - VertexFormat::Char2 => vf::Char2, - VertexFormat::Char4 => vf::Char4, - VertexFormat::Uchar2Norm => vf::Uchar2norm, - VertexFormat::Uchar4Norm => vf::Uchar4norm, - VertexFormat::Char2Norm => vf::Char2norm, - VertexFormat::Char4Norm => vf::Char4norm, - VertexFormat::Ushort2 => vf::Ushort2, - VertexFormat::Ushort4 => vf::Ushort4, - VertexFormat::Short2 => vf::Short2, - VertexFormat::Short4 => vf::Short4, - VertexFormat::Ushort2Norm => vf::Ushort2norm, - VertexFormat::Ushort4Norm => vf::Ushort4norm, - VertexFormat::Short2Norm => vf::Short2norm, - VertexFormat::Short4Norm => vf::Short4norm, - VertexFormat::Half2 => vf::Half2, - VertexFormat::Half4 => vf::Half4, - VertexFormat::Float => vf::Float, - VertexFormat::Float2 => vf::Float2, - VertexFormat::Float3 => vf::Float3, - VertexFormat::Float4 => vf::Float4, - VertexFormat::Uint => vf::Uint, - VertexFormat::Uint2 => vf::Uint2, - VertexFormat::Uint3 => vf::Uint3, - VertexFormat::Uint4 => vf::Uint4, - VertexFormat::Int => vf::Int, - VertexFormat::Int2 => vf::Int2, - VertexFormat::Int3 => vf::Int3, - VertexFormat::Int4 => vf::Int4, - VertexFormat::Double - | VertexFormat::Double2 - | VertexFormat::Double3 - | VertexFormat::Double4 => { + VertexFormat::Uint8x2 => vf::Uchar2, + VertexFormat::Uint8x4 => vf::Uchar4, + VertexFormat::Sint8x2 => vf::Char2, + VertexFormat::Sint8x4 => vf::Char4, + VertexFormat::Unorm8x2 => vf::Uchar2norm, + VertexFormat::Unorm8x4 => vf::Uchar4norm, + VertexFormat::Snorm8x2 => vf::Char2norm, + VertexFormat::Snorm8x4 => vf::Char4norm, + VertexFormat::Uint16x2 => vf::Ushort2, + VertexFormat::Uint16x4 => vf::Ushort4, + VertexFormat::Sint16x2 => vf::Short2, + VertexFormat::Sint16x4 => vf::Short4, + VertexFormat::Unorm16x2 => vf::Ushort2norm, + VertexFormat::Unorm16x4 => vf::Ushort4norm, + VertexFormat::Snorm16x2 => vf::Short2norm, + VertexFormat::Snorm16x4 => vf::Short4norm, + VertexFormat::Float16x2 => vf::Half2, + VertexFormat::Float16x4 => vf::Half4, + VertexFormat::Float32 => vf::Float, + VertexFormat::Float32x2 => vf::Float2, + VertexFormat::Float32x3 => vf::Float3, + VertexFormat::Float32x4 => vf::Float4, + VertexFormat::Uint32 => vf::Uint, + VertexFormat::Uint32x2 => vf::Uint2, + VertexFormat::Uint32x3 => vf::Uint3, + VertexFormat::Uint32x4 => vf::Uint4, + VertexFormat::Sint32 => vf::Int, + VertexFormat::Sint32x2 => vf::Int2, + VertexFormat::Sint32x3 => vf::Int3, + VertexFormat::Sint32x4 => vf::Int4, + VertexFormat::Float64 + | VertexFormat::Float64x2 + | VertexFormat::Float64x3 + | VertexFormat::Float64x4 => { panic!("VERTEX_ATTRIBUTE_64BIT feature must be enabled to use Double formats") } } diff --git a/wgpu/src/macros.rs b/wgpu/src/macros.rs index d5a7dd0f01..c15c1a7850 100644 --- a/wgpu/src/macros.rs +++ b/wgpu/src/macros.rs @@ -5,7 +5,7 @@ /// Output has type: `[VertexAttribute; _]`. Usage is as follows: /// ``` /// # use wgpu::vertex_attr_array; -/// let attrs = vertex_attr_array![0 => Float2, 1 => Float, 2 => Ushort4]; +/// let attrs = vertex_attr_array![0 => Float32x2, 1 => Float32, 2 => Uint16x4]; /// ``` /// This example specifies a list of three [VertexAttribute](crate::VertexAttribute), /// each with the given `shader_location` and `format`. @@ -32,7 +32,7 @@ macro_rules! vertex_attr_array { #[test] fn test_vertex_attr_array() { - let attrs = vertex_attr_array![0 => Float2, 3 => Ushort4]; + let attrs = vertex_attr_array![0 => Float32x2, 3 => Uint16x4]; // VertexAttribute does not support PartialEq, so we cannot test directly assert_eq!(attrs.len(), 2); assert_eq!(attrs[0].offset, 0);