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

Draw order optimizations #1535

Open
heinezen opened this issue Sep 16, 2023 · 1 comment
Open

Draw order optimizations #1535

heinezen opened this issue Sep 16, 2023 · 1 comment
Labels
area: renderer Concerns our graphics renderer improvement Enhancement of an existing component lang: c++ Done in C++ code

Comments

@heinezen
Copy link
Member

heinezen commented Sep 16, 2023

Objects in a render pass should be ordered in such a way that they don't require expensive state switches. We can minimize the changes by clever ordering of objects by

  1. render target
  2. shader program
  3. texture bindings
  4. vertex format
  5. uniform buffer bindings
  6. vertex bindings
  7. uniform updates

Sorting should happen on-the-fly, i.e. during insertion/removal of new renderables to a render pass.

There is an overview from this talk that shows the estimated cost for each switch:

state_change_cost

@heinezen heinezen added improvement Enhancement of an existing component area: renderer Concerns our graphics renderer lang: c++ Done in C++ code labels Sep 16, 2023
@TheJJ
Copy link
Member

TheJJ commented Sep 17, 2023

probably each thing just has a priority and we use our heap to get elements one after the other. but it gets trickier due do the dependencies between these actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: renderer Concerns our graphics renderer improvement Enhancement of an existing component lang: c++ Done in C++ code
Projects
Status: 🔖 TODO
Development

No branches or pull requests

2 participants