на macOS, MTKview colorAttachments [0] .clearColor шов не работает - PullRequest
0 голосов
/ 11 февраля 2020

Под макросами, когда я делаю:

MTLRenderPassDescriptor* renderPassDesc = [MTLRenderPassDescriptor renderPassDescriptor];

MTLRenderPassColorAttachmentDescriptor* colorAttachmentDesc = [MTLRenderPassColorAttachmentDescriptor new];
colorAttachmentDesc.texture = drawable.texture;
colorAttachmentDesc.loadAction = MTLLoadActionClear;
colorAttachmentDesc.storeAction = MTLStoreActionStore;
colorAttachmentDesc.clearColor = MTLClearColorMake(1, 1, 1, 1);

и когда после проверки значения colorAttachmentDesc.clearColor я могу видеть, что у меня все еще есть (0, 0, 0, 1) вместо из (1, 1, 1, 1) !!

На ios это работает отлично, но на macOS с NSView вместо UIView я не понимаю, почему это не работает. я что-то пропустил?

...