Merge pull request #811 from billhollings/master

Document recommendation to use 3 swapchain images, particularly with full-screen rendering.
This commit is contained in:
Bill Hollings 2020-01-07 15:02:26 -05:00 committed by GitHub
commit b081a005b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -30,6 +30,7 @@ Table of Contents
- [Troubleshooting Shader Conversion](#spv_vs_msl)
- [Performance Considerations](#performance)
- [Shader Loading Time](#shader_load_time)
- [Swapchains](#swapchains)
- [Xcode Configuration](#xcode_config)
- [Metal System Trace Tool](#trace_tool)
- [Known **MoltenVK** Limitations](#limitations)
@ -498,6 +499,24 @@ improve performance significantly. Your first choice should be to use offline st
cache contents as described in the previous paragraphs.
<a name="swapchains"></a>
### Swapchains
*Metal* supports a very small number (3) of concurrent swapchain images. In addition, *Metal* can
sometimes hold onto these images during surface presentation.
**MoltenVK** supports using either 2 or 3 swapchain images. For best performance, it is recommended
that you use 3 swapchain images (triple-buffering), to ensure that at least one swapchain image will
be available when you need to render to it.
Using 3 swapchain images is particularly important when rendering to a full-screen surface, because
in that situation, *Metal* uses its *Direct to Display* feature, and avoids compositing the swapchain
image onto a separate composition surface before displaying it. Although *Direct to Display* can improve
performance throughput, it also means that *Metal* may hold onto each swapchain image a little longer
than when using an internal compositor, which increases the risk that a swapchain image will not be a
vailable when you request it, resulting in frame delays and visual stuttering.
<a name="xcode_config"></a>
### Xcode Configuration

View File

@ -23,6 +23,7 @@ Released TBD
- Fix buffer offset in `vkCmdPushDescriptorSet()` for non-dedicated buffer memory.
- Fix Metal validation error on push constant sizing differences between C and MSL structs.
- Track performance of `CAMetalLayer nextDrawable` call.
- Document recommendation to use 3 swapchain images, particularly with full-screen rendering.
- Update `VK_MVK_MOLTENVK_SPEC_VERSION` to `24`.