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

MAPPABLE_PRIMARY_BUFFERS on M1 Pro #2426

Closed
BGR360 opened this issue Jan 27, 2022 · 8 comments · Fixed by #2429
Closed

MAPPABLE_PRIMARY_BUFFERS on M1 Pro #2426

BGR360 opened this issue Jan 27, 2022 · 8 comments · Fixed by #2429
Labels
good first issue Good for newcomers help required We need community help to make this happen. type: bug Something isn't working

Comments

@BGR360
Copy link
Contributor

BGR360 commented Jan 27, 2022

Came over here from bevyengine/bevy#3686 (comment).

Mostly just starting a conversation, as I have little to no knowledge on the subject matter.

It was suggested in that discussion I linked that perhaps wgpu shouldn't warn MAPPABLE_PRIMARY_BUFFERS on platforms like Apple M1 that have powerful integrated GPUs. Thoughts?

@cwfitzgerald
Copy link
Member

This is just from us erroneously detecting it as a dedicated, not an integrated, gpu. Once this is fixed, the warning will go away.

@cwfitzgerald cwfitzgerald added good first issue Good for newcomers help required We need community help to make this happen. type: bug Something isn't working labels Jan 28, 2022
@BGR360
Copy link
Contributor Author

BGR360 commented Jan 28, 2022

I'd be willing to take a stab at fixing that. Could you point me in the right direction?

@cwfitzgerald
Copy link
Member

https://github.com/gfx-rs/wgpu/blob/master/wgpu-hal/src/metal/mod.rs#L117-L121

Here is the offending check. I'm not sure there's a clean way in the metal api to determine uma-ness, but I haven't checked. If not we can likely use the adapter family to determine which is which.

@kvark
Copy link
Member

kvark commented Jan 28, 2022

See also - KhronosGroup/MoltenVK#1201
We could do a similar fix.

@superdump
Copy link
Contributor

superdump commented Jan 28, 2022

I was just looking into this and I noticed that it's currently based on 'power' where high is mapped to discrete and low is mapped to integrated. But then I saw this in mtl::Device: https://github.com/gfx-rs/metal-rs/blob/master/src/device.rs#L1580 This seems like a good deciding factor perhaps? Is the problem that that is backend-specific?

@cwfitzgerald
Copy link
Member

Yup, that's what MVK does

@superdump
Copy link
Contributor

So, to clarify, we would need to fix this for the Metal backend, and the GL backend at least for WebGL2. The Vulkan backend using MoltenVK with the fix should be correct already. Right?

@superdump
Copy link
Contributor

#2429 how's this?

cwfitzgerald pushed a commit that referenced this issue Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help required We need community help to make this happen. type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants