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

Track render targets to avoid unnecessary composites #2679

Closed
wants to merge 1 commit into from

Conversation

jellysquid3
Copy link
Member

The entity outline buffer is always composited into the final image, even if it wasn't rendered to. This accounts for a significant amount of the frame render time on the GPU (up to 5%) and can be avoided when there are no entity outlines.

Unfortunately, it's difficult to find an injection site where we can track whether the entity outline render target is modified. And there are conditions (other than using the VertexBuffer class to draw) where a mod could potentially modify the entity outline buffer. So this is not guaranteed to be robust in all situations, even if those situations are very unlikely.

@jellysquid3
Copy link
Member Author

Minecraft 1.21.2 makes some changes around how render targets are bound, which makes it easier to track if the entity outline buffer is getting touched. So it would probably be easier to just wait until that lands, rather than hack it in ourselves.

@jellysquid3
Copy link
Member Author

Actually, it seems like Minecraft 1.21.2 might already implement something like this, so it probably won't be necessary to even bother. I'll just close this pull request for now.

@jellysquid3 jellysquid3 deleted the patch/track-render-targets branch October 26, 2024 01:55
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