Implement support for using GL ES 3.0 with command buffer
Adds a new 'api': --config gpu(api=commandbuffer3) for dm/nanobench.
BUG=skia:4943
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1684413003
Review URL: https://codereview.chromium.org/1684413003
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 546b0bf..da7907b 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -114,7 +114,7 @@
} else {
// Qualcomm Adreno drivers appear to have issues with texture storage.
fTexStorageSupport = (version >= GR_GL_VER(3,0) &&
- kQualcomm_GrGLVendor != ctxInfo.vendor()) ||
+ kQualcomm_GrGLVendor != ctxInfo.vendor()) &&
ctxInfo.hasExtension("GL_EXT_texture_storage");
}
@@ -360,12 +360,12 @@
} else {
// Unextended GLES2 doesn't have any buffer mapping.
fMapBufferFlags = kNone_MapBufferType;
- if (ctxInfo.hasExtension("GL_CHROMIUM_map_sub")) {
- fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag;
- fMapBufferType = kChromium_MapBufferType;
- } else if (version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_EXT_map_buffer_range")) {
+ if (version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_EXT_map_buffer_range")) {
fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag;
fMapBufferType = kMapBufferRange_MapBufferType;
+ } else if (ctxInfo.hasExtension("GL_CHROMIUM_map_sub")) {
+ fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag;
+ fMapBufferType = kChromium_MapBufferType;
} else if (ctxInfo.hasExtension("GL_OES_mapbuffer")) {
fMapBufferFlags = kCanMap_MapFlag;
fMapBufferType = kMapBuffer_MapBufferType;
@@ -520,6 +520,17 @@
fTextureSwizzleSupport = false;
}
+ // TODO: remove after command buffer supports full ES 3.0.
+ if (kGLES_GrGLStandard == standard && version >= GR_GL_VER(3, 0) &&
+ kChromium_GrGLDriver == ctxInfo.driver()) {
+ fTexStorageSupport = false;
+ fSupportsInstancedDraws = false;
+ fTextureSwizzleSupport = false;
+ SkASSERT(ctxInfo.hasExtension("GL_CHROMIUM_map_sub"));
+ fMapBufferFlags = kCanMap_MapFlag | kSubset_MapFlag;
+ fMapBufferType = kChromium_MapBufferType;
+ }
+
// Requires fTextureRedSupport, fTextureSwizzleSupport, msaa support, ES compatibility have
// already been detected.
this->initConfigTable(ctxInfo, gli, glslCaps);