typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLBindBufferProc)(GrGLenum target, GrGLuint buffer);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLBindFramebufferProc)(GrGLenum target, GrGLuint framebuffer);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLBindRenderbufferProc)(GrGLenum target, GrGLuint renderbuffer);
+typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLBindImageTextureProc)(GrGLuint unit, GrGLuint texture, GrGLint level, GrGLboolean layered, GrGLint layer, GrGLenum access, GrGLenum format);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLBindTextureProc)(GrGLenum target, GrGLuint texture);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLBindFragDataLocationProc)(GrGLuint program, GrGLuint colorNumber, const GrGLchar* name);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLBindFragDataLocationIndexedProc)(GrGLuint program, GrGLuint colorNumber, GrGLuint index, const GrGLchar * name);
typedef GrGLvoid* (GR_GL_FUNCTION_TYPE* GrGLMapBufferRangeProc)(GrGLenum target, GrGLintptr offset, GrGLsizeiptr length, GrGLbitfield access);
typedef GrGLvoid* (GR_GL_FUNCTION_TYPE* GrGLMapBufferSubDataProc)(GrGLuint target, GrGLintptr offset, GrGLsizeiptr size, GrGLenum access);
typedef GrGLvoid* (GR_GL_FUNCTION_TYPE* GrGLMapTexSubImage2DProc)(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, GrGLenum access);
+typedef GrGLvoid* (GR_GL_FUNCTION_TYPE* GrGLMemoryBarrierProc)(GrGLbitfield barriers);
+typedef GrGLvoid* (GR_GL_FUNCTION_TYPE* GrGLMemoryBarrierByRegionProc)(GrGLbitfield barriers);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPixelStoreiProc)(GrGLenum pname, GrGLint param);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPopGroupMarkerProc)();
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPushGroupMarkerProc)(GrGLsizei length, const char* marker);
GrGLFunction<GrGLBindFramebufferProc> fBindFramebuffer;
GrGLFunction<GrGLBindRenderbufferProc> fBindRenderbuffer;
GrGLFunction<GrGLBindTextureProc> fBindTexture;
+ GrGLFunction<GrGLBindImageTextureProc> fBindImageTexture;
GrGLFunction<GrGLBindVertexArrayProc> fBindVertexArray;
GrGLFunction<GrGLBlendBarrierProc> fBlendBarrier;
GrGLFunction<GrGLBlendColorProc> fBlendColor;
GrGLFunction<GrGLMapBufferRangeProc> fMapBufferRange;
GrGLFunction<GrGLMapBufferSubDataProc> fMapBufferSubData;
GrGLFunction<GrGLMapTexSubImage2DProc> fMapTexSubImage2D;
+ GrGLFunction<GrGLMemoryBarrierProc> fMemoryBarrier;
+ GrGLFunction<GrGLMemoryBarrierByRegionProc> fMemoryBarrierByRegion;
GrGLFunction<GrGLMultiDrawArraysIndirectProc> fMultiDrawArraysIndirect;
GrGLFunction<GrGLMultiDrawElementsIndirectProc> fMultiDrawElementsIndirect;
GrGLFunction<GrGLPixelStoreiProc> fPixelStorei;
GET_PROC(DeleteSync);
}
+ if (glVer >= GR_GL_VER(4, 2) || extensions.has("GL_ARB_shader_image_load_store")) {
+ GET_PROC(BindImageTexture);
+ GET_PROC(MemoryBarrier);
+ }
+ if (glVer >= GR_GL_VER(4, 5) || extensions.has("GL_ARB_ES3_1_compatibility")) {
+ GET_PROC(MemoryBarrierByRegion);
+ }
+
interface->fStandard = kGL_GrGLStandard;
interface->fExtensions.swap(&extensions);
GET_PROC(DeleteSync);
}
+ if (version >= GR_GL_VER(3, 1)) {
+ GET_PROC(BindImageTexture);
+ GET_PROC(MemoryBarrier);
+ GET_PROC(MemoryBarrierByRegion);
+ }
+
interface->fStandard = kGLES_GrGLStandard;
interface->fExtensions.swap(&extensions);
#define GR_GL_MULTISAMPLE_COVERAGE_MODES 0x8E12
#define GR_GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B
+#define GR_GL_MAX_IMAGE_UNITS 0x8F38
+#define GR_GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39
+#define GR_GL_MAX_IMAGE_SAMPLES 0x906D
+#define GR_GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA
+#define GR_GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD
+#define GR_GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE
+#define GR_GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF
+
/* GetTextureParameter */
/* GL_TEXTURE_MAG_FILTER */
/* GL_TEXTURE_MIN_FILTER */
/* Buffer Object */
#define GR_GL_READ_ONLY 0x88B8
#define GR_GL_WRITE_ONLY 0x88B9
+#define GR_GL_READ_WRITE 0x88BA
#define GR_GL_BUFFER_MAPPED 0x88BC
#define GR_GL_MAP_READ_BIT 0x0001
}
}
+ if (kGL_GrGLStandard == fStandard) {
+ if (glVer >= GR_GL_VER(4,2) || fExtensions.has("GL_ARB_shader_image_load_store")) {
+ if (nullptr == fFunctions.fBindImageTexture ||
+ nullptr == fFunctions.fMemoryBarrier) {
+ RETURN_FALSE_INTERFACE;
+ }
+ }
+ if (glVer >= GR_GL_VER(4,5) || fExtensions.has("GL_ARB_ES3_1_compatibility")) {
+ if (nullptr == fFunctions.fMemoryBarrierByRegion) {
+ RETURN_FALSE_INTERFACE;
+ }
+ }
+ } else if (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1)) {
+ if (nullptr == fFunctions.fBindImageTexture ||
+ nullptr == fFunctions.fMemoryBarrier ||
+ nullptr == fFunctions.fMemoryBarrierByRegion) {
+ RETURN_FALSE_INTERFACE;
+ }
+ }
+
return true;
}