skia: Make the validate match interface for *_draw_instanced
For whatever reason, on the Mac, the command buffer is reporting
ARB_draw_instanced as a valid extension. This is probably a bug in the
command buffer and I'll look into this later.
In Skia, we don't check for ARB_draw_instanced in GLES2 when building
the interface, but during the validate, we do, so we ended up failing
the validation.
Looking a bit further at the specs, ARB_draw_instanced is GL only,
whereas EXT_draw_instanced is both GL and GLES. I've updated the code
to reflect this.
See:
https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/specs/ARB/draw_instanced.txt
https://www.opengl.org/registry/specs/EXT/draw_instanced.txt
Everything above also applies to ARB/EXT_instanced_arrays
https://www.khronos.org/registry/gles/extensions/EXT/EXT_instanced_arrays.txt
https://www.opengl.org/registry/specs/ARB/instanced_arrays.txt
Review URL: https://codereview.chromium.org/1409053003
diff --git a/src/gpu/gl/GrGLAssembleInterface.cpp b/src/gpu/gl/GrGLAssembleInterface.cpp
index 294e6df..c4d3e13 100644
--- a/src/gpu/gl/GrGLAssembleInterface.cpp
+++ b/src/gpu/gl/GrGLAssembleInterface.cpp
@@ -317,7 +317,8 @@
GET_PROC(GetProgramResourceLocation);
}
- if (glVer >= GR_GL_VER(3,1) || extensions.has("GL_ARB_draw_instanced")) {
+ if (glVer >= GR_GL_VER(3,1) || extensions.has("GL_ARB_draw_instanced") ||
+ extensions.has("GL_EXT_draw_instanced")) {
GET_PROC(DrawArraysInstanced);
GET_PROC(DrawElementsInstanced);
}
diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp
index ecd4003..71de952 100644
--- a/src/gpu/gl/GrGLInterface.cpp
+++ b/src/gpu/gl/GrGLInterface.cpp
@@ -544,23 +544,35 @@
}
}
- if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1)) ||
- (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) ||
- fExtensions.has("GL_ARB_draw_instanced") ||
- fExtensions.has("GL_EXT_draw_instanced")) {
- if (nullptr == fFunctions.fDrawArraysInstanced ||
- nullptr == fFunctions.fDrawElementsInstanced) {
- RETURN_FALSE_INTERFACE
- }
+ if (kGL_GrGLStandard == fStandard) {
+ if (glVer >= GR_GL_VER(3,1) ||
+ fExtensions.has("GL_EXT_draw_instanced") || fExtensions.has("GL_ARB_draw_instanced")) {
+ if (nullptr == fFunctions.fDrawArraysInstanced ||
+ nullptr == fFunctions.fDrawElementsInstanced) {
+ RETURN_FALSE_INTERFACE
+ }
+ }
+ } else if (kGLES_GrGLStandard == fStandard) {
+ if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_draw_instanced")) {
+ if (nullptr == fFunctions.fDrawArraysInstanced ||
+ nullptr == fFunctions.fDrawElementsInstanced) {
+ RETURN_FALSE_INTERFACE
+ }
+ }
}
- if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,2)) ||
- (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) ||
- fExtensions.has("GL_ARB_instanced_arrays") ||
- fExtensions.has("GL_EXT_instanced_arrays")) {
- if (nullptr == fFunctions.fVertexAttribDivisor) {
- RETURN_FALSE_INTERFACE
- }
+ if (kGL_GrGLStandard == fStandard) {
+ if (glVer >= GR_GL_VER(3,2) || fExtensions.has("GL_ARB_instanced_arrays")) {
+ if (nullptr == fFunctions.fVertexAttribDivisor) {
+ RETURN_FALSE_INTERFACE
+ }
+ }
+ } else if (kGLES_GrGLStandard == fStandard) {
+ if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_instanced_arrays")) {
+ if (nullptr == fFunctions.fVertexAttribDivisor) {
+ RETURN_FALSE_INTERFACE
+ }
+ }
}
if (fExtensions.has("GL_NV_bindless_texture")) {