diff options
author | 2015-04-21 11:45:56 -0700 | |
---|---|---|
committer | 2015-04-21 11:45:56 -0700 | |
commit | fd4167ddf12ea723b828462ec1507acebdef5776 (patch) | |
tree | 88b2ded78a3c7a85637cc097a78b472e89b1061b /src/gpu/gl | |
parent | d557462f1fd274400107dd28ea36900da51e42a6 (diff) |
Import glTextureBarrier
BUG=skia:
Review URL: https://codereview.chromium.org/1090163002
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLAssembleInterface.cpp | 9 | ||||
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 8 | ||||
-rw-r--r-- | src/gpu/gl/GrGLInterface.cpp | 15 |
3 files changed, 32 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLAssembleInterface.cpp b/src/gpu/gl/GrGLAssembleInterface.cpp index 6a4fbe20e0..b0f0430ffb 100644 --- a/src/gpu/gl/GrGLAssembleInterface.cpp +++ b/src/gpu/gl/GrGLAssembleInterface.cpp @@ -163,6 +163,11 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) { GET_PROC_SUFFIX(TexStorage2D, EXT); } GET_PROC(TexSubImage2D); + if (glVer >= GR_GL_VER(4,5) || extensions.has("GL_ARB_texture_barrier")) { + GET_PROC(TextureBarrier); + } else if (extensions.has("GL_NV_texture_barrier")) { + GET_PROC_SUFFIX(TextureBarrier, NV); + } GET_PROC(Uniform1f); GET_PROC(Uniform1i); GET_PROC(Uniform1fv); @@ -404,6 +409,10 @@ const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) { GET_PROC_SUFFIX(TexStorage2D, EXT); } + if (extensions.has("GL_NV_texture_barrier")) { + GET_PROC_SUFFIX(TextureBarrier, NV); + } + GET_PROC_SUFFIX(DiscardFramebuffer, EXT); GET_PROC(Uniform1f); GET_PROC(Uniform1i); diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 895cce870e..73bf6f0ee6 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -186,6 +186,14 @@ bool GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { ctxInfo.hasExtension("GL_EXT_texture_storage"); } + if (kGL_GrGLStandard == standard) { + fTextureBarrierSupport = version >= GR_GL_VER(4,5) || + ctxInfo.hasExtension("GL_ARB_texture_barrier") || + ctxInfo.hasExtension("GL_NV_texture_barrier"); + } else { + fTextureBarrierSupport = ctxInfo.hasExtension("GL_NV_texture_barrier"); + } + // ARB_texture_rg is part of OpenGL 3.0, but mesa doesn't support GL_RED // and GL_RG on FBO textures. if (!ctxInfo.isMesa()) { diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp index 2e3dd1f039..da1c3fc0e1 100644 --- a/src/gpu/gl/GrGLInterface.cpp +++ b/src/gpu/gl/GrGLInterface.cpp @@ -306,6 +306,21 @@ bool GrGLInterface::validate() const { } } + // glTextureBarrier is part of desktop 4.5. There are also ARB and NV extensions. + if (kGL_GrGLStandard == fStandard) { + if (glVer >= GR_GL_VER(4,5) || + fExtensions.has("GL_ARB_texture_barrier") || + fExtensions.has("GL_NV_texture_barrier")) { + if (NULL == fFunctions.fTextureBarrier) { + RETURN_FALSE_INTERFACE + } + } + } else if (fExtensions.has("GL_NV_texture_barrier")) { + if (NULL == fFunctions.fTextureBarrier) { + RETURN_FALSE_INTERFACE + } + } + if (fExtensions.has("GL_EXT_discard_framebuffer")) { // FIXME: Remove this once Chromium is updated to provide this function #if 0 |