From ca74b3fbac0dd6d05639fbd33e6e55c309f9feda Mon Sep 17 00:00:00 2001 From: Seivan Heidari Date: Mon, 29 Jul 2019 11:14:28 +0200 Subject: [PATCH] [rs] Exposing `set_viewport()` on `RenderPass`. --- wgpu/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index 80eb52874d..76d66e7c17 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -1172,6 +1172,13 @@ impl<'a> RenderPass<'a> { pub fn set_scissor_rect(&mut self, x: u32, y: u32, w: u32, h: u32) { wgn::wgpu_render_pass_set_scissor_rect(self.id, x, y, w, h) } + + /// Sets the viewport region. + /// + /// Subsequent draw calls will draw any fragments in this region. + pub fn set_viewport(&mut self, x: f32, y: f32, w: f32, h: f32, min_depth: f32, max_depth: f32) { + wgn::wgpu_render_pass_set_viewport(self.id, x, y, w, h, min_depth, max_depth) + } /// Sets the stencil reference. ///