mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Merge #48
48: Exposing `set_viewport_rect()` on `RenderPass`. r=kvark a=seivan Noticed that while viewport work with floats, scissors only work with unsigned integers. Not sure if relevant but [`width & height`](https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glViewport.xml) might not be able to be negative. Co-authored-by: Seivan Heidari <seivan.heidari@icloud.com>
This commit is contained in:
@@ -1165,6 +1165,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.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user