-
Notifications
You must be signed in to change notification settings - Fork 422
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
Fix occasional GPU crash when a smaller descriptor set replaces a larger one. #2355
Fix occasional GPU crash when a smaller descriptor set replaces a larger one. #2355
Conversation
…ger one. If a descriptor set with fewer than 64 descriptors replaced one with more, the resources it contained were not made resident to the GPU, due to MVKBitArray thrashing incorrectly when transitioning between static and dynamic memory allocations. - Overhaul MVKBitArray design: - Never downsize memory allocation unless reset() is called. - No longer support static allocation for smaller sizes, to avoid thrashing between dynamic and static allocs when frequently resizing up and down. - Use realloc() instead of malloc/copy to improve performance. - Simplify tracking of partially and fully disabled sections. - Rename setXX() and clearXX() functions to enableXX() & disableXX(). - Rename several internal functions. - getIndexOfFirstEnabledBit() & enumerateEnabledBits() no longer have an option to disable the bit. - MVKDescriptorPool track highest descriptor set allocated, instead of querying MVKBitArray.
Unfortunately it seems that this PR introduced a regression in I could capture this stack trace at the crash
I don't know whether this is useful. Tomorrow I can try to reduce the crashing program to a pure Vulkan MWE. |
Ok, I debugged it directly and submitted #2381 to fix this. |
Thanks for your debugging effort, and for the fix! |
If a descriptor set with fewer than 64 descriptors replaced one with more, the resources it contained were not made resident to the GPU, due to
MVKBitArray
thrashing incorrectly when transitioning between static and dynamic memory allocations.MVKBitArray
design:reset()
is called.realloc()
instead of malloc/copy to improve performance.setXX()
andclearXX()
functions toenableXX()
&disableXX()
.getIndexOfFirstEnabledBit()
&enumerateEnabledBits()
no longer have an option to disable the bit.MVKDescriptorPool
track highest descriptor set allocated, instead of queryingMVKBitArray
.Fixes part of issue #2271.