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

macos metal backend crash with CA_ASSERT_MAIN_THREAD_TRANSACTIONS #3694

Open
bnb-ashershen opened this issue Mar 24, 2021 · 1 comment
Open

Comments

@bnb-ashershen
Copy link

bnb-ashershen commented Mar 24, 2021

Hi!

My app doing render stuff in separate thread (not main), and when I try to run it with env var CA_ASSERT_MAIN_THREAD_TRANSACTIONS=1 (Xcode Instruments run it like this), I see crash in this line.
If comment out described line application works fine, looks like only setAllowsNextDrawableTimeout message make CA transaction under the hood.

Error happens during creating swapchain through wgpu library.

macOS Big Sur 11.2.3
Crash error:
CoreAnimation: CA_ASSERT_MAIN_THREAD_TRANSACTIONS is set and an implicit transaction wasn't created on a main thread.

Thanks.

@kvark
Copy link
Member

kvark commented Mar 24, 2021

Wow, that's quite something... I don't know right off the bat how we should be handling this.
gfx doesn't control threading, and we can't launch a helper thread just to do this (would be super awkward).

I wonder if just checking for the thread ID there would be an acceptable workaround? I.e. remember which thread owns the surface, and compare the current thread before calling setAllowsNextDrawableTimeout.
If you want to try this and make a PR, that would be wonderful!

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