diff options
| author | 2021-06-22 11:39:18 +0200 | |
|---|---|---|
| committer | 2021-06-22 11:39:18 +0200 | |
| commit | bb6e06127e15e5eb2b95c765488d75f25f8252ef (patch) | |
| tree | 11ec9945e20780eab9dc1c99044e7bdeaaf508a5 | |
| parent | e68da229b384fbe78514dab0b13c8eb4637f4f5d (diff) | |
| parent | a53e7559fe01ee072d4f0533ecf1facec741b9e4 (diff) | |
| download | iced-bb6e06127e15e5eb2b95c765488d75f25f8252ef.tar.gz iced-bb6e06127e15e5eb2b95c765488d75f25f8252ef.tar.bz2 iced-bb6e06127e15e5eb2b95c765488d75f25f8252ef.zip  | |
Merge pull request #925 from PolyMeilex/master
Update `wgpu` to `0.9`
| -rw-r--r-- | wgpu/Cargo.toml | 4 | ||||
| -rw-r--r-- | wgpu/src/image.rs | 34 | ||||
| -rw-r--r-- | wgpu/src/quad.rs | 40 | ||||
| -rw-r--r-- | wgpu/src/triangle.rs | 16 | 
4 files changed, 21 insertions, 73 deletions
diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index 3eacdd0f..9675797d 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -26,8 +26,8 @@ qr_code = ["iced_graphics/qr_code"]  default_system_font = ["iced_graphics/font-source"]  [dependencies] -wgpu = "0.8" -wgpu_glyph = "0.12" +wgpu = "0.9" +wgpu_glyph = "0.13"  glyph_brush = "0.7"  raw-window-handle = "0.3"  log = "0.4" diff --git a/wgpu/src/image.rs b/wgpu/src/image.rs index cd7b3d23..85663bf5 100644 --- a/wgpu/src/image.rs +++ b/wgpu/src/image.rs @@ -165,33 +165,13 @@ impl Pipeline {                          wgpu::VertexBufferLayout {                              array_stride: mem::size_of::<Instance>() as u64,                              step_mode: wgpu::InputStepMode::Instance, -                            attributes: &[ -                                wgpu::VertexAttribute { -                                    shader_location: 1, -                                    format: wgpu::VertexFormat::Float32x2, -                                    offset: 0, -                                }, -                                wgpu::VertexAttribute { -                                    shader_location: 2, -                                    format: wgpu::VertexFormat::Float32x2, -                                    offset: 4 * 2, -                                }, -                                wgpu::VertexAttribute { -                                    shader_location: 3, -                                    format: wgpu::VertexFormat::Float32x2, -                                    offset: 4 * 4, -                                }, -                                wgpu::VertexAttribute { -                                    shader_location: 4, -                                    format: wgpu::VertexFormat::Float32x2, -                                    offset: 4 * 6, -                                }, -                                wgpu::VertexAttribute { -                                    shader_location: 5, -                                    format: wgpu::VertexFormat::Sint32, -                                    offset: 4 * 8, -                                }, -                            ], +                            attributes: &wgpu::vertex_attr_array!( +                                1 => Float32x2, +                                2 => Float32x2, +                                3 => Float32x2, +                                4 => Float32x2, +                                5 => Sint32, +                            ),                          },                      ],                  }, diff --git a/wgpu/src/quad.rs b/wgpu/src/quad.rs index 6f221ca3..93942fba 100644 --- a/wgpu/src/quad.rs +++ b/wgpu/src/quad.rs @@ -87,38 +87,14 @@ impl Pipeline {                          wgpu::VertexBufferLayout {                              array_stride: mem::size_of::<layer::Quad>() as u64,                              step_mode: wgpu::InputStepMode::Instance, -                            attributes: &[ -                                wgpu::VertexAttribute { -                                    shader_location: 1, -                                    format: wgpu::VertexFormat::Float32x2, -                                    offset: 0, -                                }, -                                wgpu::VertexAttribute { -                                    shader_location: 2, -                                    format: wgpu::VertexFormat::Float32x2, -                                    offset: 4 * 2, -                                }, -                                wgpu::VertexAttribute { -                                    shader_location: 3, -                                    format: wgpu::VertexFormat::Float32x4, -                                    offset: 4 * (2 + 2), -                                }, -                                wgpu::VertexAttribute { -                                    shader_location: 4, -                                    format: wgpu::VertexFormat::Float32x4, -                                    offset: 4 * (2 + 2 + 4), -                                }, -                                wgpu::VertexAttribute { -                                    shader_location: 5, -                                    format: wgpu::VertexFormat::Float32, -                                    offset: 4 * (2 + 2 + 4 + 4), -                                }, -                                wgpu::VertexAttribute { -                                    shader_location: 6, -                                    format: wgpu::VertexFormat::Float32, -                                    offset: 4 * (2 + 2 + 4 + 4 + 1), -                                }, -                            ], +                            attributes: &wgpu::vertex_attr_array!( +                                1 => Float32x2, +                                2 => Float32x2, +                                3 => Float32x4, +                                4 => Float32x4, +                                5 => Float32, +                                6 => Float32, +                            ),                          },                      ],                  }, diff --git a/wgpu/src/triangle.rs b/wgpu/src/triangle.rs index 8636b331..65b2b7b0 100644 --- a/wgpu/src/triangle.rs +++ b/wgpu/src/triangle.rs @@ -150,20 +150,12 @@ impl Pipeline {                      buffers: &[wgpu::VertexBufferLayout {                          array_stride: mem::size_of::<Vertex2D>() as u64,                          step_mode: wgpu::InputStepMode::Vertex, -                        attributes: &[ +                        attributes: &wgpu::vertex_attr_array!(                              // Position -                            wgpu::VertexAttribute { -                                shader_location: 0, -                                format: wgpu::VertexFormat::Float32x2, -                                offset: 0, -                            }, +                            0 => Float32x2,                              // Color -                            wgpu::VertexAttribute { -                                shader_location: 1, -                                format: wgpu::VertexFormat::Float32x4, -                                offset: 4 * 2, -                            }, -                        ], +                            1 => Float32x4, +                        ),                      }],                  },                  fragment: Some(wgpu::FragmentState {  | 
