Enable cpu-array dynamic vertex data on SGX.
R=robertphillips@google.com
Review URL: https://codereview.appspot.com/7388045
git-svn-id: http://skia.googlecode.com/svn/trunk@7830 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index bd18e56..1276a65 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -169,8 +169,12 @@
ctxInfo.hasExtension("GL_ARB_fragment_coord_conventions");
}
- // Perhaps we should look at the renderer string and limit to Mali GPUs.
- if (kARM_GrGLVendor == ctxInfo.vendor() && !GR_GL_MUST_USE_VBO) {
+ // SGX and Mali GPUs that are based on a tiled-deferred architecture that have trouble with
+ // frequently changing VBOs. We've measured a performance increase using non-VBO vertex
+ // data for dynamic content on these GPUs. Perhaps we should read the renderer string and
+ // limit this decision to specific GPU families rather than basing it on the vendor alone.
+ if (!GR_GL_MUST_USE_VBO &&
+ (kARM_GrGLVendor == ctxInfo.vendor() || kImagination_GrGLVendor == ctxInfo.vendor())) {
fUseNonVBOVertexAndIndexDynamicData = true;
}
diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp
index 225650c..88c81b7 100644
--- a/src/gpu/gl/GrGLUtil.cpp
+++ b/src/gpu/gl/GrGLUtil.cpp
@@ -168,14 +168,16 @@
GrGLVendor GrGLGetVendorFromString(const char* vendorString) {
if (NULL != vendorString) {
- if (0 == strcmp(vendorString, "Intel")) {
- return kIntel_GrGLVendor;
- }
if (0 == strcmp(vendorString, "ARM")) {
return kARM_GrGLVendor;
}
+ if (0 == strcmp(vendorString, "Imagination Technologies")) {
+ return kImagination_GrGLVendor;
+ }
+ if (0 == strcmp(vendorString, "Intel")) {
+ return kIntel_GrGLVendor;
+ }
}
-
return kOther_GrGLVendor;
}
diff --git a/src/gpu/gl/GrGLUtil.h b/src/gpu/gl/GrGLUtil.h
index da0c7c3..30995a9 100644
--- a/src/gpu/gl/GrGLUtil.h
+++ b/src/gpu/gl/GrGLUtil.h
@@ -20,9 +20,11 @@
* This list is lazily updated as required.
*/
enum GrGLVendor {
- kIntel_GrGLVendor,
kARM_GrGLVendor,
- kOther_GrGLVendor,
+ kImagination_GrGLVendor,
+ kIntel_GrGLVendor,
+
+ kOther_GrGLVendor
};
#define GR_GL_VER(major, minor) ((static_cast<int>(major) << 16) | \