aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLCaps.cpp
diff options
context:
space:
mode:
authorGravatar cdalton <cdalton@nvidia.com>2016-02-05 10:09:51 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-05 10:09:51 -0800
commit06604b95622359640a1c2028b885646deda28d52 (patch)
tree5ef3c819b4039da55a0a915921243fa9e1e5f662 /src/gpu/gl/GrGLCaps.cpp
parentaf8bc7d7a4fb1fbbc15bb0881a360ff0d7551ea2 (diff)
Add GL indirect drawing APIs
Diffstat (limited to 'src/gpu/gl/GrGLCaps.cpp')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 1a87274b45..a913fbeca2 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;
@@ -482,6 +485,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) {
@@ -936,6 +950,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"));