eglCreateSyncKHR emulation

This topic contains 2 replies, has 2 voices, and was last updated by  kevin 1 year, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #53422

    It appears that eglCreateSyncKHR in PVRVFrame may not be properly supporting a NULL attrib_list (SDK 2016 R1.1, Win32).

    On the platform I’m testing on, PVRVFrame reports EGL_KHR_fence_sync support.

    When I capture a trace, PVRTrace recorder serializes and PVRTraceGUI displays the function query for the required EGL extension functions:

    Call UID 4114: Thread 22360: eglGetProcAddress (eglCreateSyncKHR) : 0x32e9c20
    …

    The function addresses returned appear to be within libEGL.dll, which is good. However, when the app calls eglCreateSyncKHR via the function pointer, that triggers an access violation on a NULL pointer dereference, with no eglCreateSyncKHR serialized into the PVRTrace file. The line of code:

            m_SyncObj = eglCreateSyncKHR_my( eglDisplay, EGL_SYNC_FENCE_KHR, NULL );

    Testing a theory, I changed this to:

            EGLint attribs[] = { EGL_NONE };
            m_SyncObj = eglCreateSyncKHR_my( eglDisplay, EGL_SYNC_FENCE_KHR, attribs );

    That at least gets past the crash and results in eglCreateSyncKHR, eglClientWaitSyncKHR, and eglDestroySyncKHR calls in the trace log. Though I’m still getting a hang on eglClientWaitSyncKHR, so it’s too soon to say whether there might not be another issue. Continuing to dig…

    Related: In the KHR_fence_sync spec, I see:

    If “type” is EGL_SYNC_FENCE_KHR, a fence sync object is created. In
    this case “attrib_list” must be NULL or empty (containing only
    EGL_NONE).

    #53435

    Though I’m still getting a hang on eglClientWaitSyncKHR, so it’s too soon to say whether there might not be another issue. Continuing to dig…

    Just to wrap this up, it turns out that the mentioned eglClientWaitSyncKHR hang was due to a logic error in the app (specifically: not flushing the eglCreateSyncKHR signal into the pipeline when using multiple contexts).

    So the only EGL_KHR_fence_sync problems I hit are 1) the above-mentioned one w.r.t. a NULL attrib_list argument to eglCreateSyncKHR, and 2) this one:

    * https://community.imgtec.com/forums/topic/gl_oes_egl_sync-with-pvrvframe/

    Thanks.

    #53536

    kevin
    Member

    Hi Dark_Photon,
    First of all, thank you for your testing. This issue has been resolved in changelist 4029283.
    You can use EGLint attribs[] = { EGL_NONE }; as a workaround solution for now.
    the code path should be as same as the attribs == NULL.

    Thanks,
    Kevin

    1 user thanked author for this post.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.