-
Notifications
You must be signed in to change notification settings - Fork 402
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
WIP: Calculate argument buffer allocation size taking variable counts into account. #2199
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting this.
I've requested a couple of changes.
It looks slightly dicey to use the fixed size argument encoder when encoding variable sized bindings. Since here we're creating the encoder to calculate the size, maybe we could use it for encoding too..
Good point. And good catch.
Having each descriptor set carry its own encoder sounds like a lot. Perhaps we could have the descriptor set defer to the layout's encoder, unless the variable descriptor count is less than the descriptor count of the variable-length binding.
However, we are going to move away from argument encoders very soon. So, I don't think we should bother making things that complex unless we actually determine it is causing a problem.
efba837
to
388c31a
Compare
I think we could do that. Are they expensive though? I would have thought it's fine to create them on demand, for single use.
It's causing a validation error. That said, there's also another one, when the shader has the maximum size array declared, but the buffer that gets bound is smaller. Let's hold off merging for now, I'll see what can be done about the other one. |
…ble counts into account.
…ariable descriptor counts.
I updated the PR with commits that fix the validation errors. However now, in a number of tests, I'm getting GPU crashes instead - which seem to be triggered by having flexible arrays in the shaders. Marking as WIP.. |
When allocating descriptors from the pool, we should only request as much as needed for the variable number of descriptors, if applicable.
It looks slightly dicey to use the fixed size argument encoder when encoding variable sized bindings. Since here we're creating the encoder to calculate the size, maybe we could use it for encoding too..