summaryrefslogtreecommitdiff
path: root/GLESv2
diff options
context:
space:
mode:
authorStanislav Vorobiov <s.vorobiov@samsung.com>2014-03-21 13:04:38 +0400
committerStanislav Vorobiov <s.vorobiov@samsung.com>2014-03-21 13:05:44 +0400
commita7a65e1c73aa6a7e257c92c31ddc40e4a1d083b7 (patch)
treefff9f72716bdc26c20548d7d2864da2fbfc6ff3d /GLESv2
parentc04c0c01257ffaf9c9124da8e2041dfaaebe70a3 (diff)
downloademulator-yagl-a7a65e1c73aa6a7e257c92c31ddc40e4a1d083b7.tar.gz
emulator-yagl-a7a65e1c73aa6a7e257c92c31ddc40e4a1d083b7.tar.bz2
emulator-yagl-a7a65e1c73aa6a7e257c92c31ddc40e4a1d083b7.zip
YaGL: Fix glClientWaitSync and glGetSynciv
Return proper error codes and statuses Change-Id: Ic75f7605c3eabe8aae8074188b9669ecb7c007c3 Signed-off-by: Stanislav Vorobiov <s.vorobiov@samsung.com>
Diffstat (limited to 'GLESv2')
-rw-r--r--GLESv2/yagl_gles3_calls.c30
-rw-r--r--GLESv2/yagl_gles3_sync.h2
2 files changed, 24 insertions, 8 deletions
diff --git a/GLESv2/yagl_gles3_calls.c b/GLESv2/yagl_gles3_calls.c
index 632b25a..e99f326 100644
--- a/GLESv2/yagl_gles3_calls.c
+++ b/GLESv2/yagl_gles3_calls.c
@@ -1533,13 +1533,22 @@ YAGL_API GLenum glClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout
goto out;
}
- if (timeout == 0) {
- status = sync_obj->egl_fence->signaled(sync_obj->egl_fence) ? GL_CONDITION_SATISFIED
- : GL_TIMEOUT_EXPIRED;
- } else if (sync_obj->egl_fence->wait(sync_obj->egl_fence)) {
- status = GL_CONDITION_SATISFIED;
+ if (sync_obj->signaled) {
+ status = GL_ALREADY_SIGNALED;
} else {
- YAGL_SET_ERR(GL_INVALID_OPERATION);
+ if (timeout == 0) {
+ if (sync_obj->egl_fence->signaled(sync_obj->egl_fence)) {
+ status = GL_ALREADY_SIGNALED;
+ sync_obj->signaled = 1;
+ } else {
+ status = GL_TIMEOUT_EXPIRED;
+ }
+ } else if (sync_obj->egl_fence->wait(sync_obj->egl_fence)) {
+ status = GL_CONDITION_SATISFIED;
+ sync_obj->signaled = 1;
+ } else {
+ YAGL_SET_ERR(GL_INVALID_OPERATION);
+ }
}
out:
@@ -1567,7 +1576,7 @@ YAGL_API void glWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
YAGL_NS_SYNC, (yagl_object_name)sync);
if (!sync_obj) {
- YAGL_SET_ERR(GL_INVALID_OPERATION);
+ YAGL_SET_ERR(GL_INVALID_VALUE);
goto out;
}
@@ -1629,7 +1638,12 @@ YAGL_API void glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *l
}
break;
case GL_SYNC_FLAGS:
- if (length) {
+ if (bufSize > 0) {
+ *values = 0;
+ if (length) {
+ *length = 1;
+ }
+ } else if (length) {
*length = 0;
}
break;
diff --git a/GLESv2/yagl_gles3_sync.h b/GLESv2/yagl_gles3_sync.h
index b40a7dc..2d0f1eb 100644
--- a/GLESv2/yagl_gles3_sync.h
+++ b/GLESv2/yagl_gles3_sync.h
@@ -13,6 +13,8 @@ struct yagl_gles3_sync
struct yagl_object base;
struct yagl_egl_fence *egl_fence;
+
+ int signaled;
};
struct yagl_gles3_sync *yagl_gles3_sync_create(void);