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

Rework workaround to force incomplete CAMetalDrawable presentations to complete. #2020

Conversation

billhollings
Copy link
Contributor

  • To force any incomplete CAMetalDrawable presentations to complete, don't force the creation of another transient drawable, as this can stall the creation of future drawables. Instead, when a swapchain is destroyed, or replaced by a new swapchain, set the CAMetalLayer drawableSize, which will force presentation completion.
  • Add presentation completion handler in command buffer scheduling callback, move marking available to presentation completion handler, and minimize mutex locking.
  • MVKQueue::waitIdle() remove wait for swapchain presentations, and remove callbacks to MVKQueue from drawable completions.
  • MVKQueue::submit() don't bypass submitting a misconfigured submission, so that semaphores and fences will be signalled, and ensure misconfigured submissions are well behaved.
  • Add MVKSwapchain::getCAMetalLayer() to streamline layer access (unrelated).

Potentially fixes issue #2019.

…o complete.

- To force any incomplete CAMetalDrawable presentations to complete,
  don't force the creation of another transient drawable, as this can
  stall the creation of future drawables. Instead, when a swapchain
  is destroyed, or replaced by a new swapchain, set the CAMetalLayer
  drawableSize, which will force presentation completion.
- Add presentation completion handler in command buffer scheduling
  callback, move marking available to presentation completion handler,
  and minimize mutex locking.
- MVKQueue::waitIdle() remove wait for swapchain presentations,
  and remove callbacks to MVKQueue from drawable completions.
- MVKQueue::submit() don't bypass submitting a misconfigured submission,
  so that semaphores and fences will be signalled, and ensure misconfigured
  submissions are well behaved.
- Add MVKSwapchain::getCAMetalLayer() to streamline layer access (unrelated).
@billhollings billhollings merged commit aed91cb into KhronosGroup:main Sep 15, 2023
5 checks passed
@billhollings billhollings deleted the incomplete-presentation-workaround-fix branch September 15, 2023 23:23
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