Revert to fixed number of argument buffer binding reservations. #2463
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partially reverts #2417, restoring fixed argument buffer reservation count but only when argument buffers are used by any descriptor set.
I've found that this seems to break the "compatible for set N" rule when push constants are used and the application relies on not having to re-push them after changing pipelines. I got in a situation where, when a pipeline with N + 1 descriptor sets is followed later by pipelines with N descriptor sets, something with the way buffer bindings dirty state works for layout compatibility may end up re-binding that N + 1 argument buffer into the push constants slot that is now at N + 1. Then, since the push constants are not re-pushed, they are not updated by MoltenVK back into that slot. I think that reserving no slots in the case of no argument buffers should be fine, since redefining descriptor sets as push descriptors for example would break the compatibility rule and re-bind properly.
Maybe this could be investigated deeper and some changes figured out to allow optimizing the binding usage this way, but I wasn't able to figure something out that I was satisfied with. Most of what I was thinking of was either kind of intrusive with the push constant checks or would add extra push constant rebinds that could impact performance. So at least for now, I've opted to just revert this part of the change.