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

[Core] Allow RenderCommands to be returned as "batched" or "sorted" #184

Open
bungoboingo opened this issue Jan 11, 2025 · 1 comment
Open

Comments

@bungoboingo
Copy link

bungoboingo commented Jan 11, 2025

Based on some discussions from the Clay discord, it would be helpful if Clay returned RenderCommands in batches based on their major z-index. This will allow GPU renderers to be more efficient and instance draw primitives from each batch.

Clay can either expose the z-index from FloatingElementConfig and let the renderer implementation do its own intermediate batching, or, as discussed in the Discord, add a configuration option to allow RenderCommands to be returned as "batched" (by major z-index) or "sorted" (current behavior).

Within these batched render commands, it would also be helpful if each primitive was sorted by type, not layout order. E.g. the batch would first return all rectangles, then all text, then all images, etc., though the render implementation can also just do intermediate groupings as well, so its not completely necessary, just would be helpful!

@nicbarker nicbarker changed the title Allow RenderCommands to be returned as "batched" or "sorted" [Core] Allow RenderCommands to be returned as "batched" or "sorted" Jan 11, 2025
@nicbarker
Copy link
Owner

Thanks for reporting this! Should be looked at in the next week or so.

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

No branches or pull requests

2 participants