[Mesa-dev] [PATCH 10/15] egl: add eglWaitSync

Marek Olšák maraeo at gmail.com
Fri May 15 09:18:55 PDT 2015


On Fri, May 15, 2015 at 1:23 AM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> On 12/05/15 22:54, Marek Olšák wrote:
>> From: Marek Olšák <marek.olsak at amd.com>
>>
>> ---
>>  src/egl/main/eglapi.c | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
>> diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
>> index 60df297..544f7e4 100644
>> --- a/src/egl/main/eglapi.c
>> +++ b/src/egl/main/eglapi.c
>> @@ -1162,6 +1162,7 @@ eglGetProcAddress(const char *procname)
>>        { "eglDestroySync", (_EGLProc) eglDestroySync },
>>        { "eglClientWaitSync", (_EGLProc) eglClientWaitSync },
>>        { "eglDestroyImage", (_EGLProc) eglDestroyImage },
>> +      { "eglWaitSync", (_EGLProc) eglWaitSync },
>>  #endif /* _EGL_GET_CORE_ADDRESSES */
>>  #ifdef EGL_MESA_drm_display
>>        { "eglGetDRMDisplayMESA", (_EGLProc) eglGetDRMDisplayMESA },
>> @@ -1514,6 +1515,17 @@ eglWaitSyncKHR(EGLDisplay dpy, EGLSync sync, EGLint flags)
>>
>>
>>  EGLBoolean EGLAPIENTRY
>> +eglWaitSync(EGLDisplay dpy, EGLSync sync, EGLint flags)
>> +{
>> +   /* The KHR version returns EGLint, while the core version returns
>> +    * EGLBoolean. In both cases, the return values can only be EGL_FALSE and
>> +    * EGL_TRUE.
>> +    */
>> +   return eglWaitSyncKHR(dpy, sync, flags);
> Maybe add the cast, considering that sizeof(EGLenum) != sizeof(EGLInt)
> on 64 bit systems.
>
> Thinking about the assembly - not sure if won't end up with pushing a
> 64bit value, while a 32bit one being popped. My x86 assembly days were
> mostly before x86_64 became a thing so ^^ might sound a bit stupid :)

It's EGLBoolean, not EGLenum. Also, no cast is needed between basic types.

typedef int32_t khronos_int32_t;
typedef khronos_int32_t EGLint;
typedef unsigned int EGLBoolean;

The types are equivalent on 32-bit and 64-bit, so I could have just
made eglWaitSyncKHR be an alias of eglWaitSync and it would work, but
I wanted to document this in the code.

Marek


More information about the mesa-dev mailing list