-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Early out when there's no image to replace in tonemapping example update_image_viewer #11515
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alice-i-cecile
added
C-Bug
An unexpected or incorrect behavior
A-Rendering
Drawing game state to the screen
labels
Jan 24, 2024
alice-i-cecile
approved these changes
Jan 24, 2024
Added an alternative PR for your consideration here: #11519 But I can confirm that this PR doesn't break anything and seems to do what it says. |
I agree that this could be written better, I just figure its easier to get a very simple obvious fix merged for 0.13 than a more involved rewrite. I'll check over your PR later but at first glance it looks good |
Sure, not fussed at all if this is merged first. |
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jan 27, 2024
…11519) # Objective Alternative to #11515. Fixes change detection being triggered on the "image viewer image material" every frame. ## Solution - Split the megasystem into two separate systems: one to handle drop events, and one to handle asset change events. - Move the event reader iteration "outside." so that we're only doing stuff when there are events. - Flatten some of the more extreme nesting - Other bits of cleanup, removing an unnecessary clone and unused variable. I think these systems can even run in parallel now, not that it particularly matters.
tjamaan
pushed a commit
to tjamaan/bevy
that referenced
this pull request
Feb 6, 2024
…evyengine#11519) # Objective Alternative to bevyengine#11515. Fixes change detection being triggered on the "image viewer image material" every frame. ## Solution - Split the megasystem into two separate systems: one to handle drop events, and one to handle asset change events. - Move the event reader iteration "outside." so that we're only doing stuff when there are events. - Flatten some of the more extreme nesting - Other bits of cleanup, removing an unnecessary clone and unused variable. I think these systems can even run in parallel now, not that it particularly matters.
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-Bug
An unexpected or incorrect behavior
C-Examples
An addition or correction to our examples
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
update_image_viewer is iterating over every mesh material in the scene calling get_mut on the material every frame, and not doing anything with it unless theres an image event to replace the image in the material with. this triggers change detection unconditionally every single frame on every single mesh's material, which is obliterating performance.
Solution
early out when there's no image event
Unblocks #10610