-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Added set_scissor_rect to tracked render pass. #3320
[Merged by Bors] - Added set_scissor_rect to tracked render pass. #3320
Conversation
bors r+ |
Since the |
# 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.
I used the same wording exactly as the wgpu documentation. It is a little strange with bevy's draw system and perhaps a new PR could address updating the documentation to be a bit more clear on that. I don't think we should clear out the scissor pass state in-between draw functions because it would likely slow things down. It would also require people to set scissor state for each draw call which is slower from a performance view point. |
Objective And Solution
Add
set_scissor_rect
from wgpu-rs to theTrackedRenderPass
. 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.