replace eglWaitSyncANDROID by eglWaitSyncKHR

Change-Id: I22f1b3588011c88389e249f738f1e6915cc97e72
This commit is contained in:
Mathias Agopian 2013-03-27 17:32:41 -07:00
parent 12af3f6665
commit 2bb716871c
4 changed files with 39 additions and 31 deletions

View File

@ -55,10 +55,10 @@ const bool GLConsumer::sUseNativeFenceSync = true;
const bool GLConsumer::sUseNativeFenceSync = false;
#endif
// This compile option makes GLConsumer use the EGL_ANDROID_sync_wait
// This compile option makes GLConsumer use the EGL_KHR_wait_sync
// extension to insert server-side waits into the GLES command stream. This
// feature requires the EGL_ANDROID_native_fence_sync and
// EGL_ANDROID_wait_sync extensions.
// EGL_KHR_wait_sync extensions.
#ifdef USE_WAIT_SYNC
static const bool useWaitSync = true;
#else
@ -848,7 +848,7 @@ status_t GLConsumer::doGLFenceWaitLocked() const {
// XXX: The spec draft is inconsistent as to whether this should
// return an EGLint or void. Ignore the return value for now, as
// it's not strictly needed.
eglWaitSyncANDROID(dpy, sync, 0);
eglWaitSyncKHR(dpy, sync, 0);
EGLint eglErr = eglGetError();
eglDestroySyncKHR(dpy, sync);
if (eglErr != EGL_SUCCESS) {

View File

@ -558,14 +558,6 @@ typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC)(EGLDisplay dpy,
#define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285
#endif
#ifndef EGL_ANDROID_wait_sync
#define EGL_ANDROID_wait_sync
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLint EGLAPIENTRY eglWaitSyncANDROID(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
#endif
typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCANDROID) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
#endif
#ifndef EGL_ANDROID_presentation_time
#define EGL_ANDROID_presentation_time 1
typedef khronos_stime_nanoseconds_t EGLnsecsANDROID;

View File

@ -85,7 +85,7 @@ extern char const * const gExtensionString =
"EGL_EXT_create_context_robustness "
"EGL_NV_system_time "
"EGL_ANDROID_image_native_buffer " // mandatory
"EGL_ANDROID_wait_sync " // strongly recommended
"EGL_KHR_wait_sync " // strongly recommended
"EGL_ANDROID_presentation_time "
;
@ -133,9 +133,9 @@ static const extention_map_t sExtensionMap[] = {
{ "eglGetSystemTimeNV",
(__eglMustCastToProperFunctionPointerType)&eglGetSystemTimeNV },
// EGL_ANDROID_wait_sync
{ "eglWaitSyncANDROID",
(__eglMustCastToProperFunctionPointerType)&eglWaitSyncANDROID },
// EGL_KHR_wait_sync
{ "eglWaitSyncKHR",
(__eglMustCastToProperFunctionPointerType)&eglWaitSyncKHR },
// EGL_ANDROID_presentation_time
{ "eglPresentationTimeANDROID",
@ -1363,6 +1363,22 @@ EGLBoolean eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync,
return result;
}
// ----------------------------------------------------------------------------
// EGL_EGLEXT_VERSION 15
// ----------------------------------------------------------------------------
EGLint eglWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags) {
clearError();
const egl_display_ptr dp = validate_display(dpy);
if (!dp) return EGL_FALSE;
EGLint result = EGL_FALSE;
egl_connection_t* const cnx = &gEGLImpl;
if (cnx->dso && cnx->egl.eglWaitSyncKHR) {
result = cnx->egl.eglWaitSyncKHR(dp->disp.dpy, sync, flags);
}
return result;
}
// ----------------------------------------------------------------------------
// ANDROID extensions
// ----------------------------------------------------------------------------
@ -1382,21 +1398,6 @@ EGLint eglDupNativeFenceFDANDROID(EGLDisplay dpy, EGLSyncKHR sync)
return result;
}
EGLint eglWaitSyncANDROID(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags)
{
clearError();
const egl_display_ptr dp = validate_display(dpy);
if (!dp) return EGL_NO_NATIVE_FENCE_FD_ANDROID;
EGLint result = EGL_FALSE;
egl_connection_t* const cnx = &gEGLImpl;
if (cnx->dso && cnx->egl.eglWaitSyncANDROID) {
result = cnx->egl.eglWaitSyncANDROID(dp->disp.dpy, sync, flags);
}
return result;
}
EGLBoolean eglPresentationTimeANDROID(EGLDisplay dpy, EGLSurface surface,
EGLnsecsANDROID time)
{

View File

@ -59,12 +59,27 @@ EGL_ENTRY(EGLint, eglClientWaitSyncKHR, EGLDisplay, EGLSyncKHR, EGLint,
EGL_ENTRY(EGLBoolean, eglSignalSyncKHR, EGLDisplay, EGLSyncKHR, EGLenum)
EGL_ENTRY(EGLBoolean, eglGetSyncAttribKHR, EGLDisplay, EGLSyncKHR, EGLint, EGLint *)
/* EGL_EGLEXT_VERSION 15 */
// EGL_ENTRY(EGLStreamKHR, eglCreateStreamKHR, EGLDisplay, const EGLint *)
// EGL_ENTRY(EGLBoolean, eglDestroyStreamKHR, EGLDisplay, EGLStreamKHR)
// EGL_ENTRY(EGLBoolean, eglStreamAttribKHR, EGLDisplay, EGLStreamKHR, EGLenum, EGLint)
// EGL_ENTRY(EGLBoolean, eglQueryStreamKHR, EGLDisplay, EGLStreamKHR, EGLenum, EGLint *)
// EGL_ENTRY(EGLBoolean, eglQueryStreamu64KHR, EGLDisplay, EGLStreamKHR, EGLenum, EGLuint64KHR *)
// EGL_ENTRY(EGLBoolean, eglStreamConsumerGLTextureExternalKHR, EGLDisplay, EGLStreamKHR)
// EGL_ENTRY(EGLBoolean, eglStreamConsumerAcquireKHR, EGLDisplay, EGLStreamKHR)
// EGL_ENTRY(EGLBoolean, eglStreamConsumerReleaseKHR, EGLDisplay, EGLStreamKHR)
// EGL_ENTRY(EGLSurface, eglCreateStreamProducerSurfaceKHR, EGLDisplay, EGLConfig, EGLStreamKHR, const EGLint *)
// EGL_ENTRY(EGLBoolean, eglQueryStreamTimeKHR, EGLDisplay, EGLStreamKHR, EGLenum, EGLTimeKHR*)
// EGL_ENTRY(EGLNativeFileDescriptorKHR, eglGetStreamFileDescriptorKHR, EGLDisplay, EGLStreamKHR)
// EGL_ENTRY(EGLStreamKHR, eglCreateStreamFromFileDescriptorKHR, EGLDisplay, EGLNativeFileDescriptorKHR)
EGL_ENTRY(EGLint, eglWaitSyncKHR, EGLDisplay, EGLSyncKHR, EGLint)
/* ANDROID extensions */
EGL_ENTRY(EGLBoolean, eglSetSwapRectangleANDROID, EGLDisplay, EGLSurface, EGLint, EGLint, EGLint, EGLint)
EGL_ENTRY(EGLClientBuffer, eglGetRenderBufferANDROID, EGLDisplay, EGLSurface)
EGL_ENTRY(EGLint, eglDupNativeFenceFDANDROID, EGLDisplay, EGLSyncKHR)
EGL_ENTRY(EGLint, eglWaitSyncANDROID, EGLDisplay, EGLSyncKHR, EGLint)
/* NVIDIA extensions */