bgfx icon indicating copy to clipboard operation
bgfx copied to clipboard

Metal: example-01-helloworld corrupted render when MSAA is enabled

Open rogual opened this issue 1 year ago • 3 comments

Describe the bug With MSAA on, the Hello World example renders with a bright pink background on my M2 Mac, and the imgui window disappears. Strangely enough, if I capture a frame with the Metal graphics debugger, it shows as normal in there. No errors are reported either.

To Reproduce Steps to reproduce the behavior:

  1. Run Hello World example
  2. Press F8 to turn on MSAA

Expected behavior The example should display as normal

Screenshots

Screenshot 2023-12-20 at 21 52 09 Screenshot 2023-12-20 at 21 55 37

Additional context MacBook Pro Apple M2 Max OS: 13.5 (22G74)

Chipset Model: Apple M2 Max Type: GPU Bus: Built-In Total Number of Cores: 30 Vendor: Apple (0x106b) Metal Support: Metal 3

rogual avatar Dec 20 '23 22:12 rogual

Screenshot 2023-12-21 at 09 24 32 Screenshot 2023-12-21 at 09 22 54

Hm, this is suspicious. That's a non-MSAA frame on the left, and MSAA (pink frame) on the right.

I notice the dependency between submit and blitRender is a dashed line in the MSAA frame, which means synchronization only (no data transfer). So the frame isn't being transferred between submit and blitRender passes? I hope I have that right.

rogual avatar Dec 21 '23 08:12 rogual

Screenshot 2023-12-21 at 09 26 00

It looks like bgfx is storing to "Color 0 Resolve" in the submit pass, but trying to load from "Color 0" in the blitRender pass.

rogual avatar Dec 21 '23 09:12 rogual

Can confirm it's reproducible on a Mac mini with M1 and macOS 14.5.

ul avatar Aug 07 '24 23:08 ul