Skip to content

Use bindless descriptors #575

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

Open
IAmNotHanni opened this issue May 22, 2025 · 0 comments
Open

Use bindless descriptors #575

IAmNotHanni opened this issue May 22, 2025 · 0 comments
Assignees
Labels
cat:performance performance cat:refactor refactor/clean up/simplifications/etc. diff:advanced advanced skills required feat:rendergraph rendergraph feat:rendering rendering

Comments

@IAmNotHanni
Copy link
Member

IAmNotHanni commented May 22, 2025

Is your feature request related to a problem?

Descriptor management is hard to do right. With rendergraph2 pull request coming to a finish, we have found an interesting abstraction for conventional descriptor management. We can improve the situation a lot though.

Description

With respect to the current state of descriptor code, there are some more things to discuss:

  • In theory, the rendergraph can reason about the descriptor pool sizes, at least for the static descriptors. This means that during rendergraph compilation, the rendergraph could specify how many descriptors and what type of them are required. The performance benefit of this is not easy to estimate, but it might be worth it. It's not that easy for the non-static descriptors, which are usually per-object or per rendermodule.
  • By using our command buffer wrapper code, we can also perform some statistics on the bind_descriptor_set() command of the wrapper. This would give us a per-rendermodule and per-pass insight into how many descriptors were bound and how. We could also use performance queries I believe.
  • The maximum number of bound descriptor sets is limited. Vulkan guarantees that at least 4 descriptor sets can be bound at the same time. This is one of the major limitations one has to keep in mind when writing a Vulkan renderer.
  • If we stick to a maximum number of 4 bound descriptor sets at the same time, we should group them in order of rate of change, meaning that the most frequently changing descriptor set should come as last. The reason for this is that when binding a new descriptor set which comes in a later slot (because if changes more frequently), the previously bound descriptor set can still stay bound if it's required. This is mostly the case for some per-frame data.
  • We could also use VK_EXT_descriptor_indexing as a more modern solution. This would greatly simplify descriptor management.
  • The support for VK_EXT_descriptor_buffer is still minimal.

Bindless or not?

Another approach would be to just aim for a bindless renderer. This seems to be the most modern solution, but it requires redesign of shaders. Since we don't have many shaders now (barely any really), this could be a good point to decide to use a bindless design

Further links:

Alternatives

If we just keep the code from rendergraph2, descriptor management will stay as hard as it is.

Affected Code

The rendergraph and descriptor wrapper code, also shaders.

Operating System

All

Additional Context

None

@IAmNotHanni IAmNotHanni added diff:advanced advanced skills required cat:performance performance cat:refactor refactor/clean up/simplifications/etc. feat:rendergraph rendergraph feat:rendering rendering labels May 22, 2025
@IAmNotHanni IAmNotHanni self-assigned this May 22, 2025
@IAmNotHanni IAmNotHanni moved this to Todo in @Rendergraph_v3 May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:performance performance cat:refactor refactor/clean up/simplifications/etc. diff:advanced advanced skills required feat:rendergraph rendergraph feat:rendering rendering
Projects
Status: Todo
Development

No branches or pull requests

1 participant