summaryrefslogtreecommitdiffstats
path: root/wgpu
diff options
context:
space:
mode:
authorLibravatar Dispersia <dispersias@gmail.com>2021-04-12 22:06:16 -0700
committerLibravatar Dispersia <dispersias@gmail.com>2021-04-12 22:06:16 -0700
commitc719091c3d7b5f71899530437fde9b512bc2b0f3 (patch)
tree9426b5f2d6b74e7f1254ccd0bb64af246368fad9 /wgpu
parent9a2c78c4059d2be37d10adda397fb6e64f38ac02 (diff)
downloadiced-c719091c3d7b5f71899530437fde9b512bc2b0f3.tar.gz
iced-c719091c3d7b5f71899530437fde9b512bc2b0f3.tar.bz2
iced-c719091c3d7b5f71899530437fde9b512bc2b0f3.zip
Add staging belt fix
Diffstat (limited to 'wgpu')
-rw-r--r--wgpu/Cargo.toml4
-rw-r--r--wgpu/src/triangle.rs27
2 files changed, 15 insertions, 16 deletions
diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml
index 28927638..f44b3874 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 = {git = "https://github.com/gfx-rs/wgpu-rs", rev = "53600ecd834893ef3e90458c48b84f2582d6c343"}
-wgpu_glyph = {git = "https://github.com/Dispersia/wgpu_glyph", branch = "update-wgpu"}
+wgpu = {git="https://github.com/Dispersia/wgpu-rs"}
+wgpu_glyph = {git="https://github.com/Dispersia/wgpu_glyph", branch = "update-wgpu"}
glyph_brush = "0.7"
raw-window-handle = "0.3"
log = "0.4"
diff --git a/wgpu/src/triangle.rs b/wgpu/src/triangle.rs
index 168ff953..67f14e4d 100644
--- a/wgpu/src/triangle.rs
+++ b/wgpu/src/triangle.rs
@@ -127,11 +127,14 @@ impl Pipeline {
bind_group_layouts: &[&constants_layout],
});
- let shader = device.create_shader_module(&wgpu::ShaderModuleDescriptor {
- label: Some("iced_wgpu::triangle::shader"),
- source: wgpu::ShaderSource::Wgsl(std::borrow::Cow::Borrowed(include_str!("shader/triangle.wgsl"))),
- flags: wgpu::ShaderFlags::all()
- });
+ let shader =
+ device.create_shader_module(&wgpu::ShaderModuleDescriptor {
+ label: Some("iced_wgpu::triangle::shader"),
+ source: wgpu::ShaderSource::Wgsl(std::borrow::Cow::Borrowed(
+ include_str!("shader/triangle.wgsl"),
+ )),
+ flags: wgpu::ShaderFlags::all(),
+ });
let pipeline =
device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
@@ -303,8 +306,6 @@ impl Pipeline {
vertex_buffer.copy_from_slice(vertices);
}
- println!("Indices: {} - Index Size: {}", indices_size, self.index_buffer.size);
-
{
let mut index_buffer = staging_belt.write_buffer(
encoder,
@@ -366,13 +367,11 @@ impl Pipeline {
let mut render_pass =
encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
label: Some("iced_wgpu::triangle render pass"),
- color_attachments: &[
- wgpu::RenderPassColorAttachment {
- view: attachment,
- resolve_target,
- ops: wgpu::Operations { load, store: true },
- },
- ],
+ color_attachments: &[wgpu::RenderPassColorAttachment {
+ view: attachment,
+ resolve_target,
+ ops: wgpu::Operations { load, store: true },
+ }],
depth_stencil_attachment: None,
});