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

Fix occasional GPU crash when a smaller descriptor set replaces a larger one. #2355

Merged
merged 1 commit into from
Sep 28, 2024

Conversation

billhollings
Copy link
Contributor

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.

Fixes part of issue #2271.

…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.
@billhollings billhollings merged commit 2307b08 into KhronosGroup:main Sep 28, 2024
6 checks passed
@billhollings billhollings deleted the mvkbitarray-redesign branch September 28, 2024 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants