Why are you using a CAMetalLayer if you don't use any feature from Metal?
Your example looks like a very uncommon usage to me:
in my experience you get red output when the framebuffer isn't even cleared because there is no render pipeline (MTLRenderCommandEncoder) scheduled to render into that drawable
CAMetalLayer provides drawable that cannot be written to by default, only rendered into, at least from Metal pipeline perspective.
Is your texture storage even shared? I would expect the texture created by CAMetalLayer to have private storage, so you can only write to it through Metal commands.
Topic:
Graphics & Games
SubTopic:
General
Tags: