summaryrefslogtreecommitdiffstats
path: root/gpu/GLES2
diff options
context:
space:
mode:
authordyen <dyen@chromium.org>2015-10-14 10:26:11 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-14 17:27:32 +0000
commit55719a12b75e7057574a81d83117a0dfeed6f858 (patch)
tree8edf41815f20296f121fce90692db017df89fa9a /gpu/GLES2
parentd0e06a58f51ee83a670829425cd65a5693909eee (diff)
downloadchromium_src-55719a12b75e7057574a81d83117a0dfeed6f858.zip
chromium_src-55719a12b75e7057574a81d83117a0dfeed6f858.tar.gz
chromium_src-55719a12b75e7057574a81d83117a0dfeed6f858.tar.bz2
Added method to wait on fence syncs which do not need to be flushed.
With streams from the same channel, we do not need to flush before we can wait on the fence sync. I've added a new method which generates a sync token for unflushed fences (glGenUnverifiedSyncTokenCHROMIUM). Sync tokens generated using this function will be validated when glWaitSyncTokenCHROMIUM is called to validate that it did not need to be flushed and validated. R=jam@chromium.org, piman@chromium.org, rjkroege@chromium.org BUG=514815 Review URL: https://codereview.chromium.org/1401463004 Cr-Commit-Position: refs/heads/master@{#354051}
Diffstat (limited to 'gpu/GLES2')
-rw-r--r--gpu/GLES2/extensions/CHROMIUM/CHROMIUM_sync_point.txt30
-rw-r--r--gpu/GLES2/gl2chromium_autogen.h2
2 files changed, 29 insertions, 3 deletions
diff --git a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_sync_point.txt b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_sync_point.txt
index 80df38e..3ec5e1e 100644
--- a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_sync_point.txt
+++ b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_sync_point.txt
@@ -67,13 +67,31 @@ New Procedures and Functions
The command
+ void GenUnverifiedSyncTokenCHROMIUM(uint64 fence_sync,
+ GLbyte *sync_token)
+
+ converts <fence_sync> which is only visible to the current context to a
+ sync token which may be waited upon by a context which only needs flush
+ order guarantee with respect to the fence sync context. For example, if
+ the two contexts are on the same channel but on different streams, flush
+ order guarantee is enough to guarantee that the server will receive the
+ release command before the wait command. The <fence_sync> command must be
+ flushed before this function may be called, otherwise an INVALID_OPERATION
+ error is generated. The generated <sync_token> must be generated on the
+ same context as when InsertSyncPointCHROMIUM was called.
+
+ The command
+
void WaitSyncTokenCHROMIUM(const GLbyte *sync_token)
causes the current context to stop submitting commands until the specified
fence sync becomes signaled. This is implemented as a server-side wait.
<sync_token> is a sync token generated by GenSyncPointCHROMIUM. If
- <sync_token> isn't a valid sync token returned by GenSyncPointCHROMIUM, the
- command is equivalent to a no-op and no error is generated.
+ <sync_token> was generated by GenUnverifiedSyncTokenCHROMIUM and the
+ corresponding fence sync context required more than just flush ordering
+ to guarantee synchronization, a INVALID_OPERATION error is generated. If
+ <sync_token> isn't a valid sync token returned by GenSyncPointCHROMIUM or
+ GenUnverifiedSyncTokenCHROMIUM, the result is undefined.
New Tokens
@@ -89,6 +107,10 @@ Errors
INVALID_OPERATION is generated if the <fence_sync> parameter of
GenSyncPointCHROMIUM has not been flushed to the server.
+ INVALID_OPERATION is generated if the <sync_token> parameter of
+ WaitSyncTokenCHROMIUM was generated using GenUnverifiedSyncTokenCHROMIUM
+ but the two contexts must be synchronized with more than just flush order.
+
New State
None.
@@ -97,5 +119,7 @@ Revision History
2/25/2013 Documented the extension
- 9/8/2015 Modified functions to InsertFenceSyncCHROMIUM,
+ 9/8/2015 Modified functions InsertFenceSyncCHROMIUM,
GenSyncTokenCHROMIUM, and WaitSyncTokenCHROMIUM.
+
+ 10/12/2015 Added function GenUnverifiedSyncTokenCHROMIUM.
diff --git a/gpu/GLES2/gl2chromium_autogen.h b/gpu/GLES2/gl2chromium_autogen.h
index 3b30b9b..901c753 100644
--- a/gpu/GLES2/gl2chromium_autogen.h
+++ b/gpu/GLES2/gl2chromium_autogen.h
@@ -329,6 +329,8 @@
#define glWaitSyncPointCHROMIUM GLES2_GET_FUN(WaitSyncPointCHROMIUM)
#define glInsertFenceSyncCHROMIUM GLES2_GET_FUN(InsertFenceSyncCHROMIUM)
#define glGenSyncTokenCHROMIUM GLES2_GET_FUN(GenSyncTokenCHROMIUM)
+#define glGenUnverifiedSyncTokenCHROMIUM \
+ GLES2_GET_FUN(GenUnverifiedSyncTokenCHROMIUM)
#define glWaitSyncTokenCHROMIUM GLES2_GET_FUN(WaitSyncTokenCHROMIUM)
#define glDrawBuffersEXT GLES2_GET_FUN(DrawBuffersEXT)
#define glDiscardBackbufferCHROMIUM GLES2_GET_FUN(DiscardBackbufferCHROMIUM)