aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLGpu.cpp
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2017-05-17 15:15:50 -0600
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-18 16:41:10 +0000
commit9926f4bf652e2a526a2f94a85547ed8cfe7d1b7b (patch)
treea57732d46332fc681de5421b695547753fff06a8 /src/gpu/gl/GrGLGpu.cpp
parenta4c93ac535d3b0ed979c7bf666f09aa7dbf1f0eb (diff)
Add drawArraysBaseVertexIsBroken flag
A non-zero base vertex in glDrawArrays appears to not always work on Adreno. Bug: skia:6650 Change-Id: I301eaba8c7790ed814a2ab8d8c53dd2b9e0d77d1 Reviewed-on: https://skia-review.googlesource.com/17083 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/gl/GrGLGpu.cpp')
-rw-r--r--src/gpu/gl/GrGLGpu.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 51fef2c823..c52d1d141f 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -2649,7 +2649,7 @@ void GrGLGpu::draw(const GrPipeline& pipeline,
for (const GrMesh::PatternBatch batch : mesh) {
this->setupGeometry(primProc, mesh.indexBuffer(), mesh.vertexBuffer(),
batch.fBaseVertex);
- // mesh.baseVertex() was accounted for by setupGeometry.
+ // batch.fBaseVertex was accounted for by setupGeometry.
if (this->glCaps().drawRangeElementsSupport()) {
// We assume here that the GrMeshDrawOps that generated the mesh used the full
// 0..vertexCount()-1 range.
@@ -2665,8 +2665,14 @@ void GrGLGpu::draw(const GrPipeline& pipeline,
fStats.incNumDraws();
}
} else {
- this->setupGeometry(primProc, mesh.indexBuffer(), mesh.vertexBuffer(), 0);
- GL_CALL(DrawArrays(primType, mesh.baseVertex(), mesh.vertexCount()));
+ if (this->glCaps().drawArraysBaseVertexIsBroken()) {
+ this->setupGeometry(primProc, mesh.indexBuffer(), mesh.vertexBuffer(),
+ mesh.baseVertex());
+ GL_CALL(DrawArrays(primType, 0, mesh.vertexCount()));
+ } else {
+ this->setupGeometry(primProc, mesh.indexBuffer(), mesh.vertexBuffer(), 0);
+ GL_CALL(DrawArrays(primType, mesh.baseVertex(), mesh.vertexCount()));
+ }
fStats.incNumDraws();
}
}