Add staging belt fix
This commit is contained in:
parent
9a2c78c405
commit
c719091c3d
12
Cargo.toml
12
Cargo.toml
@ -11,6 +11,18 @@ readme = "README.md"
|
|||||||
keywords = ["gui", "ui", "graphics", "interface", "widgets"]
|
keywords = ["gui", "ui", "graphics", "interface", "widgets"]
|
||||||
categories = ["gui"]
|
categories = ["gui"]
|
||||||
|
|
||||||
|
[patch."https://github.com/gfx-rs/wgpu"]
|
||||||
|
wgpu-types = { git = "https://github.com/Dispersia/wgpu" }
|
||||||
|
wgpu-core = { git = "https://github.com/Dispersia/wgpu" }
|
||||||
|
|
||||||
|
[patch."https://github.com/gfx-rs/wgpu-rs"]
|
||||||
|
wgpu = { git = "https://github.com/Dispersia/wgpu-rs" }
|
||||||
|
|
||||||
|
[patch.crates-io]
|
||||||
|
wgpu-types = { git = "https://github.com/Dispersia/wgpu" }
|
||||||
|
wgpu-core = { git = "https://github.com/Dispersia/wgpu" }
|
||||||
|
wgpu = { git = "https://github.com/Dispersia/wgpu-rs" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["wgpu", "default_system_font"]
|
default = ["wgpu", "default_system_font"]
|
||||||
# Enables the `iced_wgpu` renderer
|
# Enables the `iced_wgpu` renderer
|
||||||
|
@ -26,8 +26,8 @@ qr_code = ["iced_graphics/qr_code"]
|
|||||||
default_system_font = ["iced_graphics/font-source"]
|
default_system_font = ["iced_graphics/font-source"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wgpu = {git = "https://github.com/gfx-rs/wgpu-rs", rev = "53600ecd834893ef3e90458c48b84f2582d6c343"}
|
wgpu = {git="https://github.com/Dispersia/wgpu-rs"}
|
||||||
wgpu_glyph = {git = "https://github.com/Dispersia/wgpu_glyph", branch = "update-wgpu"}
|
wgpu_glyph = {git="https://github.com/Dispersia/wgpu_glyph", branch = "update-wgpu"}
|
||||||
glyph_brush = "0.7"
|
glyph_brush = "0.7"
|
||||||
raw-window-handle = "0.3"
|
raw-window-handle = "0.3"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
@ -127,11 +127,14 @@ impl Pipeline {
|
|||||||
bind_group_layouts: &[&constants_layout],
|
bind_group_layouts: &[&constants_layout],
|
||||||
});
|
});
|
||||||
|
|
||||||
let shader = device.create_shader_module(&wgpu::ShaderModuleDescriptor {
|
let shader =
|
||||||
label: Some("iced_wgpu::triangle::shader"),
|
device.create_shader_module(&wgpu::ShaderModuleDescriptor {
|
||||||
source: wgpu::ShaderSource::Wgsl(std::borrow::Cow::Borrowed(include_str!("shader/triangle.wgsl"))),
|
label: Some("iced_wgpu::triangle::shader"),
|
||||||
flags: wgpu::ShaderFlags::all()
|
source: wgpu::ShaderSource::Wgsl(std::borrow::Cow::Borrowed(
|
||||||
});
|
include_str!("shader/triangle.wgsl"),
|
||||||
|
)),
|
||||||
|
flags: wgpu::ShaderFlags::all(),
|
||||||
|
});
|
||||||
|
|
||||||
let pipeline =
|
let pipeline =
|
||||||
device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||||
@ -303,8 +306,6 @@ impl Pipeline {
|
|||||||
vertex_buffer.copy_from_slice(vertices);
|
vertex_buffer.copy_from_slice(vertices);
|
||||||
}
|
}
|
||||||
|
|
||||||
println!("Indices: {} - Index Size: {}", indices_size, self.index_buffer.size);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
let mut index_buffer = staging_belt.write_buffer(
|
let mut index_buffer = staging_belt.write_buffer(
|
||||||
encoder,
|
encoder,
|
||||||
@ -366,13 +367,11 @@ impl Pipeline {
|
|||||||
let mut render_pass =
|
let mut render_pass =
|
||||||
encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
|
encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
|
||||||
label: Some("iced_wgpu::triangle render pass"),
|
label: Some("iced_wgpu::triangle render pass"),
|
||||||
color_attachments: &[
|
color_attachments: &[wgpu::RenderPassColorAttachment {
|
||||||
wgpu::RenderPassColorAttachment {
|
view: attachment,
|
||||||
view: attachment,
|
resolve_target,
|
||||||
resolve_target,
|
ops: wgpu::Operations { load, store: true },
|
||||||
ops: wgpu::Operations { load, store: true },
|
}],
|
||||||
},
|
|
||||||
],
|
|
||||||
depth_stencil_attachment: None,
|
depth_stencil_attachment: None,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user