diff options
author | 2017-05-31 12:51:23 -0600 | |
---|---|---|
committer | 2017-05-31 20:40:20 +0000 | |
commit | 1d6163577c8a4f1372208e2c9e03b1a69906d385 (patch) | |
tree | fdacaa2e860d507bafca16cef0cb6e6e7861a1aa /src/gpu/ops/GrMSAAPathRenderer.cpp | |
parent | fa6d865215b48fac4ee24c120736e500d418f641 (diff) |
Add support for instanced draws
Adds an instance buffer to GrMesh and instance attribs to
GrPrimitiveProcessor. Implements support in GL and Vulkan. Adds unit
tests for instanced rendering with GrMesh.
Bug: skia:
Change-Id: If1a9920feb9366f346b8c37cf914713c49129b3a
Reviewed-on: https://skia-review.googlesource.com/16200
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/ops/GrMSAAPathRenderer.cpp')
-rw-r--r-- | src/gpu/ops/GrMSAAPathRenderer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gpu/ops/GrMSAAPathRenderer.cpp b/src/gpu/ops/GrMSAAPathRenderer.cpp index 36faf2f2c9..50a839d7b0 100644 --- a/src/gpu/ops/GrMSAAPathRenderer.cpp +++ b/src/gpu/ops/GrMSAAPathRenderer.cpp @@ -337,7 +337,7 @@ private: const GrBuffer* lineVertexBuffer; int firstLineVertex; MSAALineVertices lines; - size_t lineVertexStride = sizeof(MSAALineVertices::Vertex); + int lineVertexStride = sizeof(MSAALineVertices::Vertex); lines.vertices = (MSAALineVertices::Vertex*) target->makeVertexSpace(lineVertexStride, fMaxLineVertices, &lineVertexBuffer, @@ -350,7 +350,7 @@ private: SkDEBUGCODE(lines.verticesEnd = lines.vertices + fMaxLineVertices;) MSAAQuadVertices quads; - size_t quadVertexStride = sizeof(MSAAQuadVertices::Vertex); + int quadVertexStride = sizeof(MSAAQuadVertices::Vertex); SkAutoMalloc quadVertexPtr(fMaxQuadVertices * quadVertexStride); quads.vertices = (MSAAQuadVertices::Vertex*) quadVertexPtr.get(); quads.nextVertex = quads.vertices; @@ -412,7 +412,7 @@ private: GrMesh lineMeshes(primitiveType); if (!fIsIndexed) { - lineMeshes.setNonIndexed(lineVertexOffset); + lineMeshes.setNonIndexedNonInstanced(lineVertexOffset); } else { lineMeshes.setIndexed(lineIndexBuffer, lineIndexOffset, firstLineIndex, 0, lineVertexOffset - 1); @@ -439,7 +439,7 @@ private: memcpy(quadVertices, quads.vertices, quadVertexStride * quadVertexOffset); GrMesh quadMeshes(kTriangles_GrPrimitiveType); if (!fIsIndexed) { - quadMeshes.setNonIndexed(quadVertexOffset); + quadMeshes.setNonIndexedNonInstanced(quadVertexOffset); } else { const GrBuffer* quadIndexBuffer; int firstQuadIndex; |