From 24405e8f5e79b96e4fa2033fd0575f96321af4c5 Mon Sep 17 00:00:00 2001 From: Nikita Krupitskas Date: Thu, 9 Jul 2020 23:47:22 +0300 Subject: [PATCH] Version bump to 0.5.1 (#427) --- Cargo.toml | 4 ++-- examples/cube/main.rs | 7 +++++-- src/lib.rs | 29 +++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 445bb770d..ac32551cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wgpu" -version = "0.5.0" +version = "0.5.1" authors = [ "Dzmitry Malyshau ", "Joshua Groves ", @@ -30,7 +30,7 @@ version = "0.5" [dependencies.wgc] package = "wgpu-core" -version = "0.5" +version = "0.5.6" #git = "https://github.com/gfx-rs/wgpu" [dependencies.wgt] diff --git a/examples/cube/main.rs b/examples/cube/main.rs index ebcc3980a..a4b56d2fd 100644 --- a/examples/cube/main.rs +++ b/examples/cube/main.rs @@ -351,11 +351,14 @@ impl framework::Example for Example { }], depth_stencil_attachment: None, }); + rpass.push_debug_group("Prepare data for draw."); rpass.set_pipeline(&self.pipeline); rpass.set_bind_group(0, &self.bind_group, &[]); - rpass.set_index_buffer(&self.index_buf, 0,0 ); + rpass.set_index_buffer(&self.index_buf, 0, 0); rpass.set_vertex_buffer(0, &self.vertex_buf, 0, 0); - rpass.draw_indexed(0 .. self.index_count as u32, 0, 0 .. 1); + rpass.pop_debug_group(); + rpass.insert_debug_marker("Draw!"); + rpass.draw_indexed(0..self.index_count as u32, 0, 0..1); } encoder.finish() diff --git a/src/lib.rs b/src/lib.rs index 729074915..55d392caf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1485,6 +1485,35 @@ impl<'a> RenderPass<'a> { } } + /// Inserts debug marker. + pub fn insert_debug_marker(&mut self, label: &str) { + unsafe { + wgn::wgpu_render_pass_insert_debug_marker( + self.id.as_mut().unwrap(), + label.as_ptr() as *const i8, + 0, + ); + } + } + + /// Start record commands and group it into debug marker group. + pub fn push_debug_group(&mut self, label: &str) { + unsafe { + wgn::wgpu_render_pass_push_debug_group( + self.id.as_mut().unwrap(), + label.as_ptr() as *const i8, + 0, + ); + } + } + + /// Stops command recording and creates debug group. + pub fn pop_debug_group(&mut self) { + unsafe { + wgn::wgpu_render_pass_pop_debug_group(self.id.as_mut().unwrap()); + } + } + /// Draws indexed primitives using the active index buffer and the active vertex buffers. /// /// The active index buffer can be set with [`RenderPass::set_index_buffer`], while the active