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

sg_make_image crash when Xcode Metal API Validation enabled #905

Closed
cai502 opened this issue Sep 22, 2023 · 7 comments
Closed

sg_make_image crash when Xcode Metal API Validation enabled #905

cai502 opened this issue Sep 22, 2023 · 7 comments

Comments

@cai502
Copy link

cai502 commented Sep 22, 2023

Crash occurs on macbook pro 19 only when Xcode Metal API Validation enabled.

But macbook pro 21(with M1 Chip) is ok.

Pasted image 20230919163456

@cai502
Copy link
Author

cai502 commented Sep 22, 2023

info added for macbook pro 19

  1. Xcode Version: 14.3
  2. macOS: Ventura 13.3.1(a)

@floooh
Copy link
Owner

floooh commented Sep 22, 2023

Hmm, ok. That code is relatively recent, looks like I ignored this little tidbit that StorageModeShared textures are not allowed on Intel GPUs:

https://developer.apple.com/documentation/metal/mtlstoragemode/mtlstoragemodeshared#discussion

Since it looks like that by default Metal does the right thing, I will just remove the explicit storage mode selection again.

Thanks for the bug report!

@floooh floooh self-assigned this Sep 22, 2023
@floooh floooh added the bug label Sep 22, 2023
@floooh
Copy link
Owner

floooh commented Sep 22, 2023

PS: for a quick workaround you can set the sg_desc.mtl_force_managed_storage_mode option to true in the sg_setup() call, but I'll try to provide a proper fix asap.

@floooh
Copy link
Owner

floooh commented Sep 22, 2023

PPS: after dusting off my old Intel Mac with Big Sur and Xcode 12 I actually have a couple of more problems (sokol_gfx.h doesn't build because some declarations from more recents SDKs aren't properly conditionally compiled.

I'll see if I can get this stuff to work later today.

floooh added a commit that referenced this issue Sep 22, 2023
Intel Macs (GPU Family Mac1 and Mac2) now always use managed
storage mode.
@floooh
Copy link
Owner

floooh commented Sep 22, 2023

Ok, this should be fixed in #907, basically Intel Macs now use managed storage mode for all resource types (that's the same as it worked before I tried to be clever). On Apple GPUs (and generally on iOS) shared resource storage mode is used.

I'll merge this in a couple of hours.

@cai502
Copy link
Author

cai502 commented Sep 22, 2023

Cool, thanks very much!

@floooh
Copy link
Owner

floooh commented Sep 22, 2023

PS: I tested this on my mid-2014 13" MBP with Big Sur and Xcode 12, my M1 MBP, and the iOS simulator.

@floooh floooh closed this as completed in 7277c7f Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants