bsalomon | cb8979d | 2015-05-05 09:51:38 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
egdaniel | 0e1853c | 2016-03-17 11:35:45 -0700 | [diff] [blame] | 8 | #ifndef GrMesh_DEFINED |
| 9 | #define GrMesh_DEFINED |
bsalomon | cb8979d | 2015-05-05 09:51:38 -0700 | [diff] [blame] | 10 | |
cdalton | 397536c | 2016-03-25 12:15:03 -0700 | [diff] [blame] | 11 | #include "GrBuffer.h" |
Hal Canary | 466c7d6 | 2017-07-03 15:11:49 -0400 | [diff] [blame] | 12 | #include "GrGpuResourceRef.h" |
bsalomon | cb8979d | 2015-05-05 09:51:38 -0700 | [diff] [blame] | 13 | |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 14 | class GrPrimitiveProcessor; |
| 15 | |
bsalomon | cb8979d | 2015-05-05 09:51:38 -0700 | [diff] [blame] | 16 | /** |
Brian Salomon | 25a8809 | 2016-12-01 09:36:50 -0500 | [diff] [blame] | 17 | * Used to communicate index and vertex buffers, counts, and offsets for a draw from GrOp to |
bsalomon | cb8979d | 2015-05-05 09:51:38 -0700 | [diff] [blame] | 18 | * GrGpu. It also holds the primitive type for the draw. TODO: Consider moving ownership of this |
| 19 | * and draw-issuing responsibility to GrPrimitiveProcessor. The rest of the vertex info lives there |
| 20 | * already (stride, attribute mappings). |
| 21 | */ |
Chris Dalton | bca46e2 | 2017-05-15 11:03:26 -0600 | [diff] [blame] | 22 | class GrMesh { |
| 23 | public: |
| 24 | GrMesh(GrPrimitiveType primitiveType) |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 25 | : fPrimitiveType(primitiveType) |
| 26 | , fBaseVertex(0) { |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 27 | SkDEBUGCODE(fNonIndexNonInstanceData.fVertexCount = -1;) |
Chris Dalton | bca46e2 | 2017-05-15 11:03:26 -0600 | [diff] [blame] | 28 | } |
| 29 | |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 30 | GrPrimitiveType primitiveType() const { return fPrimitiveType; } |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 31 | |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 32 | bool isIndexed() const { return SkToBool(fIndexBuffer.get()); } |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 33 | bool isInstanced() const { return SkToBool(fInstanceBuffer.get()); } |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 34 | bool hasVertexData() const { return SkToBool(fVertexBuffer.get()); } |
| 35 | |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 36 | void setNonIndexedNonInstanced(int vertexCount); |
| 37 | |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 38 | void setIndexed(const GrBuffer* indexBuffer, int indexCount, int baseIndex, |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 39 | uint16_t minIndexValue, uint16_t maxIndexValue, GrPrimitiveRestart); |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 40 | void setIndexedPatterned(const GrBuffer* indexBuffer, int indexCount, int vertexCount, |
Chris Dalton | bca46e2 | 2017-05-15 11:03:26 -0600 | [diff] [blame] | 41 | int patternRepeatCount, int maxPatternRepetitionsInIndexBuffer); |
| 42 | |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 43 | void setInstanced(const GrBuffer* instanceBuffer, int instanceCount, int baseInstance, |
| 44 | int vertexCount); |
| 45 | void setIndexedInstanced(const GrBuffer* indexBuffer, int indexCount, |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 46 | const GrBuffer* instanceBuffer, int instanceCount, int baseInstance, |
| 47 | GrPrimitiveRestart); |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 48 | |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 49 | void setVertexData(const GrBuffer* vertexBuffer, int baseVertex = 0); |
Chris Dalton | bca46e2 | 2017-05-15 11:03:26 -0600 | [diff] [blame] | 50 | |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 51 | class SendToGpuImpl { |
| 52 | public: |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 53 | virtual void sendMeshToGpu(GrPrimitiveType, const GrBuffer* vertexBuffer, int vertexCount, |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 54 | int baseVertex) = 0; |
Chris Dalton | bca46e2 | 2017-05-15 11:03:26 -0600 | [diff] [blame] | 55 | |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 56 | virtual void sendIndexedMeshToGpu(GrPrimitiveType, const GrBuffer* indexBuffer, |
| 57 | int indexCount, int baseIndex, uint16_t minIndexValue, |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 58 | uint16_t maxIndexValue, const GrBuffer* vertexBuffer, |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 59 | int baseVertex, GrPrimitiveRestart) = 0; |
Chris Dalton | bca46e2 | 2017-05-15 11:03:26 -0600 | [diff] [blame] | 60 | |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 61 | virtual void sendInstancedMeshToGpu(GrPrimitiveType, const GrBuffer* vertexBuffer, |
| 62 | int vertexCount, int baseVertex, |
| 63 | const GrBuffer* instanceBuffer, int instanceCount, |
| 64 | int baseInstance) = 0; |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 65 | |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 66 | virtual void sendIndexedInstancedMeshToGpu(GrPrimitiveType, const GrBuffer* indexBuffer, |
| 67 | int indexCount, int baseIndex, |
| 68 | const GrBuffer* vertexBuffer, int baseVertex, |
| 69 | const GrBuffer* instanceBuffer, |
| 70 | int instanceCount, int baseInstance, |
| 71 | GrPrimitiveRestart) = 0; |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 72 | |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 73 | virtual ~SendToGpuImpl() {} |
| 74 | }; |
| 75 | |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 76 | void sendToGpu(SendToGpuImpl*) const; |
Chris Dalton | bca46e2 | 2017-05-15 11:03:26 -0600 | [diff] [blame] | 77 | |
| 78 | struct PatternBatch; |
| 79 | |
| 80 | private: |
Chris Dalton | ff92650 | 2017-05-03 14:36:54 -0400 | [diff] [blame] | 81 | using PendingBuffer = GrPendingIOResource<const GrBuffer, kRead_GrIOType>; |
| 82 | |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 83 | GrPrimitiveType fPrimitiveType; |
| 84 | PendingBuffer fIndexBuffer; |
| 85 | PendingBuffer fInstanceBuffer; |
| 86 | PendingBuffer fVertexBuffer; |
| 87 | int fBaseVertex; |
| 88 | GrPrimitiveRestart fPrimitiveRestart; |
Chris Dalton | ff92650 | 2017-05-03 14:36:54 -0400 | [diff] [blame] | 89 | |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 90 | union { |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 91 | struct { // When fIndexBuffer == nullptr and fInstanceBuffer == nullptr. |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 92 | int fVertexCount; |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 93 | } fNonIndexNonInstanceData; |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 94 | |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 95 | struct { // When fIndexBuffer != nullptr and fInstanceBuffer == nullptr. |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 96 | struct { |
| 97 | int fIndexCount; |
| 98 | int fPatternRepeatCount; |
| 99 | } fIndexData; |
| 100 | |
| 101 | union { |
| 102 | struct { // When fPatternRepeatCount == 0. |
| 103 | int fBaseIndex; |
| 104 | uint16_t fMinIndexValue; |
| 105 | uint16_t fMaxIndexValue; |
| 106 | } fNonPatternIndexData; |
| 107 | |
| 108 | struct { // When fPatternRepeatCount != 0. |
| 109 | int fVertexCount; |
| 110 | int fMaxPatternRepetitionsInIndexBuffer; |
| 111 | } fPatternData; |
| 112 | }; |
| 113 | }; |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 114 | |
| 115 | struct { // When fInstanceBuffer != nullptr. |
| 116 | struct { |
| 117 | int fInstanceCount; |
| 118 | int fBaseInstance; |
| 119 | } fInstanceData; |
| 120 | |
| 121 | union { // When fIndexBuffer == nullptr. |
| 122 | struct { |
| 123 | int fVertexCount; |
| 124 | } fInstanceNonIndexData; |
| 125 | |
| 126 | struct { // When fIndexBuffer != nullptr. |
| 127 | int fIndexCount; |
| 128 | } fInstanceIndexData; |
| 129 | }; |
| 130 | }; |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 131 | }; |
Chris Dalton | ff92650 | 2017-05-03 14:36:54 -0400 | [diff] [blame] | 132 | }; |
| 133 | |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 134 | inline void GrMesh::setNonIndexedNonInstanced(int vertexCount) { |
Chris Dalton | bca46e2 | 2017-05-15 11:03:26 -0600 | [diff] [blame] | 135 | fIndexBuffer.reset(nullptr); |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 136 | fInstanceBuffer.reset(nullptr); |
| 137 | fNonIndexNonInstanceData.fVertexCount = vertexCount; |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 138 | fPrimitiveRestart = GrPrimitiveRestart::kNo; |
Chris Dalton | bca46e2 | 2017-05-15 11:03:26 -0600 | [diff] [blame] | 139 | } |
| 140 | |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 141 | inline void GrMesh::setIndexed(const GrBuffer* indexBuffer, int indexCount, int baseIndex, |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 142 | uint16_t minIndexValue, uint16_t maxIndexValue, |
| 143 | GrPrimitiveRestart primitiveRestart) { |
Chris Dalton | bca46e2 | 2017-05-15 11:03:26 -0600 | [diff] [blame] | 144 | SkASSERT(indexBuffer); |
| 145 | SkASSERT(indexCount >= 1); |
| 146 | SkASSERT(baseIndex >= 0); |
Chris Dalton | a88da48 | 2017-06-06 12:25:28 -0600 | [diff] [blame] | 147 | SkASSERT(maxIndexValue >= minIndexValue); |
Chris Dalton | bca46e2 | 2017-05-15 11:03:26 -0600 | [diff] [blame] | 148 | fIndexBuffer.reset(indexBuffer); |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 149 | fInstanceBuffer.reset(nullptr); |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 150 | fIndexData.fIndexCount = indexCount; |
| 151 | fIndexData.fPatternRepeatCount = 0; |
| 152 | fNonPatternIndexData.fBaseIndex = baseIndex; |
| 153 | fNonPatternIndexData.fMinIndexValue = minIndexValue; |
| 154 | fNonPatternIndexData.fMaxIndexValue = maxIndexValue; |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 155 | fPrimitiveRestart = primitiveRestart; |
Chris Dalton | bca46e2 | 2017-05-15 11:03:26 -0600 | [diff] [blame] | 156 | } |
| 157 | |
| 158 | inline void GrMesh::setIndexedPatterned(const GrBuffer* indexBuffer, int indexCount, |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 159 | int vertexCount, int patternRepeatCount, |
Chris Dalton | bca46e2 | 2017-05-15 11:03:26 -0600 | [diff] [blame] | 160 | int maxPatternRepetitionsInIndexBuffer) { |
| 161 | SkASSERT(indexBuffer); |
| 162 | SkASSERT(indexCount >= 1); |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 163 | SkASSERT(vertexCount >= 1); |
Chris Dalton | bca46e2 | 2017-05-15 11:03:26 -0600 | [diff] [blame] | 164 | SkASSERT(patternRepeatCount >= 1); |
| 165 | SkASSERT(maxPatternRepetitionsInIndexBuffer >= 1); |
| 166 | fIndexBuffer.reset(indexBuffer); |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 167 | fInstanceBuffer.reset(nullptr); |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 168 | fIndexData.fIndexCount = indexCount; |
| 169 | fIndexData.fPatternRepeatCount = patternRepeatCount; |
| 170 | fPatternData.fVertexCount = vertexCount; |
| 171 | fPatternData.fMaxPatternRepetitionsInIndexBuffer = maxPatternRepetitionsInIndexBuffer; |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 172 | fPrimitiveRestart = GrPrimitiveRestart::kNo; |
Chris Dalton | bca46e2 | 2017-05-15 11:03:26 -0600 | [diff] [blame] | 173 | } |
| 174 | |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 175 | inline void GrMesh::setInstanced(const GrBuffer* instanceBuffer, int instanceCount, |
| 176 | int baseInstance, int vertexCount) { |
| 177 | SkASSERT(instanceBuffer); |
| 178 | SkASSERT(instanceCount >= 1); |
| 179 | SkASSERT(baseInstance >= 0); |
| 180 | fIndexBuffer.reset(nullptr); |
| 181 | fInstanceBuffer.reset(instanceBuffer); |
| 182 | fInstanceData.fInstanceCount = instanceCount; |
| 183 | fInstanceData.fBaseInstance = baseInstance; |
| 184 | fInstanceNonIndexData.fVertexCount = vertexCount; |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 185 | fPrimitiveRestart = GrPrimitiveRestart::kNo; |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 186 | } |
| 187 | |
| 188 | inline void GrMesh::setIndexedInstanced(const GrBuffer* indexBuffer, int indexCount, |
| 189 | const GrBuffer* instanceBuffer, int instanceCount, |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 190 | int baseInstance, GrPrimitiveRestart primitiveRestart) { |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 191 | SkASSERT(indexBuffer); |
| 192 | SkASSERT(indexCount >= 1); |
| 193 | SkASSERT(instanceBuffer); |
| 194 | SkASSERT(instanceCount >= 1); |
| 195 | SkASSERT(baseInstance >= 0); |
| 196 | fIndexBuffer.reset(indexBuffer); |
| 197 | fInstanceBuffer.reset(instanceBuffer); |
| 198 | fInstanceData.fInstanceCount = instanceCount; |
| 199 | fInstanceData.fBaseInstance = baseInstance; |
| 200 | fInstanceIndexData.fIndexCount = indexCount; |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 201 | fPrimitiveRestart = primitiveRestart; |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 202 | } |
| 203 | |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 204 | inline void GrMesh::setVertexData(const GrBuffer* vertexBuffer, int baseVertex) { |
| 205 | SkASSERT(baseVertex >= 0); |
Chris Dalton | bca46e2 | 2017-05-15 11:03:26 -0600 | [diff] [blame] | 206 | fVertexBuffer.reset(vertexBuffer); |
Chris Dalton | bca46e2 | 2017-05-15 11:03:26 -0600 | [diff] [blame] | 207 | fBaseVertex = baseVertex; |
| 208 | } |
| 209 | |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 210 | inline void GrMesh::sendToGpu(SendToGpuImpl* impl) const { |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 211 | if (this->isInstanced()) { |
| 212 | if (!this->isIndexed()) { |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 213 | impl->sendInstancedMeshToGpu(fPrimitiveType, fVertexBuffer.get(), |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 214 | fInstanceNonIndexData.fVertexCount, fBaseVertex, |
| 215 | fInstanceBuffer.get(), fInstanceData.fInstanceCount, |
| 216 | fInstanceData.fBaseInstance); |
| 217 | } else { |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 218 | impl->sendIndexedInstancedMeshToGpu( |
| 219 | fPrimitiveType, fIndexBuffer.get(), fInstanceIndexData.fIndexCount, 0, |
| 220 | fVertexBuffer.get(), fBaseVertex, fInstanceBuffer.get(), |
| 221 | fInstanceData.fInstanceCount, fInstanceData.fBaseInstance, fPrimitiveRestart); |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 222 | } |
| 223 | return; |
| 224 | } |
| 225 | |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 226 | if (!this->isIndexed()) { |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 227 | SkASSERT(fNonIndexNonInstanceData.fVertexCount > 0); |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 228 | impl->sendMeshToGpu(fPrimitiveType, fVertexBuffer.get(), |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 229 | fNonIndexNonInstanceData.fVertexCount, fBaseVertex); |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 230 | return; |
bsalomon | cb8979d | 2015-05-05 09:51:38 -0700 | [diff] [blame] | 231 | } |
| 232 | |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 233 | if (0 == fIndexData.fPatternRepeatCount) { |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 234 | impl->sendIndexedMeshToGpu(fPrimitiveType, fIndexBuffer.get(), fIndexData.fIndexCount, |
| 235 | fNonPatternIndexData.fBaseIndex, |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 236 | fNonPatternIndexData.fMinIndexValue, |
| 237 | fNonPatternIndexData.fMaxIndexValue, fVertexBuffer.get(), |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 238 | fBaseVertex, fPrimitiveRestart); |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 239 | return; |
bsalomon | cb8979d | 2015-05-05 09:51:38 -0700 | [diff] [blame] | 240 | } |
| 241 | |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 242 | SkASSERT(fIndexData.fPatternRepeatCount > 0); |
| 243 | int baseRepetition = 0; |
| 244 | do { |
| 245 | int repeatCount = SkTMin(fPatternData.fMaxPatternRepetitionsInIndexBuffer, |
| 246 | fIndexData.fPatternRepeatCount - baseRepetition); |
| 247 | // A patterned index buffer must contain indices in the range [0..vertexCount]. |
| 248 | int minIndexValue = 0; |
| 249 | int maxIndexValue = fPatternData.fVertexCount * repeatCount - 1; |
Brian Salomon | 802cb31 | 2018-06-08 18:05:20 -0400 | [diff] [blame] | 250 | SkASSERT(fPrimitiveRestart == GrPrimitiveRestart::kNo); |
| 251 | impl->sendIndexedMeshToGpu( |
| 252 | fPrimitiveType, fIndexBuffer.get(), fIndexData.fIndexCount * repeatCount, 0, |
| 253 | minIndexValue, maxIndexValue, fVertexBuffer.get(), |
| 254 | fBaseVertex + fPatternData.fVertexCount * baseRepetition, GrPrimitiveRestart::kNo); |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 255 | baseRepetition += repeatCount; |
| 256 | } while (baseRepetition < fIndexData.fPatternRepeatCount); |
Chris Dalton | ff92650 | 2017-05-03 14:36:54 -0400 | [diff] [blame] | 257 | } |
| 258 | |
bsalomon | cb8979d | 2015-05-05 09:51:38 -0700 | [diff] [blame] | 259 | #endif |