Skip to content
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

Conversation

StarArawn
Copy link
Contributor

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.

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Dec 14, 2021
@mockersf mockersf added A-Rendering Drawing game state to the screen C-Enhancement A new feature and removed S-Needs-Triage This issue needs to be labelled labels Dec 14, 2021
@cart
Copy link
Member

cart commented Dec 17, 2021

bors r+

@jakobhellermann
Copy link
Contributor

Since the TrackedRenderPass is reused for all draw functions, does that mean that setting the scissor rect in one draw function will also set it for all subsequent ones? That seems unexpected.

bors bot pushed a commit that referenced this pull request Dec 17, 2021
# 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.
@bors bors bot changed the title Added set_scissor_rect to tracked render pass. [Merged by Bors] - Added set_scissor_rect to tracked render pass. Dec 17, 2021
@bors bors bot closed this Dec 17, 2021
@StarArawn
Copy link
Contributor Author

Since the TrackedRenderPass is reused for all draw functions, does that mean that setting the scissor rect in one draw function will also set it for all subsequent ones? That seems unexpected.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Enhancement A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants