diff options
author | Chris Dalton <csmartdalton@google.com> | 2017-05-31 12:51:23 -0600 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-31 20:40:20 +0000 |
commit | 1d6163577c8a4f1372208e2c9e03b1a69906d385 (patch) | |
tree | fdacaa2e860d507bafca16cef0cb6e6e7861a1aa /src/gpu/GrGpuCommandBuffer.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/GrGpuCommandBuffer.cpp')
-rw-r--r-- | src/gpu/GrGpuCommandBuffer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gpu/GrGpuCommandBuffer.cpp b/src/gpu/GrGpuCommandBuffer.cpp index 0c7bb9704f..5570a5a65e 100644 --- a/src/gpu/GrGpuCommandBuffer.cpp +++ b/src/gpu/GrGpuCommandBuffer.cpp @@ -42,8 +42,10 @@ bool GrGpuCommandBuffer::draw(const GrPipeline& pipeline, int meshCount, const SkRect& bounds) { #ifdef SK_DEBUG + SkASSERT(!primProc.hasInstanceAttribs() || this->gpu()->caps()->instanceAttribSupport()); for (int i = 0; i < meshCount; ++i) { - SkASSERT(SkToBool(primProc.numAttribs()) == meshes[i].hasVertexData()); + SkASSERT(primProc.hasVertexAttribs() == meshes[i].hasVertexData()); + SkASSERT(primProc.hasInstanceAttribs() == meshes[i].isInstanced()); } #endif |