Index: src/gpu/gl/GrGLCaps.cpp |
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp |
index 599e375c231b3e1f4e2992b163d20d2058ce98d5..1c9400ceedeff40f1d7987150a1d25ce6776c200 100644 |
--- a/src/gpu/gl/GrGLCaps.cpp |
+++ b/src/gpu/gl/GrGLCaps.cpp |
@@ -41,6 +41,9 @@ GrGLCaps::GrGLCaps(const GrContextOptions& contextOptions, |
fDebugSupport = false; |
fES2CompatibilitySupport = false; |
fMultisampleDisableSupport = false; |
+ fDrawIndirectSupport = false; |
+ fMultiDrawIndirectSupport = false; |
+ fBaseInstanceSupport = false; |
fUseNonVBOVertexAndIndexDynamicData = false; |
fIsCoreProfile = false; |
fBindFragDataLocationSupport = false; |
@@ -483,6 +486,17 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, |
ctxInfo.hasExtension("GL_EXT_instanced_arrays")); |
} |
+ if (kGL_GrGLStandard == standard) { |
+ // We don't use ARB_draw_indirect because it does not support a base instance. |
+ // We don't use ARB_multi_draw_indirect because it does not support GL_DRAW_INDIRECT_BUFFER. |
+ fDrawIndirectSupport = |
+ fMultiDrawIndirectSupport = fBaseInstanceSupport = version >= GR_GL_VER(4,3); |
+ } else { |
+ fDrawIndirectSupport = version >= GR_GL_VER(3,1); |
+ fMultiDrawIndirectSupport = ctxInfo.hasExtension("GL_EXT_multi_draw_indirect"); |
+ fBaseInstanceSupport = ctxInfo.hasExtension("GL_EXT_base_instance"); |
+ } |
+ |
this->initShaderPrecisionTable(ctxInfo, gli, glslCaps); |
if (contextOptions.fUseShaderSwizzling) { |
@@ -937,6 +951,9 @@ SkString GrGLCaps::dump() const { |
r.appendf("Direct state access support: %s\n", (fDirectStateAccessSupport ? "YES": "NO")); |
r.appendf("Debug support: %s\n", (fDebugSupport ? "YES": "NO")); |
r.appendf("Multisample disable support: %s\n", (fMultisampleDisableSupport ? "YES" : "NO")); |
+ r.appendf("Draw indirect support: %s\n", (fDrawIndirectSupport ? "YES" : "NO")); |
+ r.appendf("Multi draw indirect support: %s\n", (fMultiDrawIndirectSupport ? "YES" : "NO")); |
+ r.appendf("Base instance support: %s\n", (fBaseInstanceSupport ? "YES" : "NO")); |
r.appendf("Use non-VBO for dynamic data: %s\n", |
(fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
r.appendf("SRGB write contol: %s\n", (fSRGBWriteControl ? "YES" : "NO")); |