Fragment shader artefacts on M1 after sleep (pulsation)

We simulate Gaussian blur as a Box Blur with complex shader (several passes on two axises) using Metal on Mac.

I noticed slight fast pulsation of picture brightness when we reach radius more than 16 pixels in a fragment shader (we read 32+ pixels from a source texture to calculate 1 output pixel). We use float4 calculations.

This issue appears only on M1 Mac and only after sleep. The problem dissappears after restarting macOS. And no problem on Intel iMac with AMD graphics.

These artefacts appear in macOS Monterey 12.4 and also in macOS 13 Ventura Beta 1 on M1 Mac mini. We don't have any problem with other more simple shaders.

Answered by wnsoft in 716514022

I found a solution.

I use QuadHD monitor with Mac Mini M1, but macOS doesn't support HighDPI on this monitor. Fonts small & sharp or large & blurry. So I use Better Dummy free utility which emulates secondary 4K monitor and use mirroring to use HighDPI 2560x1440 on this display.

Visual artefacts appear after screen lock or sleep. When I disabled this utility to use native non-Retina resolution the problem didn't appear. I found "Disconnect and reconnect after sleep” option in this utility and it helped to solve that problem.

However it can be a bug in macOS.

Accepted Answer

I found a solution.

I use QuadHD monitor with Mac Mini M1, but macOS doesn't support HighDPI on this monitor. Fonts small & sharp or large & blurry. So I use Better Dummy free utility which emulates secondary 4K monitor and use mirroring to use HighDPI 2560x1440 on this display.

Visual artefacts appear after screen lock or sleep. When I disabled this utility to use native non-Retina resolution the problem didn't appear. I found "Disconnect and reconnect after sleep” option in this utility and it helped to solve that problem.

However it can be a bug in macOS.

Fragment shader artefacts on M1 after sleep (pulsation)
 
 
Q