mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Ensure that the CAMetalLayer FBO attachments can be read from. (#13643)
By default, the CAMetalLayer backing store is a framebuffer attachment that is only optimized for display. However, effects such as backdrop filters require renderbuffer readback. Making this calls will result in exceptions. Disable the write only optimization on such backing store. Fixes https://github.com/flutter/flutter/issues/43555
This commit is contained in:
parent
fe0838e948
commit
7b968ff95f
@ -23,6 +23,9 @@ GPUSurfaceMetal::GPUSurfaceMetal(GPUSurfaceDelegate* delegate,
|
||||
}
|
||||
|
||||
layer.get().pixelFormat = MTLPixelFormatBGRA8Unorm;
|
||||
// Flutter needs to read from the color attachment in cases where there are effects such as
|
||||
// backdrop filters.
|
||||
layer.get().framebufferOnly = NO;
|
||||
|
||||
auto metal_device = fml::scoped_nsprotocol<id<MTLDevice>>([layer_.get().device retain]);
|
||||
auto metal_queue = fml::scoped_nsprotocol<id<MTLCommandQueue>>([metal_device newCommandQueue]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user