Commit 0b965170 by Nicolas Capens

Fix a few missing EGL error resets.

Change-Id: I0f28b08b865f85f212beaa74fa75f3b3620d9836 Reviewed-on: https://swiftshader-review.googlesource.com/4522Tested-by: 's avatarNicolas Capens <capn@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 021ff3e5
...@@ -390,7 +390,7 @@ EGLBoolean QuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EG ...@@ -390,7 +390,7 @@ EGLBoolean QuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EG
case EGL_LARGEST_PBUFFER: case EGL_LARGEST_PBUFFER:
if(eglSurface->isPBufferSurface()) // For a window or pixmap surface, the contents of *value are not modified. if(eglSurface->isPBufferSurface()) // For a window or pixmap surface, the contents of *value are not modified.
{ {
*value = eglSurface->getLargestPBuffer(); *value = eglSurface->getLargestPBuffer();
} }
break; break;
case EGL_MIPMAP_TEXTURE: case EGL_MIPMAP_TEXTURE:
...@@ -904,7 +904,7 @@ EGLImageKHR CreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLCl ...@@ -904,7 +904,7 @@ EGLImageKHR CreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLCl
return error(EGL_BAD_ATTRIBUTE, EGL_NO_IMAGE_KHR); return error(EGL_BAD_ATTRIBUTE, EGL_NO_IMAGE_KHR);
} }
return new AndroidNativeImage(nativeBuffer); return success(new AndroidNativeImage(nativeBuffer));
} }
#endif #endif
...@@ -1028,7 +1028,7 @@ EGLSyncKHR CreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list ...@@ -1028,7 +1028,7 @@ EGLSyncKHR CreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list
return error(EGL_BAD_MATCH, EGL_NO_SYNC_KHR); return error(EGL_BAD_MATCH, EGL_NO_SYNC_KHR);
} }
return new FenceSync(context); return success(new FenceSync(context));
} }
EGLBoolean DestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync) EGLBoolean DestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync)
...@@ -1045,7 +1045,7 @@ EGLBoolean DestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync) ...@@ -1045,7 +1045,7 @@ EGLBoolean DestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync)
delete eglSync; delete eglSync;
return EGL_TRUE; return success(EGL_TRUE);
} }
EGLint ClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout) EGLint ClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout)
...@@ -1068,7 +1068,7 @@ EGLint ClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeK ...@@ -1068,7 +1068,7 @@ EGLint ClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeK
eglSync->wait(); eglSync->wait();
} }
return EGL_CONDITION_SATISFIED_KHR; return success(EGL_CONDITION_SATISFIED_KHR);
} }
EGLBoolean GetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value) EGLBoolean GetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value)
...@@ -1088,14 +1088,14 @@ EGLBoolean GetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, E ...@@ -1088,14 +1088,14 @@ EGLBoolean GetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, E
{ {
case EGL_SYNC_TYPE_KHR: case EGL_SYNC_TYPE_KHR:
*value = EGL_SYNC_FENCE_KHR; *value = EGL_SYNC_FENCE_KHR;
return EGL_TRUE; return success(EGL_TRUE);
case EGL_SYNC_STATUS_KHR: case EGL_SYNC_STATUS_KHR:
eglSync->wait(); // TODO: Don't block. Just poll based on sw::Query. eglSync->wait(); // TODO: Don't block. Just poll based on sw::Query.
*value = eglSync->isSignaled() ? EGL_SIGNALED_KHR : EGL_UNSIGNALED_KHR; *value = eglSync->isSignaled() ? EGL_SIGNALED_KHR : EGL_UNSIGNALED_KHR;
return EGL_TRUE; return success(EGL_TRUE);
case EGL_SYNC_CONDITION_KHR: case EGL_SYNC_CONDITION_KHR:
*value = EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR; *value = EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR;
return EGL_TRUE; return success(EGL_TRUE);
default: default:
return error(EGL_BAD_ATTRIBUTE, EGL_FALSE); return error(EGL_BAD_ATTRIBUTE, EGL_FALSE);
} }
...@@ -1132,22 +1132,22 @@ __eglMustCastToProperFunctionPointerType GetProcAddress(const char *procname) ...@@ -1132,22 +1132,22 @@ __eglMustCastToProperFunctionPointerType GetProcAddress(const char *procname)
{ {
if(strcmp(procname, eglExtensions[ext].name) == 0) if(strcmp(procname, eglExtensions[ext].name) == 0)
{ {
return (__eglMustCastToProperFunctionPointerType)eglExtensions[ext].address; return success((__eglMustCastToProperFunctionPointerType)eglExtensions[ext].address);
} }
} }
if(libGLESv2) if(libGLESv2)
{ {
__eglMustCastToProperFunctionPointerType proc = libGLESv2->es2GetProcAddress(procname); __eglMustCastToProperFunctionPointerType proc = libGLESv2->es2GetProcAddress(procname);
if(proc) return proc; if(proc) return success(proc);
} }
if(libGLES_CM) if(libGLES_CM)
{ {
__eglMustCastToProperFunctionPointerType proc = libGLES_CM->es1GetProcAddress(procname); __eglMustCastToProperFunctionPointerType proc = libGLES_CM->es1GetProcAddress(procname);
if(proc) return proc; if(proc) return success(proc);
} }
return NULL; return success((__eglMustCastToProperFunctionPointerType)NULL);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment