bkaradzic / bgfx

Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.

Home Page:https://bkaradzic.github.io/bgfx/overview.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

rogual opened this issue · 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

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.

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.