Jamie Madill | 57a8972 | 2013-07-02 11:57:03 -0400 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2013 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | // Implementation of the state class for mananging GLES 3 Vertex Array Objects. |
| 7 | // |
| 8 | |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 9 | #include "libANGLE/VertexArray.h" |
| 10 | #include "libANGLE/Buffer.h" |
Jamie Madill | dd43e6c | 2017-03-24 14:18:49 -0400 | [diff] [blame] | 11 | #include "libANGLE/Context.h" |
Jamie Madill | 0946393 | 2018-04-04 05:26:59 -0400 | [diff] [blame] | 12 | #include "libANGLE/renderer/BufferImpl.h" |
Jamie Madill | 7aea7e0 | 2016-05-10 10:39:45 -0400 | [diff] [blame] | 13 | #include "libANGLE/renderer/GLImplFactory.h" |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 14 | #include "libANGLE/renderer/VertexArrayImpl.h" |
Jamie Madill | 57a8972 | 2013-07-02 11:57:03 -0400 | [diff] [blame] | 15 | |
| 16 | namespace gl |
| 17 | { |
Jamie Madill | d69a5f1 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 18 | namespace |
| 19 | { |
| 20 | bool IsElementArrayBufferSubjectIndex(angle::SubjectIndex subjectIndex) |
| 21 | { |
| 22 | return (subjectIndex == MAX_VERTEX_ATTRIBS); |
| 23 | } |
| 24 | } // anonymous namespce |
| 25 | |
Jamie Madill | bcef322 | 2018-04-13 15:19:11 -0400 | [diff] [blame] | 26 | // VertexArrayState implementation. |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 27 | VertexArrayState::VertexArrayState(size_t maxAttribs, size_t maxAttribBindings) |
Jamie Madill | ad63728 | 2018-07-31 11:22:14 -0400 | [diff] [blame] | 28 | : mLabel(), mVertexBindings() |
Jamie Madill | 57a8972 | 2013-07-02 11:57:03 -0400 | [diff] [blame] | 29 | { |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 30 | ASSERT(maxAttribs <= maxAttribBindings); |
| 31 | |
| 32 | for (size_t i = 0; i < maxAttribs; i++) |
| 33 | { |
| 34 | mVertexAttributes.emplace_back(static_cast<GLuint>(i)); |
Jamie Madill | ad63728 | 2018-07-31 11:22:14 -0400 | [diff] [blame] | 35 | mVertexBindings.emplace_back(static_cast<GLuint>(i)); |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 36 | } |
Jamie Madill | dc358af | 2018-07-31 11:22:13 -0400 | [diff] [blame] | 37 | |
| 38 | // Initially all attributes start as "client" with no buffer bound. |
| 39 | mClientMemoryAttribsMask.set(); |
Jamie Madill | 8e34494 | 2015-07-09 14:22:07 -0400 | [diff] [blame] | 40 | } |
| 41 | |
Jamie Madill | 3f57268 | 2016-04-26 13:41:36 -0400 | [diff] [blame] | 42 | VertexArrayState::~VertexArrayState() |
Jamie Madill | 8e34494 | 2015-07-09 14:22:07 -0400 | [diff] [blame] | 43 | { |
Jamie Madill | 8e34494 | 2015-07-09 14:22:07 -0400 | [diff] [blame] | 44 | } |
| 45 | |
Jamie Madill | 51af38b | 2018-04-15 08:50:56 -0400 | [diff] [blame] | 46 | bool VertexArrayState::hasEnabledNullPointerClientArray() const |
| 47 | { |
| 48 | return (mNullPointerClientMemoryAttribsMask & mEnabledAttributesMask).any(); |
| 49 | } |
| 50 | |
Jamie Madill | ad63728 | 2018-07-31 11:22:14 -0400 | [diff] [blame] | 51 | AttributesMask VertexArrayState::getBindingToAttributesMask(GLuint bindingIndex) const |
Jiawei Shao | 6a5d98c | 2018-05-04 15:42:20 +0800 | [diff] [blame] | 52 | { |
| 53 | ASSERT(bindingIndex < MAX_VERTEX_ATTRIB_BINDINGS); |
Jamie Madill | ad63728 | 2018-07-31 11:22:14 -0400 | [diff] [blame] | 54 | return mVertexBindings[bindingIndex].getBoundAttributesMask(); |
Jiawei Shao | 6a5d98c | 2018-05-04 15:42:20 +0800 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | // Set an attribute using a new binding. |
| 58 | void VertexArrayState::setAttribBinding(size_t attribIndex, GLuint newBindingIndex) |
| 59 | { |
| 60 | ASSERT(attribIndex < MAX_VERTEX_ATTRIBS && newBindingIndex < MAX_VERTEX_ATTRIB_BINDINGS); |
| 61 | |
Jamie Madill | bdc610a | 2018-07-30 10:26:00 -0400 | [diff] [blame] | 62 | VertexAttribute &attrib = mVertexAttributes[attribIndex]; |
| 63 | |
Jiawei Shao | 6a5d98c | 2018-05-04 15:42:20 +0800 | [diff] [blame] | 64 | // Update the binding-attribute map. |
Jamie Madill | bdc610a | 2018-07-30 10:26:00 -0400 | [diff] [blame] | 65 | const GLuint oldBindingIndex = attrib.bindingIndex; |
Jiawei Shao | 6a5d98c | 2018-05-04 15:42:20 +0800 | [diff] [blame] | 66 | ASSERT(oldBindingIndex != newBindingIndex); |
| 67 | |
Jamie Madill | d69a5f1 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 68 | VertexBinding &oldBinding = mVertexBindings[oldBindingIndex]; |
| 69 | VertexBinding &newBinding = mVertexBindings[newBindingIndex]; |
Jiawei Shao | 6a5d98c | 2018-05-04 15:42:20 +0800 | [diff] [blame] | 70 | |
Jamie Madill | d69a5f1 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 71 | ASSERT(oldBinding.getBoundAttributesMask().test(attribIndex) && |
| 72 | !newBinding.getBoundAttributesMask().test(attribIndex)); |
| 73 | |
| 74 | oldBinding.resetBoundAttribute(attribIndex); |
| 75 | newBinding.setBoundAttribute(attribIndex); |
Jiawei Shao | 6a5d98c | 2018-05-04 15:42:20 +0800 | [diff] [blame] | 76 | |
| 77 | // Set the attribute using the new binding. |
Jamie Madill | bdc610a | 2018-07-30 10:26:00 -0400 | [diff] [blame] | 78 | attrib.bindingIndex = newBindingIndex; |
Jamie Madill | d69a5f1 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 79 | attrib.updateCachedElementLimit(newBinding); |
| 80 | |
| 81 | bool isMapped = newBinding.getBuffer().get() && newBinding.getBuffer()->isMapped(); |
| 82 | mCachedMappedArrayBuffers.set(attribIndex, isMapped); |
| 83 | mCachedEnabledMappedArrayBuffers.set(attribIndex, isMapped && attrib.enabled); |
Jiawei Shao | 6a5d98c | 2018-05-04 15:42:20 +0800 | [diff] [blame] | 84 | } |
| 85 | |
Jamie Madill | bcef322 | 2018-04-13 15:19:11 -0400 | [diff] [blame] | 86 | // VertexArray implementation. |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 87 | VertexArray::VertexArray(rx::GLImplFactory *factory, |
| 88 | GLuint id, |
| 89 | size_t maxAttribs, |
| 90 | size_t maxAttribBindings) |
| 91 | : mId(id), |
| 92 | mState(maxAttribs, maxAttribBindings), |
Jamie Madill | 0946393 | 2018-04-04 05:26:59 -0400 | [diff] [blame] | 93 | mVertexArray(factory->createVertexArray(mState)), |
Jamie Madill | d69a5f1 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 94 | mElementArrayBufferObserverBinding(this, MAX_VERTEX_ATTRIBS) |
Jamie Madill | 8e34494 | 2015-07-09 14:22:07 -0400 | [diff] [blame] | 95 | { |
Jamie Madill | 0946393 | 2018-04-04 05:26:59 -0400 | [diff] [blame] | 96 | for (size_t attribIndex = 0; attribIndex < maxAttribBindings; ++attribIndex) |
| 97 | { |
| 98 | mArrayBufferObserverBindings.emplace_back(this, attribIndex); |
| 99 | } |
Jamie Madill | 004a6f9 | 2013-07-10 15:13:38 -0400 | [diff] [blame] | 100 | } |
| 101 | |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 102 | void VertexArray::onDestroy(const Context *context) |
| 103 | { |
James Darpinian | e8a93c6 | 2018-01-04 18:02:24 -0800 | [diff] [blame] | 104 | bool isBound = context->isCurrentVertexArray(this); |
Jamie Madill | bcef322 | 2018-04-13 15:19:11 -0400 | [diff] [blame] | 105 | for (VertexBinding &binding : mState.mVertexBindings) |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 106 | { |
James Darpinian | e8a93c6 | 2018-01-04 18:02:24 -0800 | [diff] [blame] | 107 | binding.setBuffer(context, nullptr, isBound); |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 108 | } |
James Darpinian | e8a93c6 | 2018-01-04 18:02:24 -0800 | [diff] [blame] | 109 | if (isBound && mState.mElementArrayBuffer.get()) |
Jamie Madill | bf5177d | 2018-08-21 12:58:20 -0400 | [diff] [blame] | 110 | mState.mElementArrayBuffer->onNonTFBindingChanged(context, -1); |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 111 | mState.mElementArrayBuffer.set(context, nullptr); |
| 112 | mVertexArray->destroy(context); |
| 113 | SafeDelete(mVertexArray); |
| 114 | delete this; |
| 115 | } |
| 116 | |
Jamie Madill | 004a6f9 | 2013-07-10 15:13:38 -0400 | [diff] [blame] | 117 | VertexArray::~VertexArray() |
| 118 | { |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 119 | ASSERT(!mVertexArray); |
Jamie Madill | 57a8972 | 2013-07-02 11:57:03 -0400 | [diff] [blame] | 120 | } |
| 121 | |
Shannon Woods | aa2ab7d | 2014-06-24 17:51:51 -0400 | [diff] [blame] | 122 | GLuint VertexArray::id() const |
| 123 | { |
| 124 | return mId; |
| 125 | } |
| 126 | |
Geoff Lang | 70d0f49 | 2015-12-10 17:45:46 -0500 | [diff] [blame] | 127 | void VertexArray::setLabel(const std::string &label) |
| 128 | { |
Jamie Madill | 3f57268 | 2016-04-26 13:41:36 -0400 | [diff] [blame] | 129 | mState.mLabel = label; |
Geoff Lang | 70d0f49 | 2015-12-10 17:45:46 -0500 | [diff] [blame] | 130 | } |
| 131 | |
| 132 | const std::string &VertexArray::getLabel() const |
| 133 | { |
Jamie Madill | 3f57268 | 2016-04-26 13:41:36 -0400 | [diff] [blame] | 134 | return mState.mLabel; |
Geoff Lang | 70d0f49 | 2015-12-10 17:45:46 -0500 | [diff] [blame] | 135 | } |
| 136 | |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 137 | void VertexArray::detachBuffer(const Context *context, GLuint bufferName) |
Jamie Madill | 57a8972 | 2013-07-02 11:57:03 -0400 | [diff] [blame] | 138 | { |
James Darpinian | e8a93c6 | 2018-01-04 18:02:24 -0800 | [diff] [blame] | 139 | bool isBound = context->isCurrentVertexArray(this); |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 140 | for (auto &binding : mState.mVertexBindings) |
Jamie Madill | 57a8972 | 2013-07-02 11:57:03 -0400 | [diff] [blame] | 141 | { |
Martin Radev | dd5f27e | 2017-06-07 10:17:09 +0300 | [diff] [blame] | 142 | if (binding.getBuffer().id() == bufferName) |
Jamie Madill | 57a8972 | 2013-07-02 11:57:03 -0400 | [diff] [blame] | 143 | { |
James Darpinian | e8a93c6 | 2018-01-04 18:02:24 -0800 | [diff] [blame] | 144 | binding.setBuffer(context, nullptr, isBound); |
Jamie Madill | 57a8972 | 2013-07-02 11:57:03 -0400 | [diff] [blame] | 145 | } |
| 146 | } |
| 147 | |
Jamie Madill | 3f57268 | 2016-04-26 13:41:36 -0400 | [diff] [blame] | 148 | if (mState.mElementArrayBuffer.id() == bufferName) |
Jamie Madill | 57a8972 | 2013-07-02 11:57:03 -0400 | [diff] [blame] | 149 | { |
James Darpinian | e8a93c6 | 2018-01-04 18:02:24 -0800 | [diff] [blame] | 150 | if (isBound && mState.mElementArrayBuffer.get()) |
Jamie Madill | bf5177d | 2018-08-21 12:58:20 -0400 | [diff] [blame] | 151 | mState.mElementArrayBuffer->onNonTFBindingChanged(context, -1); |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 152 | mState.mElementArrayBuffer.set(context, nullptr); |
Jamie Madill | 57a8972 | 2013-07-02 11:57:03 -0400 | [diff] [blame] | 153 | } |
| 154 | } |
| 155 | |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 156 | const VertexAttribute &VertexArray::getVertexAttribute(size_t attribIndex) const |
Jamie Madill | 57a8972 | 2013-07-02 11:57:03 -0400 | [diff] [blame] | 157 | { |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 158 | ASSERT(attribIndex < getMaxAttribs()); |
| 159 | return mState.mVertexAttributes[attribIndex]; |
| 160 | } |
| 161 | |
| 162 | const VertexBinding &VertexArray::getVertexBinding(size_t bindingIndex) const |
| 163 | { |
| 164 | ASSERT(bindingIndex < getMaxBindings()); |
| 165 | return mState.mVertexBindings[bindingIndex]; |
| 166 | } |
| 167 | |
Shao | dde78e8 | 2017-05-22 14:13:27 +0800 | [diff] [blame] | 168 | size_t VertexArray::GetVertexIndexFromDirtyBit(size_t dirtyBit) |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 169 | { |
| 170 | static_assert(gl::MAX_VERTEX_ATTRIBS == gl::MAX_VERTEX_ATTRIB_BINDINGS, |
| 171 | "The stride of vertex attributes should equal to that of vertex bindings."); |
Shao | 80957d9 | 2017-02-20 21:25:59 +0800 | [diff] [blame] | 172 | ASSERT(dirtyBit > DIRTY_BIT_ELEMENT_ARRAY_BUFFER); |
Jamie Madill | e858cb1 | 2018-03-27 09:44:32 -0400 | [diff] [blame] | 173 | return (dirtyBit - DIRTY_BIT_ATTRIB_0) % gl::MAX_VERTEX_ATTRIBS; |
| 174 | } |
| 175 | |
| 176 | void VertexArray::setDirtyAttribBit(size_t attribIndex, DirtyAttribBitType dirtyAttribBit) |
| 177 | { |
| 178 | mDirtyBits.set(DIRTY_BIT_ATTRIB_0 + attribIndex); |
| 179 | mDirtyAttribBits[attribIndex].set(dirtyAttribBit); |
| 180 | } |
| 181 | |
| 182 | void VertexArray::setDirtyBindingBit(size_t bindingIndex, DirtyBindingBitType dirtyBindingBit) |
| 183 | { |
| 184 | mDirtyBits.set(DIRTY_BIT_BINDING_0 + bindingIndex); |
| 185 | mDirtyBindingBits[bindingIndex].set(dirtyBindingBit); |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 186 | } |
| 187 | |
Shao | dde78e8 | 2017-05-22 14:13:27 +0800 | [diff] [blame] | 188 | void VertexArray::bindVertexBufferImpl(const Context *context, |
| 189 | size_t bindingIndex, |
| 190 | Buffer *boundBuffer, |
| 191 | GLintptr offset, |
| 192 | GLsizei stride) |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 193 | { |
| 194 | ASSERT(bindingIndex < getMaxBindings()); |
James Darpinian | e8a93c6 | 2018-01-04 18:02:24 -0800 | [diff] [blame] | 195 | bool isBound = context->isCurrentVertexArray(this); |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 196 | |
| 197 | VertexBinding *binding = &mState.mVertexBindings[bindingIndex]; |
| 198 | |
James Darpinian | e8a93c6 | 2018-01-04 18:02:24 -0800 | [diff] [blame] | 199 | binding->setBuffer(context, boundBuffer, isBound); |
Martin Radev | dd5f27e | 2017-06-07 10:17:09 +0300 | [diff] [blame] | 200 | binding->setOffset(offset); |
| 201 | binding->setStride(stride); |
Jamie Madill | 0946393 | 2018-04-04 05:26:59 -0400 | [diff] [blame] | 202 | |
| 203 | updateObserverBinding(bindingIndex); |
Jamie Madill | bdc610a | 2018-07-30 10:26:00 -0400 | [diff] [blame] | 204 | updateCachedBufferBindingSize(binding); |
Jamie Madill | 7267aa6 | 2018-04-17 15:28:21 -0400 | [diff] [blame] | 205 | updateCachedTransformFeedbackBindingValidation(bindingIndex, boundBuffer); |
Jamie Madill | d69a5f1 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 206 | updateCachedMappedArrayBuffers(binding); |
Jamie Madill | dc358af | 2018-07-31 11:22:13 -0400 | [diff] [blame] | 207 | |
| 208 | // Update client memory attribute pointers. Affects all bound attributes. |
| 209 | if (boundBuffer) |
| 210 | { |
Jamie Madill | ad63728 | 2018-07-31 11:22:14 -0400 | [diff] [blame] | 211 | mState.mClientMemoryAttribsMask &= ~binding->getBoundAttributesMask(); |
Jamie Madill | dc358af | 2018-07-31 11:22:13 -0400 | [diff] [blame] | 212 | } |
| 213 | else |
| 214 | { |
Jamie Madill | ad63728 | 2018-07-31 11:22:14 -0400 | [diff] [blame] | 215 | mState.mClientMemoryAttribsMask |= binding->getBoundAttributesMask(); |
Jamie Madill | dc358af | 2018-07-31 11:22:13 -0400 | [diff] [blame] | 216 | } |
Shao | dde78e8 | 2017-05-22 14:13:27 +0800 | [diff] [blame] | 217 | } |
| 218 | |
| 219 | void VertexArray::bindVertexBuffer(const Context *context, |
| 220 | size_t bindingIndex, |
| 221 | Buffer *boundBuffer, |
| 222 | GLintptr offset, |
| 223 | GLsizei stride) |
| 224 | { |
| 225 | bindVertexBufferImpl(context, bindingIndex, boundBuffer, offset, stride); |
Jamie Madill | e858cb1 | 2018-03-27 09:44:32 -0400 | [diff] [blame] | 226 | setDirtyBindingBit(bindingIndex, DIRTY_BINDING_BUFFER); |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 227 | } |
| 228 | |
Shao | dde78e8 | 2017-05-22 14:13:27 +0800 | [diff] [blame] | 229 | void VertexArray::setVertexAttribBinding(const Context *context, |
| 230 | size_t attribIndex, |
| 231 | GLuint bindingIndex) |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 232 | { |
| 233 | ASSERT(attribIndex < getMaxAttribs() && bindingIndex < getMaxBindings()); |
| 234 | |
Shao | dde78e8 | 2017-05-22 14:13:27 +0800 | [diff] [blame] | 235 | if (mState.mVertexAttributes[attribIndex].bindingIndex != bindingIndex) |
| 236 | { |
| 237 | // In ES 3.0 contexts, the binding cannot change, hence the code below is unreachable. |
| 238 | ASSERT(context->getClientVersion() >= ES_3_1); |
Jiawei Shao | 6a5d98c | 2018-05-04 15:42:20 +0800 | [diff] [blame] | 239 | |
| 240 | mState.setAttribBinding(attribIndex, bindingIndex); |
Shao | dde78e8 | 2017-05-22 14:13:27 +0800 | [diff] [blame] | 241 | |
Jamie Madill | e858cb1 | 2018-03-27 09:44:32 -0400 | [diff] [blame] | 242 | setDirtyAttribBit(attribIndex, DIRTY_ATTRIB_BINDING); |
Jamie Madill | dc358af | 2018-07-31 11:22:13 -0400 | [diff] [blame] | 243 | |
| 244 | // Update client attribs mask. |
| 245 | bool hasBuffer = mState.mVertexBindings[bindingIndex].getBuffer().get() != nullptr; |
| 246 | mState.mClientMemoryAttribsMask.set(attribIndex, !hasBuffer); |
Shao | dde78e8 | 2017-05-22 14:13:27 +0800 | [diff] [blame] | 247 | } |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 248 | } |
| 249 | |
| 250 | void VertexArray::setVertexBindingDivisor(size_t bindingIndex, GLuint divisor) |
| 251 | { |
| 252 | ASSERT(bindingIndex < getMaxBindings()); |
| 253 | |
Jamie Madill | bdc610a | 2018-07-30 10:26:00 -0400 | [diff] [blame] | 254 | VertexBinding &binding = mState.mVertexBindings[bindingIndex]; |
| 255 | |
| 256 | binding.setDivisor(divisor); |
Jamie Madill | e858cb1 | 2018-03-27 09:44:32 -0400 | [diff] [blame] | 257 | setDirtyBindingBit(bindingIndex, DIRTY_BINDING_DIVISOR); |
Jamie Madill | bdc610a | 2018-07-30 10:26:00 -0400 | [diff] [blame] | 258 | |
| 259 | // Trigger updates in all bound attributes. |
| 260 | for (size_t attribIndex : binding.getBoundAttributesMask()) |
| 261 | { |
| 262 | mState.mVertexAttributes[attribIndex].updateCachedElementLimit(binding); |
| 263 | } |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 264 | } |
| 265 | |
Shao | dde78e8 | 2017-05-22 14:13:27 +0800 | [diff] [blame] | 266 | void VertexArray::setVertexAttribFormatImpl(size_t attribIndex, |
| 267 | GLint size, |
| 268 | GLenum type, |
| 269 | bool normalized, |
| 270 | bool pureInteger, |
| 271 | GLuint relativeOffset) |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 272 | { |
| 273 | ASSERT(attribIndex < getMaxAttribs()); |
| 274 | |
| 275 | VertexAttribute *attrib = &mState.mVertexAttributes[attribIndex]; |
| 276 | |
| 277 | attrib->size = size; |
| 278 | attrib->type = type; |
| 279 | attrib->normalized = normalized; |
| 280 | attrib->pureInteger = pureInteger; |
| 281 | attrib->relativeOffset = relativeOffset; |
Brandon Jones | c405ae7 | 2017-12-06 14:15:03 -0800 | [diff] [blame] | 282 | mState.mVertexAttributesTypeMask.setIndex(GetVertexAttributeBaseType(*attrib), attribIndex); |
Shao | dde78e8 | 2017-05-22 14:13:27 +0800 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | void VertexArray::setVertexAttribFormat(size_t attribIndex, |
| 286 | GLint size, |
| 287 | GLenum type, |
| 288 | bool normalized, |
| 289 | bool pureInteger, |
| 290 | GLuint relativeOffset) |
| 291 | { |
| 292 | setVertexAttribFormatImpl(attribIndex, size, type, normalized, pureInteger, relativeOffset); |
Jamie Madill | e858cb1 | 2018-03-27 09:44:32 -0400 | [diff] [blame] | 293 | setDirtyAttribBit(attribIndex, DIRTY_ATTRIB_FORMAT); |
Jamie Madill | bdc610a | 2018-07-30 10:26:00 -0400 | [diff] [blame] | 294 | |
| 295 | VertexAttribute &attrib = mState.mVertexAttributes[attribIndex]; |
| 296 | attrib.updateCachedElementLimit(mState.mVertexBindings[attrib.bindingIndex]); |
Jamie Madill | 57a8972 | 2013-07-02 11:57:03 -0400 | [diff] [blame] | 297 | } |
| 298 | |
Shao | dde78e8 | 2017-05-22 14:13:27 +0800 | [diff] [blame] | 299 | void VertexArray::setVertexAttribDivisor(const Context *context, size_t attribIndex, GLuint divisor) |
Jamie Madill | 57a8972 | 2013-07-02 11:57:03 -0400 | [diff] [blame] | 300 | { |
Shao | dde78e8 | 2017-05-22 14:13:27 +0800 | [diff] [blame] | 301 | ASSERT(attribIndex < getMaxAttribs()); |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 302 | |
Shao | dde78e8 | 2017-05-22 14:13:27 +0800 | [diff] [blame] | 303 | setVertexAttribBinding(context, attribIndex, static_cast<GLuint>(attribIndex)); |
| 304 | setVertexBindingDivisor(attribIndex, divisor); |
Jamie Madill | 57a8972 | 2013-07-02 11:57:03 -0400 | [diff] [blame] | 305 | } |
| 306 | |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 307 | void VertexArray::enableAttribute(size_t attribIndex, bool enabledState) |
Jamie Madill | 57a8972 | 2013-07-02 11:57:03 -0400 | [diff] [blame] | 308 | { |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 309 | ASSERT(attribIndex < getMaxAttribs()); |
Shao | 80957d9 | 2017-02-20 21:25:59 +0800 | [diff] [blame] | 310 | |
Jamie Madill | bdc610a | 2018-07-30 10:26:00 -0400 | [diff] [blame] | 311 | VertexAttribute &attrib = mState.mVertexAttributes[attribIndex]; |
| 312 | |
Shahbaz Youssefi | 337bd69 | 2018-08-22 16:16:38 -0400 | [diff] [blame] | 313 | if (mState.mEnabledAttributesMask.test(attribIndex) == enabledState) |
| 314 | { |
| 315 | return; |
| 316 | } |
| 317 | |
Jamie Madill | bdc610a | 2018-07-30 10:26:00 -0400 | [diff] [blame] | 318 | attrib.enabled = enabledState; |
Shao | dde78e8 | 2017-05-22 14:13:27 +0800 | [diff] [blame] | 319 | |
Jamie Madill | e858cb1 | 2018-03-27 09:44:32 -0400 | [diff] [blame] | 320 | setDirtyAttribBit(attribIndex, DIRTY_ATTRIB_ENABLED); |
Jamie Madill | aebf9dd | 2015-04-28 12:39:07 -0400 | [diff] [blame] | 321 | |
| 322 | // Update state cache |
Jamie Madill | d078c68 | 2018-01-02 11:50:24 -0500 | [diff] [blame] | 323 | mState.mEnabledAttributesMask.set(attribIndex, enabledState); |
Jamie Madill | d69a5f1 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 324 | mState.mCachedEnabledMappedArrayBuffers = |
| 325 | mState.mCachedMappedArrayBuffers & mState.mEnabledAttributesMask; |
Jamie Madill | 57a8972 | 2013-07-02 11:57:03 -0400 | [diff] [blame] | 326 | } |
| 327 | |
Shao | dde78e8 | 2017-05-22 14:13:27 +0800 | [diff] [blame] | 328 | void VertexArray::setVertexAttribPointer(const Context *context, |
| 329 | size_t attribIndex, |
| 330 | gl::Buffer *boundBuffer, |
| 331 | GLint size, |
| 332 | GLenum type, |
| 333 | bool normalized, |
| 334 | bool pureInteger, |
| 335 | GLsizei stride, |
| 336 | const void *pointer) |
Jamie Madill | 57a8972 | 2013-07-02 11:57:03 -0400 | [diff] [blame] | 337 | { |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 338 | ASSERT(attribIndex < getMaxAttribs()); |
Jamie Madill | 8e34494 | 2015-07-09 14:22:07 -0400 | [diff] [blame] | 339 | |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 340 | GLintptr offset = boundBuffer ? reinterpret_cast<GLintptr>(pointer) : 0; |
Jamie Madill | 8e34494 | 2015-07-09 14:22:07 -0400 | [diff] [blame] | 341 | |
Shao | dde78e8 | 2017-05-22 14:13:27 +0800 | [diff] [blame] | 342 | setVertexAttribFormatImpl(attribIndex, size, type, normalized, pureInteger, 0); |
| 343 | setVertexAttribBinding(context, attribIndex, static_cast<GLuint>(attribIndex)); |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 344 | |
| 345 | VertexAttribute &attrib = mState.mVertexAttributes[attribIndex]; |
Shao | dde78e8 | 2017-05-22 14:13:27 +0800 | [diff] [blame] | 346 | |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 347 | GLsizei effectiveStride = |
| 348 | stride != 0 ? stride : static_cast<GLsizei>(ComputeVertexAttributeTypeSize(attrib)); |
| 349 | attrib.pointer = pointer; |
| 350 | attrib.vertexAttribArrayStride = stride; |
| 351 | |
Shao | dde78e8 | 2017-05-22 14:13:27 +0800 | [diff] [blame] | 352 | bindVertexBufferImpl(context, attribIndex, boundBuffer, offset, effectiveStride); |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 353 | |
Jamie Madill | e858cb1 | 2018-03-27 09:44:32 -0400 | [diff] [blame] | 354 | setDirtyAttribBit(attribIndex, DIRTY_ATTRIB_POINTER); |
Jamie Madill | bcef322 | 2018-04-13 15:19:11 -0400 | [diff] [blame] | 355 | |
Jamie Madill | 51af38b | 2018-04-15 08:50:56 -0400 | [diff] [blame] | 356 | mState.mNullPointerClientMemoryAttribsMask.set(attribIndex, |
| 357 | boundBuffer == nullptr && pointer == nullptr); |
Brandon Jones | 5bf9829 | 2014-06-06 17:19:38 -0700 | [diff] [blame] | 358 | } |
| 359 | |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 360 | void VertexArray::setElementArrayBuffer(const Context *context, Buffer *buffer) |
Brandon Jones | 5bf9829 | 2014-06-06 17:19:38 -0700 | [diff] [blame] | 361 | { |
Jamie Madill | 7b2f027 | 2018-08-27 10:16:08 -0400 | [diff] [blame] | 362 | ASSERT(context->isCurrentVertexArray(this)); |
| 363 | if (mState.mElementArrayBuffer.get()) |
Jamie Madill | bf5177d | 2018-08-21 12:58:20 -0400 | [diff] [blame] | 364 | { |
Jamie Madill | 7b2f027 | 2018-08-27 10:16:08 -0400 | [diff] [blame] | 365 | mState.mElementArrayBuffer->onNonTFBindingChanged(context, -1); |
| 366 | } |
Jamie Madill | d84b673 | 2018-09-06 15:54:35 -0400 | [diff] [blame] | 367 | mState.mElementArrayBuffer.set(context, buffer); |
Jamie Madill | 7b2f027 | 2018-08-27 10:16:08 -0400 | [diff] [blame] | 368 | if (buffer) |
| 369 | { |
Jamie Madill | 7b2f027 | 2018-08-27 10:16:08 -0400 | [diff] [blame] | 370 | mElementArrayBufferObserverBinding.bind(buffer->getImplementation()); |
Jamie Madill | d84b673 | 2018-09-06 15:54:35 -0400 | [diff] [blame] | 371 | buffer->onNonTFBindingChanged(context, 1); |
Jamie Madill | 7b2f027 | 2018-08-27 10:16:08 -0400 | [diff] [blame] | 372 | } |
| 373 | else |
| 374 | { |
| 375 | mElementArrayBufferObserverBinding.bind(nullptr); |
Jamie Madill | bf5177d | 2018-08-21 12:58:20 -0400 | [diff] [blame] | 376 | } |
Jamie Madill | 0b9e903 | 2015-08-17 11:51:52 +0000 | [diff] [blame] | 377 | mDirtyBits.set(DIRTY_BIT_ELEMENT_ARRAY_BUFFER); |
| 378 | } |
| 379 | |
Jamie Madill | 6f755b2 | 2018-10-09 12:48:54 -0400 | [diff] [blame^] | 380 | angle::Result VertexArray::syncState(const Context *context) |
Jamie Madill | 0b9e903 | 2015-08-17 11:51:52 +0000 | [diff] [blame] | 381 | { |
| 382 | if (mDirtyBits.any()) |
| 383 | { |
Jamie Madill | 0946393 | 2018-04-04 05:26:59 -0400 | [diff] [blame] | 384 | mDirtyBitsGuard = mDirtyBits; |
Frank Henigman | 0af5b86 | 2018-03-27 20:19:33 -0400 | [diff] [blame] | 385 | ANGLE_TRY( |
| 386 | mVertexArray->syncState(context, mDirtyBits, mDirtyAttribBits, mDirtyBindingBits)); |
Jamie Madill | 0b9e903 | 2015-08-17 11:51:52 +0000 | [diff] [blame] | 387 | mDirtyBits.reset(); |
Jamie Madill | 0946393 | 2018-04-04 05:26:59 -0400 | [diff] [blame] | 388 | mDirtyBitsGuard.reset(); |
Jamie Madill | e858cb1 | 2018-03-27 09:44:32 -0400 | [diff] [blame] | 389 | |
| 390 | // This is a bit of an implementation hack - but since we know the implementation |
| 391 | // details of the dirty bit class it should always have the same effect as iterating |
| 392 | // individual attribs. We could also look into schemes where iterating the dirty |
| 393 | // bit set also resets it as you pass through it. |
| 394 | memset(&mDirtyAttribBits, 0, sizeof(mDirtyAttribBits)); |
| 395 | memset(&mDirtyBindingBits, 0, sizeof(mDirtyBindingBits)); |
Jamie Madill | 0b9e903 | 2015-08-17 11:51:52 +0000 | [diff] [blame] | 396 | } |
Jamie Madill | 6f755b2 | 2018-10-09 12:48:54 -0400 | [diff] [blame^] | 397 | return angle::Result::Continue(); |
Jamie Madill | 57a8972 | 2013-07-02 11:57:03 -0400 | [diff] [blame] | 398 | } |
| 399 | |
Jamie Madill | bf5177d | 2018-08-21 12:58:20 -0400 | [diff] [blame] | 400 | void VertexArray::onBindingChanged(const Context *context, int incr) |
James Darpinian | e8a93c6 | 2018-01-04 18:02:24 -0800 | [diff] [blame] | 401 | { |
| 402 | if (mState.mElementArrayBuffer.get()) |
Jamie Madill | bf5177d | 2018-08-21 12:58:20 -0400 | [diff] [blame] | 403 | mState.mElementArrayBuffer->onNonTFBindingChanged(context, incr); |
James Darpinian | e8a93c6 | 2018-01-04 18:02:24 -0800 | [diff] [blame] | 404 | for (auto &binding : mState.mVertexBindings) |
| 405 | { |
Jamie Madill | bf5177d | 2018-08-21 12:58:20 -0400 | [diff] [blame] | 406 | binding.onContainerBindingChanged(context, incr); |
James Darpinian | e8a93c6 | 2018-01-04 18:02:24 -0800 | [diff] [blame] | 407 | } |
| 408 | } |
| 409 | |
Jamie Madill | 0946393 | 2018-04-04 05:26:59 -0400 | [diff] [blame] | 410 | VertexArray::DirtyBitType VertexArray::getDirtyBitFromIndex(bool contentsChanged, |
| 411 | angle::SubjectIndex index) const |
| 412 | { |
Jamie Madill | d69a5f1 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 413 | if (IsElementArrayBufferSubjectIndex(index)) |
Jamie Madill | 0946393 | 2018-04-04 05:26:59 -0400 | [diff] [blame] | 414 | { |
| 415 | return contentsChanged ? DIRTY_BIT_ELEMENT_ARRAY_BUFFER_DATA |
| 416 | : DIRTY_BIT_ELEMENT_ARRAY_BUFFER; |
| 417 | } |
| 418 | else |
| 419 | { |
| 420 | // Note: this currently just gets the top-level dirty bit. |
| 421 | ASSERT(index < mArrayBufferObserverBindings.size()); |
| 422 | return static_cast<DirtyBitType>( |
| 423 | (contentsChanged ? DIRTY_BIT_BUFFER_DATA_0 : DIRTY_BIT_BINDING_0) + index); |
| 424 | } |
| 425 | } |
| 426 | |
| 427 | void VertexArray::onSubjectStateChange(const gl::Context *context, |
| 428 | angle::SubjectIndex index, |
| 429 | angle::SubjectMessage message) |
| 430 | { |
Jamie Madill | 7267aa6 | 2018-04-17 15:28:21 -0400 | [diff] [blame] | 431 | switch (message) |
| 432 | { |
| 433 | case angle::SubjectMessage::CONTENTS_CHANGED: |
| 434 | setDependentDirtyBit(context, true, index); |
| 435 | break; |
| 436 | |
| 437 | case angle::SubjectMessage::STORAGE_CHANGED: |
Jamie Madill | d69a5f1 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 438 | if (!IsElementArrayBufferSubjectIndex(index)) |
Jamie Madill | 7267aa6 | 2018-04-17 15:28:21 -0400 | [diff] [blame] | 439 | { |
Jamie Madill | bdc610a | 2018-07-30 10:26:00 -0400 | [diff] [blame] | 440 | updateCachedBufferBindingSize(&mState.mVertexBindings[index]); |
Jamie Madill | 7267aa6 | 2018-04-17 15:28:21 -0400 | [diff] [blame] | 441 | } |
Jamie Madill | a2d1d2d | 2018-08-01 11:34:46 -0400 | [diff] [blame] | 442 | setDependentDirtyBit(context, false, index); |
Jamie Madill | 7267aa6 | 2018-04-17 15:28:21 -0400 | [diff] [blame] | 443 | break; |
| 444 | |
| 445 | case angle::SubjectMessage::BINDING_CHANGED: |
Jamie Madill | d69a5f1 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 446 | if (!IsElementArrayBufferSubjectIndex(index)) |
Jamie Madill | 7267aa6 | 2018-04-17 15:28:21 -0400 | [diff] [blame] | 447 | { |
| 448 | const Buffer *buffer = mState.mVertexBindings[index].getBuffer().get(); |
| 449 | updateCachedTransformFeedbackBindingValidation(index, buffer); |
| 450 | } |
| 451 | break; |
| 452 | |
Jamie Madill | d69a5f1 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 453 | case angle::SubjectMessage::RESOURCE_MAPPED: |
| 454 | if (!IsElementArrayBufferSubjectIndex(index)) |
| 455 | { |
| 456 | updateCachedMappedArrayBuffers(&mState.mVertexBindings[index]); |
Jamie Madill | d84b673 | 2018-09-06 15:54:35 -0400 | [diff] [blame] | 457 | onStateChange(context, angle::SubjectMessage::RESOURCE_MAPPED); |
Jamie Madill | d69a5f1 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 458 | } |
| 459 | break; |
| 460 | |
| 461 | case angle::SubjectMessage::RESOURCE_UNMAPPED: |
| 462 | setDependentDirtyBit(context, true, index); |
| 463 | |
| 464 | if (!IsElementArrayBufferSubjectIndex(index)) |
| 465 | { |
| 466 | updateCachedMappedArrayBuffers(&mState.mVertexBindings[index]); |
Jamie Madill | d84b673 | 2018-09-06 15:54:35 -0400 | [diff] [blame] | 467 | onStateChange(context, angle::SubjectMessage::RESOURCE_UNMAPPED); |
Jamie Madill | d69a5f1 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 468 | } |
| 469 | break; |
| 470 | |
Jamie Madill | 7267aa6 | 2018-04-17 15:28:21 -0400 | [diff] [blame] | 471 | default: |
| 472 | UNREACHABLE(); |
| 473 | break; |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | void VertexArray::setDependentDirtyBit(const gl::Context *context, |
| 478 | bool contentsChanged, |
| 479 | angle::SubjectIndex index) |
| 480 | { |
Jamie Madill | 0946393 | 2018-04-04 05:26:59 -0400 | [diff] [blame] | 481 | DirtyBitType dirtyBit = getDirtyBitFromIndex(contentsChanged, index); |
| 482 | ASSERT(!mDirtyBitsGuard.valid() || mDirtyBitsGuard.value().test(dirtyBit)); |
| 483 | mDirtyBits.set(dirtyBit); |
Jamie Madill | a11819d | 2018-07-30 10:26:01 -0400 | [diff] [blame] | 484 | onStateChange(context, angle::SubjectMessage::CONTENTS_CHANGED); |
Jamie Madill | 0946393 | 2018-04-04 05:26:59 -0400 | [diff] [blame] | 485 | } |
| 486 | |
| 487 | void VertexArray::updateObserverBinding(size_t bindingIndex) |
| 488 | { |
| 489 | Buffer *boundBuffer = mState.mVertexBindings[bindingIndex].getBuffer().get(); |
| 490 | mArrayBufferObserverBindings[bindingIndex].bind(boundBuffer ? boundBuffer->getImplementation() |
| 491 | : nullptr); |
| 492 | } |
| 493 | |
Jamie Madill | bdc610a | 2018-07-30 10:26:00 -0400 | [diff] [blame] | 494 | void VertexArray::updateCachedBufferBindingSize(VertexBinding *binding) |
Jamie Madill | 02c9c04 | 2018-04-17 13:43:48 -0400 | [diff] [blame] | 495 | { |
Jamie Madill | bdc610a | 2018-07-30 10:26:00 -0400 | [diff] [blame] | 496 | for (size_t boundAttribute : binding->getBoundAttributesMask()) |
| 497 | { |
| 498 | mState.mVertexAttributes[boundAttribute].updateCachedElementLimit(*binding); |
| 499 | } |
Jamie Madill | 02c9c04 | 2018-04-17 13:43:48 -0400 | [diff] [blame] | 500 | } |
| 501 | |
Jamie Madill | 7267aa6 | 2018-04-17 15:28:21 -0400 | [diff] [blame] | 502 | void VertexArray::updateCachedTransformFeedbackBindingValidation(size_t bindingIndex, |
| 503 | const Buffer *buffer) |
| 504 | { |
| 505 | const bool hasConflict = buffer && buffer->isBoundForTransformFeedbackAndOtherUse(); |
| 506 | mCachedTransformFeedbackConflictedBindingsMask.set(bindingIndex, hasConflict); |
| 507 | } |
| 508 | |
Jamie Madill | ac43aaa | 2018-07-31 11:22:13 -0400 | [diff] [blame] | 509 | bool VertexArray::hasTransformFeedbackBindingConflict(const gl::Context *context) const |
Jamie Madill | 7267aa6 | 2018-04-17 15:28:21 -0400 | [diff] [blame] | 510 | { |
| 511 | // Fast check first. |
| 512 | if (!mCachedTransformFeedbackConflictedBindingsMask.any()) |
| 513 | { |
| 514 | return false; |
| 515 | } |
| 516 | |
Jamie Madill | ac43aaa | 2018-07-31 11:22:13 -0400 | [diff] [blame] | 517 | const AttributesMask &activeAttribues = context->getStateCache().getActiveBufferedAttribsMask(); |
| 518 | |
Jamie Madill | 7267aa6 | 2018-04-17 15:28:21 -0400 | [diff] [blame] | 519 | // Slow check. We must ensure that the conflicting attributes are enabled/active. |
| 520 | for (size_t attribIndex : activeAttribues) |
| 521 | { |
| 522 | const VertexAttribute &attrib = mState.mVertexAttributes[attribIndex]; |
| 523 | if (mCachedTransformFeedbackConflictedBindingsMask[attrib.bindingIndex]) |
| 524 | { |
| 525 | return true; |
| 526 | } |
| 527 | } |
| 528 | |
| 529 | return false; |
| 530 | } |
| 531 | |
Jamie Madill | d69a5f1 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 532 | void VertexArray::updateCachedMappedArrayBuffers(VertexBinding *binding) |
Jamie Madill | cc73f24 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 533 | { |
Jamie Madill | d69a5f1 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 534 | Buffer *buffer = binding->getBuffer().get(); |
| 535 | if (buffer && buffer->isMapped()) |
Jamie Madill | cc73f24 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 536 | { |
Jamie Madill | d69a5f1 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 537 | mState.mCachedMappedArrayBuffers |= binding->getBoundAttributesMask(); |
| 538 | } |
| 539 | else |
| 540 | { |
| 541 | mState.mCachedMappedArrayBuffers &= ~binding->getBoundAttributesMask(); |
Jamie Madill | cc73f24 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 542 | } |
| 543 | |
Jamie Madill | d69a5f1 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 544 | mState.mCachedEnabledMappedArrayBuffers = |
| 545 | mState.mCachedMappedArrayBuffers & mState.mEnabledAttributesMask; |
Jamie Madill | cc73f24 | 2018-08-01 11:34:48 -0400 | [diff] [blame] | 546 | } |
Jiawei-Shao | 2597fb6 | 2016-12-09 16:38:02 +0800 | [diff] [blame] | 547 | } // namespace gl |