OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrGpuGL.h" | 8 #include "GrGpuGL.h" |
9 | 9 |
10 #include "GrEffect.h" | 10 #include "GrEffect.h" |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 GrCrash("Unknown geometry src type!"); | 336 GrCrash("Unknown geometry src type!"); |
337 } | 337 } |
338 | 338 |
339 SkASSERT(NULL != ibuf); | 339 SkASSERT(NULL != ibuf); |
340 SkASSERT(!ibuf->isLocked()); | 340 SkASSERT(!ibuf->isLocked()); |
341 *indexOffsetInBytes += ibuf->baseOffset(); | 341 *indexOffsetInBytes += ibuf->baseOffset(); |
342 } | 342 } |
343 GrGLAttribArrayState* attribState = | 343 GrGLAttribArrayState* attribState = |
344 fHWGeometryState.bindArrayAndBuffersToDraw(this, vbuf, ibuf); | 344 fHWGeometryState.bindArrayAndBuffersToDraw(this, vbuf, ibuf); |
345 | 345 |
| 346 uint32_t usedAttribArraysMask = 0; |
346 if (fCurrentProgram->hasVertexShader()) { | 347 if (fCurrentProgram->hasVertexShader()) { |
347 int vertexAttribCount = this->getDrawState().getVertexAttribCount(); | 348 int vertexAttribCount = this->getDrawState().getVertexAttribCount(); |
348 uint32_t usedAttribArraysMask = 0; | |
349 const GrVertexAttrib* vertexAttrib = this->getDrawState().getVertexAttri
bs(); | 349 const GrVertexAttrib* vertexAttrib = this->getDrawState().getVertexAttri
bs(); |
350 | 350 |
351 for (int vertexAttribIndex = 0; vertexAttribIndex < vertexAttribCount; | 351 for (int vertexAttribIndex = 0; vertexAttribIndex < vertexAttribCount; |
352 ++vertexAttribIndex, ++vertexAttrib) { | 352 ++vertexAttribIndex, ++vertexAttrib) { |
353 | 353 |
354 usedAttribArraysMask |= (1 << vertexAttribIndex); | 354 usedAttribArraysMask |= (1 << vertexAttribIndex); |
355 GrVertexAttribType attribType = vertexAttrib->fType; | 355 GrVertexAttribType attribType = vertexAttrib->fType; |
356 attribState->set(this, | 356 attribState->set(this, |
357 vertexAttribIndex, | 357 vertexAttribIndex, |
358 vbuf, | 358 vbuf, |
359 GrGLAttribTypeToLayout(attribType).fCount, | 359 GrGLAttribTypeToLayout(attribType).fCount, |
360 GrGLAttribTypeToLayout(attribType).fType, | 360 GrGLAttribTypeToLayout(attribType).fType, |
361 GrGLAttribTypeToLayout(attribType).fNormalized, | 361 GrGLAttribTypeToLayout(attribType).fNormalized, |
362 stride, | 362 stride, |
363 reinterpret_cast<GrGLvoid*>( | 363 reinterpret_cast<GrGLvoid*>( |
364 vertexOffsetInBytes + vertexAttrib->fOffset)); | 364 vertexOffsetInBytes + vertexAttrib->fOffset)); |
365 } | 365 } |
366 attribState->disableUnusedArrays(this, usedAttribArraysMask); | |
367 } | 366 } |
| 367 attribState->disableUnusedArrays(this, usedAttribArraysMask); |
368 } | 368 } |
OLD | NEW |