mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 06:30:19 +00:00
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:
parent
7356f1586d
commit
9a16a4d018
1 changed files with 7 additions and 0 deletions
|
@ -228,4 +228,11 @@ impl<'a> TrackedRenderPass<'a> {
|
|||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue