aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/gpu/gl/GrGLInterface.h6
-rw-r--r--src/gpu/gl/GrGLAssembleInterface.cpp26
-rw-r--r--src/gpu/gl/GrGLCaps.cpp10
-rw-r--r--src/gpu/gl/GrGLInterface.cpp6
4 files changed, 25 insertions, 23 deletions
diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h
index 47dfbaab20..b735b8fadf 100644
--- a/include/gpu/gl/GrGLInterface.h
+++ b/include/gpu/gl/GrGLInterface.h
@@ -206,6 +206,8 @@ public:
GrGLFunction<GrGLMapBufferRangeProc> fMapBufferRange;
GrGLFunction<GrGLMapBufferSubDataProc> fMapBufferSubData;
GrGLFunction<GrGLMapTexSubImage2DProc> fMapTexSubImage2D;
+ GrGLFunction<GrGLMultiDrawArraysIndirectProc> fMultiDrawArraysIndirect;
+ GrGLFunction<GrGLMultiDrawElementsIndirectProc> fMultiDrawElementsIndirect;
GrGLFunction<GrGLPixelStoreiProc> fPixelStorei;
GrGLFunction<GrGLPopGroupMarkerProc> fPopGroupMarker;
GrGLFunction<GrGLPushGroupMarkerProc> fPushGroupMarker;
@@ -323,10 +325,6 @@ public:
/* NV_framebuffer_mixed_samples */
GrGLFunction<GrGLCoverageModulationProc> fCoverageModulation;
- /* EXT_multi_draw_indirect */
- GrGLFunction<GrGLMultiDrawArraysIndirectProc> fMultiDrawArraysIndirect;
- GrGLFunction<GrGLMultiDrawElementsIndirectProc> fMultiDrawElementsIndirect;
-
/* NV_bindless_texture */
// We use the NVIDIA verson for now because it does not require dynamically uniform handles.
// We may switch the the ARB version and/or omit methods in the future.
diff --git a/src/gpu/gl/GrGLAssembleInterface.cpp b/src/gpu/gl/GrGLAssembleInterface.cpp
index ba27b36790..539d1ae0bc 100644
--- a/src/gpu/gl/GrGLAssembleInterface.cpp
+++ b/src/gpu/gl/GrGLAssembleInterface.cpp
@@ -144,8 +144,7 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) {
GET_PROC(DrawElementsInstanced);
}
- if (glVer >= GR_GL_VER(4,0)) {
- // We don't use ARB_draw_indirect because it does not support a base instance.
+ if (glVer >= GR_GL_VER(4,0) || extensions.has("GL_ARB_draw_indirect")) {
GET_PROC(DrawArraysIndirect);
GET_PROC(DrawElementsIndirect);
}
@@ -190,6 +189,12 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) {
GET_PROC(LineWidth);
GET_PROC(LinkProgram);
GET_PROC(MapBuffer);
+
+ if (glVer >= GR_GL_VER(4,3) || extensions.has("GL_ARB_multi_draw_indirect")) {
+ GET_PROC(MultiDrawArraysIndirect);
+ GET_PROC(MultiDrawElementsIndirect);
+ }
+
GET_PROC(PixelStorei);
if (extensions.has("GL_EXT_raster_multisample")) {
GET_PROC_SUFFIX(RasterSamples, EXT);
@@ -368,12 +373,6 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) {
GET_PROC(GetProgramResourceLocation);
}
- if (glVer >= GR_GL_VER(4,3)) {
- // We don't use ARB_multi_draw_indirect because it does not support GL_DRAW_INDIRECT_BUFFER.
- GET_PROC(MultiDrawArraysIndirect);
- GET_PROC(MultiDrawElementsIndirect);
- }
-
if (extensions.has("GL_NV_bindless_texture")) {
GET_PROC_SUFFIX(GetTextureHandle, NV);
GET_PROC_SUFFIX(GetTextureSamplerHandle, NV);
@@ -640,6 +639,12 @@ const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) {
GET_PROC(IsTexture);
GET_PROC(LineWidth);
GET_PROC(LinkProgram);
+
+ if (extensions.has("GL_EXT_multi_draw_indirect")) {
+ GET_PROC_SUFFIX(MultiDrawArraysIndirect, EXT);
+ GET_PROC_SUFFIX(MultiDrawElementsIndirect, EXT);
+ }
+
GET_PROC(PixelStorei);
if (extensions.has("GL_EXT_raster_multisample")) {
@@ -854,11 +859,6 @@ const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) {
GET_PROC_SUFFIX(CoverageModulation, CHROMIUM);
}
- if (extensions.has("GL_EXT_multi_draw_indirect")) {
- GET_PROC_SUFFIX(MultiDrawArraysIndirect, EXT);
- GET_PROC_SUFFIX(MultiDrawElementsIndirect, EXT);
- }
-
if (extensions.has("GL_NV_bindless_texture")) {
GET_PROC_SUFFIX(GetTextureHandle, NV);
GET_PROC_SUFFIX(GetTextureSamplerHandle, NV);
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index c0fc90189f..9aae7e5aef 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -519,10 +519,12 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
}
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);
+ fDrawIndirectSupport = version >= GR_GL_VER(4,0) ||
+ ctxInfo.hasExtension("GL_ARB_draw_indirect");
+ fBaseInstanceSupport = version >= GR_GL_VER(4,2);
+ fMultiDrawIndirectSupport = version >= GR_GL_VER(4,3) ||
+ (!fBaseInstanceSupport && // The ARB extension has no base inst.
+ ctxInfo.hasExtension("GL_ARB_multi_draw_indirect"));
} else {
fDrawIndirectSupport = version >= GR_GL_VER(3,1);
fMultiDrawIndirectSupport = ctxInfo.hasExtension("GL_EXT_multi_draw_indirect");
diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp
index 4e6ad08611..76886015e0 100644
--- a/src/gpu/gl/GrGLInterface.cpp
+++ b/src/gpu/gl/GrGLInterface.cpp
@@ -600,7 +600,8 @@ bool GrGLInterface::validate() const {
}
}
- if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) ||
+ if ((kGL_GrGLStandard == fStandard &&
+ (glVer >= GR_GL_VER(4,0) || fExtensions.has("GL_ARB_draw_indirect"))) ||
(kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1))) {
if (NULL == fFunctions.fDrawArraysIndirect ||
NULL == fFunctions.fDrawElementsIndirect) {
@@ -608,7 +609,8 @@ bool GrGLInterface::validate() const {
}
}
- if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) ||
+ if ((kGL_GrGLStandard == fStandard &&
+ (glVer >= GR_GL_VER(4,3) || fExtensions.has("GL_ARB_multi_draw_indirect"))) ||
(kGLES_GrGLStandard == fStandard && fExtensions.has("GL_EXT_multi_draw_indirect"))) {
if (NULL == fFunctions.fMultiDrawArraysIndirect ||
NULL == fFunctions.fMultiDrawElementsIndirect) {