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

Don't draw PassFeedbackN if N is the final pass and not read. #124

Merged
merged 2 commits into from
Sep 15, 2024

Conversation

chyyran
Copy link
Member

@chyyran chyyran commented Sep 15, 2024

#117 fixes the problem of PassFeedback0 being unwritten if it is last frame. However many shaders don't need to use PassFeedback at all, and drawing twice is not zero-cost unlike feedback for other frames which is just a mem swap.

This does some reflection to determine if the last feedback pass is ever read, and only to draw to the output_texture framebuffer if needed. This allows the final pass to be zero-cost again unless it's needed to be read.

Further optimizations could be applied narrowly to the case by adding an implicit blit pass so the final pass is only drawn once.

@chyyran chyyran force-pushed the skip-final-pass-if-unneeded branch from 648b046 to dffbfe8 Compare September 15, 2024 19:24
@chyyran chyyran force-pushed the skip-final-pass-if-unneeded branch from dffbfe8 to cf00f87 Compare September 15, 2024 19:28
@chyyran chyyran mentioned this pull request Sep 15, 2024
@chyyran chyyran merged commit d6f8950 into master Sep 15, 2024
20 checks passed
@chyyran chyyran deleted the skip-final-pass-if-unneeded branch September 27, 2024 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant