Replies: 3 comments 1 reply
-
|
Neat idea. Maybe in libs we should make this argument optional by default, and retrieve Does Do you see any other potentially useful types of allocators? |
Beta Was this translation helpful? Give feedback.
-
|
What about branch pruning and multiple resolutions? Sometimes, some of the AllocatedUniforms will be unused, will we always generate the same struct containing all of those? Or will we prune the fields? |
Beta Was this translation helpful? Give feedback.
-
|
Generally, I really like this idea. Definitely, this will reduce binding usage. I am concerned about the following scenerio:
What would happen?
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It's very easy to run out of fixed binding slots. The solution is usually to group data together wherever possible. If we're using many shader libraries that need to allocate some data (like perlin noise cache), they all would have to allocate their own data (which quickly uses up bindings), or defer that allocation to the user. I think an allocator pattern might be a good solution that makes things easy by default (a default allocator provided by us), but doesn't restrict use of the library.
The default allocator could, for example, pack all uniforms into a single struct
Beta Was this translation helpful? Give feedback.
All reactions