aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLVertexArray.h
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2017-05-05 17:19:45 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-05 17:19:57 +0000
commitafc23685e04288557db47e8d08d8fc301773a827 (patch)
tree77ffb621d3ff7ca76478511f8f3cf42f83b8cd5a /src/gpu/gl/GrGLVertexArray.h
parent2fbd016820598ba7b617f0f5788d81ec55ccc15a (diff)
Revert "GL: track enabled vertex arrays as a count rather than a mask"
This reverts commit 288d041c64322fafc77cfaf23907180ebad933a1. Reason for revert: GL errors. Original change's description: > GL: track enabled vertex arrays as a count rather than a mask > > Bug: skia: > Change-Id: I46ba29cb32960a415ee1993a7b957ec49c0c56d3 > Reviewed-on: https://skia-review.googlesource.com/15520 > Commit-Queue: Chris Dalton <csmartdalton@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> > TBR=egdaniel@google.com,bsalomon@google.com,csmartdalton@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I63b0fd3c6f36326a13bf853d13ce8d28869a32cf Reviewed-on: https://skia-review.googlesource.com/15625 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/gl/GrGLVertexArray.h')
-rw-r--r--src/gpu/gl/GrGLVertexArray.h27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/gpu/gl/GrGLVertexArray.h b/src/gpu/gl/GrGLVertexArray.h
index 359df821b4..3551da06a5 100644
--- a/src/gpu/gl/GrGLVertexArray.h
+++ b/src/gpu/gl/GrGLVertexArray.h
@@ -44,19 +44,19 @@ public:
const GrBuffer* vertexBuffer,
GrVertexAttribType type,
GrGLsizei stride,
- size_t offsetInBytes);
+ GrGLvoid* offset);
/**
- * This function enables the first 'enabledCount' vertex arrays and disables the rest.
+ * This function disables vertex attribs not present in the mask. It is assumed that the
+ * GrGLAttribArrayState is tracking the state of the currently bound vertex array object.
*/
- void enableVertexArrays(const GrGLGpu*, int enabledCount);
+ void disableUnusedArrays(const GrGLGpu*, uint64_t usedAttribArrayMask);
void invalidate() {
int count = fAttribArrayStates.count();
for (int i = 0; i < count; ++i) {
fAttribArrayStates[i].invalidate();
}
- fEnabledCountIsValid = false;
}
/**
@@ -69,17 +69,20 @@ private:
* Tracks the state of glVertexAttribArray for an attribute index.
*/
struct AttribArrayState {
- void invalidate() { fVertexBufferUniqueID.makeInvalid(); }
+ void invalidate() {
+ fEnableIsValid = false;
+ fVertexBufferUniqueID.makeInvalid();
+ }
- GrGpuResource::UniqueID fVertexBufferUniqueID;
- GrVertexAttribType fType;
- GrGLsizei fStride;
- size_t fOffset;
+ bool fEnableIsValid;
+ bool fEnabled;
+ GrGpuResource::UniqueID fVertexBufferUniqueID;
+ GrVertexAttribType fType;
+ GrGLsizei fStride;
+ GrGLvoid* fOffset;
};
- SkSTArray<16, AttribArrayState, true> fAttribArrayStates;
- int fNumEnabledArrays;
- bool fEnabledCountIsValid;
+ SkSTArray<16, AttribArrayState, true> fAttribArrayStates;
};
/**