Added set_scissor_rect to tracked render pass. (#3320)

# Objective And Solution
Add `set_scissor_rect` from wgpu-rs to the `TrackedRenderPass`. wgpu documentation can be found here:
https://docs.rs/wgpu/latest/wgpu/struct.RenderPass.html#method.set_scissor_rect

The reason for adding this is to cull fragments that are outside of the given rect. For my purposes this is extremely useful for UI.
This commit is contained in:
John 2021-12-17 22:26:59 +00:00
parent 7356f1586d
commit 9a16a4d018

View file

@ -228,4 +228,11 @@ impl<'a> TrackedRenderPass<'a> {
self.pass.set_stencil_reference(reference); self.pass.set_stencil_reference(reference);
} }
/// Sets the scissor region.
/// Subsequent draw calls will discard any fragments that fall outside this region.
pub fn set_scissor_rect(&mut self, x: u32, y: u32, width: u32, height: u32) {
debug!("set_scissor_rect: {} {} {} {}", x, y, width, height);
self.pass.set_scissor_rect(x, y, width, height);
}
} }