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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 *indexOffsetInBytes += ibuf->baseOffset(); | 346 *indexOffsetInBytes += ibuf->baseOffset(); |
347 } | 347 } |
348 GrGLAttribArrayState* attribState = | 348 GrGLAttribArrayState* attribState = |
349 fHWGeometryState.bindArrayAndBuffersToDraw(this, vbuf, ibuf); | 349 fHWGeometryState.bindArrayAndBuffersToDraw(this, vbuf, ibuf); |
350 | 350 |
351 if (fCurrentProgram->hasVertexShader()) { | 351 if (fCurrentProgram->hasVertexShader()) { |
352 int vertexAttribCount = this->getDrawState().getVertexAttribCount(); | 352 int vertexAttribCount = this->getDrawState().getVertexAttribCount(); |
353 uint32_t usedAttribArraysMask = 0; | 353 uint32_t usedAttribArraysMask = 0; |
354 const GrVertexAttrib* vertexAttrib = this->getDrawState().getVertexAttri
bs(); | 354 const GrVertexAttrib* vertexAttrib = this->getDrawState().getVertexAttri
bs(); |
355 | 355 |
| 356 bool canIgnoreColorAttrib = this->getDrawState().canIgnoreColorAttribute
(); |
| 357 |
356 for (int vertexAttribIndex = 0; vertexAttribIndex < vertexAttribCount; | 358 for (int vertexAttribIndex = 0; vertexAttribIndex < vertexAttribCount; |
357 ++vertexAttribIndex, ++vertexAttrib) { | 359 ++vertexAttribIndex, ++vertexAttrib) { |
358 | 360 |
| 361 if (kColor_GrVertexAttribBinding != vertexAttrib->fBinding || !canIg
noreColorAttrib) { |
359 usedAttribArraysMask |= (1 << vertexAttribIndex); | 362 usedAttribArraysMask |= (1 << vertexAttribIndex); |
360 GrVertexAttribType attribType = vertexAttrib->fType; | 363 GrVertexAttribType attribType = vertexAttrib->fType; |
361 attribState->set(this, | 364 attribState->set(this, |
362 vertexAttribIndex, | 365 vertexAttribIndex, |
363 vbuf, | 366 vbuf, |
364 GrGLAttribTypeToLayout(attribType).fCount, | 367 GrGLAttribTypeToLayout(attribType).fCount, |
365 GrGLAttribTypeToLayout(attribType).fType, | 368 GrGLAttribTypeToLayout(attribType).fType, |
366 GrGLAttribTypeToLayout(attribType).fNormalized, | 369 GrGLAttribTypeToLayout(attribType).fNormalized, |
367 stride, | 370 stride, |
368 reinterpret_cast<GrGLvoid*>( | 371 reinterpret_cast<GrGLvoid*>( |
369 vertexOffsetInBytes + vertexAttrib->fOffset)); | 372 vertexOffsetInBytes + vertexAttrib->fOffset)); |
| 373 } |
370 } | 374 } |
371 attribState->disableUnusedArrays(this, usedAttribArraysMask); | 375 attribState->disableUnusedArrays(this, usedAttribArraysMask); |
372 } | 376 } |
373 } | 377 } |
OLD | NEW |