diff options
author | 2016-09-15 09:56:28 -0700 | |
---|---|---|
committer | 2016-09-15 09:56:28 -0700 | |
commit | 35b26a457100804b7a782cdff1132d2b65176c35 (patch) | |
tree | 33534f2f473f3a3e7cc9640c79895a9551ad6c94 /src/gpu/instanced/GLInstancedRendering.cpp | |
parent | 5caf398cacbfd48118a6e925f7145360cb1fb587 (diff) |
simple fix?
Scope cmdInfo more tightly to where it's not a null reference.
BUG=skia:5759
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2342063002
Review-Url: https://codereview.chromium.org/2342063002
Diffstat (limited to 'src/gpu/instanced/GLInstancedRendering.cpp')
-rw-r--r-- | src/gpu/instanced/GLInstancedRendering.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gpu/instanced/GLInstancedRendering.cpp b/src/gpu/instanced/GLInstancedRendering.cpp index 3d9058ec3e..bd014ecca8 100644 --- a/src/gpu/instanced/GLInstancedRendering.cpp +++ b/src/gpu/instanced/GLInstancedRendering.cpp @@ -242,18 +242,19 @@ void GLInstancedRendering::onDraw(const GrPipeline& pipeline, const InstanceProc int emulatedBaseInstance = batch->fEmulatedBaseInstance; for (int i = 0; i < numCommands; ++i) { int glCmdIdx = batch->fGLDrawCmdsIdx + i; - const GLDrawCmdInfo& cmdInfo = fGLDrawCmdsInfo[glCmdIdx]; this->flushInstanceAttribs(emulatedBaseInstance); if (fDrawIndirectBuffer) { GL_CALL(DrawElementsIndirect(GR_GL_TRIANGLES, GR_GL_UNSIGNED_BYTE, (GrGLDrawElementsIndirectCommand*) nullptr + glCmdIdx)); } else { + const GLDrawCmdInfo& cmdInfo = fGLDrawCmdsInfo[glCmdIdx]; GL_CALL(DrawElementsInstanced(GR_GL_TRIANGLES, cmdInfo.fGeometry.fCount, GR_GL_UNSIGNED_BYTE, (GrGLubyte*) nullptr + cmdInfo.fGeometry.fStart, cmdInfo.fInstanceCount)); } if (!glCaps.baseInstanceSupport()) { + const GLDrawCmdInfo& cmdInfo = fGLDrawCmdsInfo[glCmdIdx]; emulatedBaseInstance += cmdInfo.fInstanceCount; } } |