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

Fix renderers can't batch vertices with the same blending parameters in some cases #6366

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

EVAST9919
Copy link
Contributor

Consider the following scenario.
You may assume that these boxes will be batched and drawn in a single draw call, however this is not the case:
master-blending
That's because each DrawNode sets its blending parameters inside Draw method and the problem here is that CompositeDrawNode does the same. But this is not needed since each child will set their own blending later on (which is computed with DrawColourInfo and inherited from the parent), thus making blending update inside composite practically useless.
Result (both boxes drawn together):
pr-blending

@peppy
Copy link
Member

peppy commented Aug 28, 2024

Are those red triangle overlays a new thing you added? If you can make that available via the draw vis or otherwise that seems super helpful to see where batching is being broken. ie. they are drawn across the whole screen content, colour changes for each batch game-wide.

Copy link
Contributor

@smoogipoo smoogipoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me, can't immediately imagine a breaking scenario.

@smoogipoo smoogipoo merged commit a4a2b68 into ppy:master Aug 28, 2024
21 checks passed
@EVAST9919
Copy link
Contributor Author

Are those red triangle overlays a new thing you added? If you can make that available via the draw vis or otherwise that seems super helpful to see where batching is being broken. ie. they are drawn across the whole screen content, colour changes for each batch game-wide.

I'm using NVIDIA Nsight Graphics for draw calls inspection. I agree that it would be nice to have something similar inside the framework, however at the current moment I have no idea if that's possible. I will take a look though.

@EVAST9919 EVAST9919 deleted the blending-test branch August 28, 2024 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants