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

Make MAX_INSTANCE_UNIFORM_INDICES adjustable using a project setting #4467

Open
Calinou opened this issue Apr 29, 2022 · 2 comments
Open

Make MAX_INSTANCE_UNIFORM_INDICES adjustable using a project setting #4467

Calinou opened this issue Apr 29, 2022 · 2 comments

Comments

@Calinou
Copy link
Member

Calinou commented Apr 29, 2022

Describe the project you are working on

The Godot editor 🙂

Describe the problem or limitation you are having in your project

Godot 4.0's Vulkan renderer is currently limited to 16 instance uniform indices. This is likely done to cater to the limitations of mobile GPUs and integrated GPUs.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Looking at how this constant is used in the codebase, it seems possible to replace it with a project setting that is read once when the project starts. This would allow using a greater limit on desktop platforms, such as 32.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

  • Add a project setting to define the maximum number of instance uniform indices that can be used. This setting would probably default to 32, unless integrated graphics make this impossible. In that case, the setting would default to 16. The mobile override below would ensure that the value isn't set too high if you increase it for desktop platforms only.
  • Add a .mobile override to this project setting that defaults to 16.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No, as the current constant is hardcoded. Changing it requires recompiling the editor and export templates.

Is there a reason why this should be core and not an add-on in the asset library?

See above.

@EMBYRDEV
Copy link

+1, I'd also like to note that it may make sense to also default desktop to 16 which would ensure shader compatibility between mobile and desktop GPUS but still have the setting exposed for studios that need to bump the limit.

@aaronfranke aaronfranke modified the milestones: 4.0, 4.x Feb 24, 2023
@Kimau
Copy link

Kimau commented Mar 21, 2024

This would be great. also programmatic access to this constant is useful as well. So that you can query what the users graphics card actually supports and adjust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants