Make sure attribute indexes are correct after restoring vertex attributes
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 16 Oct 2013 14:43:12 +0000 (14:43 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 16 Oct 2013 14:43:12 +0000 (14:43 +0000)
Fix an assert due to
GrDrawState::CommonState::fFixedFunctionVertexAttribIndices getting
out of sync.  The assertion in GrDrawState::CommonState::operator==
would fire after using AutoVertexAttribRestore.
AutoVertexAttribRestore would change GrDrawState::fCommon.fVAPtr and
fVACount without updating
GrDrawState::fCommon.fFixedFunctionVertexAttribIndices.

R=jvanverth@google.com, bsalomon@google.com, robertphillips@google.com

Author: kkinnunen@nvidia.com

Review URL: https://codereview.chromium.org/26922004

git-svn-id: http://skia.googlecode.com/svn/trunk@11807 2bbb7eff-a529-9590-31e7-b0007b416f81

src/gpu/GrDrawState.h

index 6440790..889dec9 100644 (file)
@@ -160,8 +160,7 @@ public:
          }
 
          ~AutoVertexAttribRestore(){
-             fDrawState->fCommon.fVAPtr = fVAPtr;
-             fDrawState->fCommon.fVACount = fVACount;
+             fDrawState->setVertexAttribs(fVAPtr, fVACount);
          }
 
      private: