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

MSAA with resolveMode=SAMPLE_ZERO uses a compute kernel, even on Apple silicon devices #2254

Closed
stripe2933 opened this issue Jun 12, 2024 · 2 comments
Labels
Answered A question was answered Question

Comments

@stripe2933
Copy link

stripe2933 commented Jun 12, 2024

Also, it requires non-transient attachment. Why this happened? Seems like resolveMode=AVERAGE uses tile based resolve.

@billhollings
Copy link
Contributor

billhollings commented Jun 18, 2024

The decision to run the resolve compute kernel is not based on the resolveMode, but on whether Metal and your GPU support natively resolving the pixel format you are using.

Metal describes which combination of formats and GPUs support native MSAA in the back half of this document.

Which GPU and pixel format are you using?

For native MSAA on the GPU, Metal uses the equivalent of AVERAGE. For simplicity, MoltenVK uses SAMPLE_ZERO in the compute kernel when native MSAA is not supported.

If there is demand for it, as an enhancement, we could add support to the kernel function to resolve the other resolve modes. We could also run the compute kernel anytime a resolution mode other than AVERAGE is requested. I've created issue #2257 to track this.

Regarding the second question, MoltenVK does not yet support tiling shaders.

@stripe2933
Copy link
Author

I was using R32Uint for 4x MSAA to render gl_InstanceIndex (since the depth attachment was 4x MSAA, there were no other options). As you mentioned, the native resolve is not supported for this format. I decided to separate the instance index rendering pass, so it’s not a problem anymore. Anyway, thank you for your answer.

@billhollings billhollings added Question Answered A question was answered labels Jun 28, 2024
@billhollings billhollings closed this as not planned Won't fix, can't repro, duplicate, stale Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Answered A question was answered Question
Projects
None yet
Development

No branches or pull requests

2 participants