Skip to content

macos metal backend crash with CA_ASSERT_MAIN_THREAD_TRANSACTIONS #3694

Description

@bnb-ashershen

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.

Activity

  1. kvark commented on Mar 24, 2021

    @kvark
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions