Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MSAA crashing on intel macbooks #67913

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RevoluPowered
Copy link
Contributor

@RevoluPowered RevoluPowered commented Oct 26, 2022

This default previously would send a signal on metal. Changing it fixes the crash.

We should discuss this setting in more detail before merge, the default may need to be platform specific for macos.

This default previously would send a signal on metal.
Changing it fixes the crash.
@Calinou
Copy link
Member

Calinou commented Oct 26, 2022

Out of curiosity, why does the cluster builder always use 4× MSAA regardless of the viewport's MSAA level?

@clayjohn
Copy link
Member

CC @RandomShaper When Gordon and I were looking into this it looked like allocating the MSAA buffer resulted in some sort of compatibility issue with the swapchain (which is only allocated with 1 sample). Perhaps there is some validation we can do here to only allocated 4 samples when it is supported? I guess at the very least we can check for subgroup support, or just only use this "fix" when using MoltenVK

@bruvzg
Copy link
Member

bruvzg commented Oct 26, 2022

So just enabling MSAA is causing crash on Intel macs, or it's some combination of stuff with MSAA enabled?

Enabling MSAA on the Apple Silicon seems to work, if it's Intel specific it's probably should be limited to x86-64 only.

@clayjohn
Copy link
Member

So just enabling MSAA is causing crash on Intel macs, or it's some combination of stuff with MSAA enabled?

Enabling MSAA on the Apple Silicon seems to work, if it's Intel specific it's probably should be limited to x86-64 only.

I think the problem is MSAA in this specific Pipeline, this code does not control MSAA for ordinary rendering (like the MSAA project setting)

@RandomShaper
Copy link
Member

RandomShaper commented Oct 27, 2022

@clayjohn, I agree. Provided the problem is that MSAA is not supported on the target hardware for the specific usage cluster building needs, it'd be indeed a matter of checking and fall back to the non-MSAA version of the pipeline. I'm not in front of my PC at the moment, so I can't easily grep the code to see how that determination is being done.

@Calinou, as far as I understood from what @reduz explained to me, this half width, half size, 4x MSAA approach to cluster building is an optimization. You have four times less invocations of the fragment shader, but along the edges you can still collect if a pixel was at least slightly touched, which is all that matters. It's like some sort of manually crafted conservative rasterization.

@clayjohn clayjohn modified the milestones: 4.0, 4.x Feb 13, 2023
@clayjohn
Copy link
Member

Bumping to 4.x. We need to keep tabs on this crash. But the proper solution will be to check if MSAA 4x is supported and use that, falling back to 1x if not supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants