0

Under macos when i do :

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);

and when after I inspect the value of colorAttachmentDesc.clearColor I can that see that I still have (0, 0, 0, 1) instead of (1, 1, 1, 1) !!

On ios it's work perfectly, but on macOS with NSView instead of UIView I don't understand why it's not work. did I miss something?

zeus
  • 12,173
  • 9
  • 63
  • 184
  • Can you provide a bit more context for how you're subsequently encoding the render pass? Are you configuring a render pass descriptor provided by the view, or creating your own from scratch? Are you performing more than one pass, or rendering directly to the view's current drawable's texture? – warrenm Feb 11 '20 at 02:27
  • @warrenm I just updated the question with example. I do not understand why it's not work :( – zeus Feb 11 '20 at 22:40
  • Nothing stands out as incorrect in your usage here (assuming you are mutating the attachment descriptor that actually ultimately gets used by your render pass, and the referenced drawable is the one you ultimately present). If you have a small project that reproduces this problem, I'd encourage you to post it. – warrenm Feb 12 '20 at 02:01
  • @warrenm what do you mean by "mutating" ? – zeus Feb 12 '20 at 18:18

0 Answers0