diff options
author | Brian Salomon <bsalomon@google.com> | 2016-11-15 12:36:29 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-15 19:37:35 +0000 |
commit | 0b63ceb10c6aef0b144b1cdee4e95b457968cd0c (patch) | |
tree | de8fe9db58f61decd0272816ef4e5c2b0d5076df /src/gpu | |
parent | d327e8c3d0ff9e9038c60f486d3f4023318e29a8 (diff) |
Add image functions to GrGLInterface
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4840
Change-Id: I250cc4e637765c321c90e33c9b3f25c4ad12fe04
Reviewed-on: https://skia-review.googlesource.com/4840
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/gl/GrGLAssembleInterface.cpp | 14 | ||||
-rw-r--r-- | src/gpu/gl/GrGLDefines.h | 9 | ||||
-rw-r--r-- | src/gpu/gl/GrGLInterface.cpp | 20 |
3 files changed, 43 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLAssembleInterface.cpp b/src/gpu/gl/GrGLAssembleInterface.cpp index 9dccd4bc22..7c51f4e806 100644 --- a/src/gpu/gl/GrGLAssembleInterface.cpp +++ b/src/gpu/gl/GrGLAssembleInterface.cpp @@ -532,6 +532,14 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) { 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); @@ -938,6 +946,12 @@ const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) { 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); diff --git a/src/gpu/gl/GrGLDefines.h b/src/gpu/gl/GrGLDefines.h index 8f739cc1f6..18dee280f0 100644 --- a/src/gpu/gl/GrGLDefines.h +++ b/src/gpu/gl/GrGLDefines.h @@ -242,6 +242,14 @@ #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 */ @@ -819,6 +827,7 @@ /* 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 diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp index 72c2b46d41..45d84add8d 100644 --- a/src/gpu/gl/GrGLInterface.cpp +++ b/src/gpu/gl/GrGLInterface.cpp @@ -830,5 +830,25 @@ bool GrGLInterface::validate() const { } } + 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; } |