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

Made drawcalls batching search depth adjustable #809

Closed

Conversation

yui-915
Copy link
Contributor

@yui-915 yui-915 commented Sep 12, 2024

drawcalls batching now searches a set depth instead of only looking at the last drawcall
default depth is 1 so it shouldn't effect anything
users who want to trade cpu cycles for potentially better batching (therefore more fps) can increase the search depth
by calling macroquad::window::gl_set_drawcalls_batching_search_depth()

this PR aims to solve the altering textures issue described in #805
but more focused on the drawcalls count rather than the allocated memory (it still helps by reducing the buffers count)

this is more of a workaround rather than a proper fix, until a better batching system is implemented

@InnocentusLime
Copy link
Contributor

I am concerned it might have an effect on the draw order. Let's say we have two draw calls at some point in time:

[DC1, DC2]

When I do

draw_texture(0.0, 0.0, 32.0, 32.0, WHITE, &ferris);

I expect ferris to be drawn on top of everything else. But if its draw call gets batched to DC1 -- ferris will be drawn before DC2.

This could be okay for 3D environments as they rely primarily on depth-testing (as far as I am concerned), but may not be perfect for 2D 🤔

@yui-915 yui-915 marked this pull request as draft September 12, 2024 22:26
@yui-915
Copy link
Contributor Author

yui-915 commented Sep 12, 2024

apparently, ferris doesn't even get drawn ....
the recent changes to how drawcalls vertices and indices assumes what the drawcall being modified is the most recent one (prior to this pr, this was always the case)
but now I broke everything :D

imma close this as it's probably not worth fixing (will require re-implementing alot of things in quad_gl.rs)

@yui-915 yui-915 closed this Sep 12, 2024
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.

2 participants