aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@google.com>2016-09-30 08:39:02 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-30 08:39:03 -0700
commit84741b308496409f4ff662658167221fc6801bbe (patch)
treec2a42e12fdf9083453bbc46c28d561208162d2d7 /include
parent714750595581167b965e1530d6aae052818ad52a (diff)
Add fence support for TransferBuffers
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrCaps.h4
-rw-r--r--include/gpu/GrTypesPriv.h5
-rw-r--r--include/gpu/gl/GrGLFunctions.h5
-rw-r--r--include/gpu/gl/GrGLInterface.h5
-rw-r--r--include/gpu/gl/GrGLTypes.h1
5 files changed, 20 insertions, 0 deletions
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h
index b7c91c4813..a97be72c3f 100644
--- a/include/gpu/GrCaps.h
+++ b/include/gpu/GrCaps.h
@@ -286,6 +286,8 @@ public:
bool sampleShadingSupport() const { return fSampleShadingSupport; }
+ bool fenceSyncSupport() const { return fFenceSyncSupport; }
+
protected:
/** Subclasses must call this at the end of their constructors in order to apply caps
overrides requested by the client. Note that overrides will only reduce the caps never
@@ -324,6 +326,8 @@ protected:
bool fPreferVRAMUseOverFlushes : 1;
bool fSampleShadingSupport : 1;
+ // TODO: this may need to be an enum to support different fence types
+ bool fFenceSyncSupport : 1;
InstancedSupport fInstancedSupport;
diff --git a/include/gpu/GrTypesPriv.h b/include/gpu/GrTypesPriv.h
index d60fab1337..636e72a019 100644
--- a/include/gpu/GrTypesPriv.h
+++ b/include/gpu/GrTypesPriv.h
@@ -482,4 +482,9 @@ template <typename T> T * const * sk_sp_address_as_pointer_address(sk_sp<T> cons
return reinterpret_cast<T * const *>(sp);
}
+/*
+ * Object for CPU-GPU synchronization
+ */
+typedef intptr_t GrFence;
+
#endif
diff --git a/include/gpu/gl/GrGLFunctions.h b/include/gpu/gl/GrGLFunctions.h
index 7e720cd867..eccd1bf002 100644
--- a/include/gpu/gl/GrGLFunctions.h
+++ b/include/gpu/gl/GrGLFunctions.h
@@ -345,6 +345,11 @@ typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLFlushMappedNamedBufferRangeProc)(GrGL
// OpenGL 3.1
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLTextureBufferProc)(GrGLuint texture, GrGLenum target, GrGLenum internalformat, GrGLuint buffer);
+/* ARB_sync */
+typedef GrGLsync (GR_GL_FUNCTION_TYPE* GrGLFenceSyncProc)(GrGLenum condition, GrGLbitfield flags);
+typedef GrGLenum (GR_GL_FUNCTION_TYPE* GrGLClientWaitSyncProc)(GrGLsync sync, GrGLbitfield flags, GrGLuint64 timeout);
+typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLDeleteSyncProc)(GrGLsync sync);
+
/* KHR_debug */
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLDebugMessageControlProc)(GrGLenum source, GrGLenum type, GrGLenum severity, GrGLsizei count, const GrGLuint* ids, GrGLboolean enabled);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLDebugMessageInsertProc)(GrGLenum source, GrGLenum type, GrGLuint id, GrGLenum severity, GrGLsizei length, const GrGLchar* buf);
diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h
index 27184adcb5..60109ec187 100644
--- a/include/gpu/gl/GrGLInterface.h
+++ b/include/gpu/gl/GrGLInterface.h
@@ -452,6 +452,11 @@ public:
// OpenGL 3.1
GrGLFunction<GrGLTextureBufferProc> fTextureBuffer;
+ /* ARB_sync */
+ GrGLFunction<GrGLFenceSyncProc> fFenceSync;
+ GrGLFunction<GrGLClientWaitSyncProc> fClientWaitSync;
+ GrGLFunction<GrGLDeleteSyncProc> fDeleteSync;
+
/* KHR_debug */
GrGLFunction<GrGLDebugMessageControlProc> fDebugMessageControl;
GrGLFunction<GrGLDebugMessageInsertProc> fDebugMessageInsert;
diff --git a/include/gpu/gl/GrGLTypes.h b/include/gpu/gl/GrGLTypes.h
index d0edcf101e..5b9e31de1a 100644
--- a/include/gpu/gl/GrGLTypes.h
+++ b/include/gpu/gl/GrGLTypes.h
@@ -58,6 +58,7 @@ typedef signed long int GrGLintptr;
typedef signed long int GrGLsizeiptr;
#endif
typedef void* GrGLeglImage;
+typedef void* GrGLsync;
struct GrGLDrawArraysIndirectCommand {
GrGLuint fCount;