Commit 10cf6655 by Nicolas Capens Committed by Nicolas Capens

Fix WSI present on MacOS

As documented at https://developer.apple.com/documentation/quartzcore/cametallayer/1478168-framebufferonly: "If the value is true (the default), the CAMetalLayer class allocates its MTLTexture objects in ways that are optimized for display purposes. However, you may not sample, read from, or write to those textures. To support sampling and pixel read/write operations on the layer’s textures (at a cost to performance), set this value to false." Since we call replaceRegion in MacOSSurfaceMVK::present() to write pixels from system memory, we need to set this flag to false explicitly. Bug: b/137673628 Change-Id: I83e28a2940261d9eedf30d7c96427c23d85ac639 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/36608Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 645a8dea
......@@ -44,6 +44,7 @@ public:
if ([obj isKindOfClass: [CAMetalLayer class]])
{
layer = (CAMetalLayer*)[obj retain];
layer.framebufferOnly = false;
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment