daniel@transgaming.com | 0f7aaf5 | 2010-03-11 19:41:38 +0000 | [diff] [blame] | 1 | // |
daniel@transgaming.com | 8ca9c6e | 2012-01-27 15:38:54 +0000 | [diff] [blame] | 2 | // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved. |
daniel@transgaming.com | 0f7aaf5 | 2010-03-11 19:41:38 +0000 | [diff] [blame] | 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
daniel@transgaming.com | 8fd34bd | 2011-02-18 02:52:14 +0000 | [diff] [blame] | 7 | // VertexDataManager.h: Defines the VertexDataManager, a class that |
daniel@transgaming.com | 0f7aaf5 | 2010-03-11 19:41:38 +0000 | [diff] [blame] | 8 | // runs the Buffer translation process. |
| 9 | |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 10 | #include "libANGLE/renderer/d3d/VertexDataManager.h" |
Jamie Madill | fd1bf4e | 2015-03-31 09:46:02 -0400 | [diff] [blame] | 11 | |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 12 | #include "common/BitSetIterator.h" |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 13 | #include "libANGLE/Buffer.h" |
Jamie Madill | dbfc6c6 | 2016-02-29 01:08:57 -0500 | [diff] [blame] | 14 | #include "libANGLE/formatutils.h" |
Geoff Lang | 7dd2e10 | 2014-11-10 15:19:26 -0500 | [diff] [blame] | 15 | #include "libANGLE/Program.h" |
Jamie Madill | fd1bf4e | 2015-03-31 09:46:02 -0400 | [diff] [blame] | 16 | #include "libANGLE/State.h" |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 17 | #include "libANGLE/VertexAttribute.h" |
Geoff Lang | 5ead927 | 2015-03-25 12:27:43 -0400 | [diff] [blame] | 18 | #include "libANGLE/VertexArray.h" |
Jamie Madill | fd1bf4e | 2015-03-31 09:46:02 -0400 | [diff] [blame] | 19 | #include "libANGLE/renderer/d3d/BufferD3D.h" |
Jamie Madill | dbfc6c6 | 2016-02-29 01:08:57 -0500 | [diff] [blame] | 20 | #include "libANGLE/renderer/d3d/RendererD3D.h" |
Jamie Madill | fd1bf4e | 2015-03-31 09:46:02 -0400 | [diff] [blame] | 21 | #include "libANGLE/renderer/d3d/VertexBuffer.h" |
daniel@transgaming.com | 0f7aaf5 | 2010-03-11 19:41:38 +0000 | [diff] [blame] | 22 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 23 | using namespace angle; |
| 24 | |
daniel@transgaming.com | 3124048 | 2012-11-28 21:06:41 +0000 | [diff] [blame] | 25 | namespace rx |
daniel@transgaming.com | 0f7aaf5 | 2010-03-11 19:41:38 +0000 | [diff] [blame] | 26 | { |
Jamie Madill | dbfc6c6 | 2016-02-29 01:08:57 -0500 | [diff] [blame] | 27 | namespace |
| 28 | { |
| 29 | enum |
| 30 | { |
| 31 | INITIAL_STREAM_BUFFER_SIZE = 1024 * 1024 |
| 32 | }; |
| 33 | // This has to be at least 4k or else it fails on ATI cards. |
| 34 | enum |
| 35 | { |
| 36 | CONSTANT_VERTEX_BUFFER_SIZE = 4096 |
| 37 | }; |
daniel@transgaming.com | 0f7aaf5 | 2010-03-11 19:41:38 +0000 | [diff] [blame] | 38 | |
Jamie Madill | dbfc6c6 | 2016-02-29 01:08:57 -0500 | [diff] [blame] | 39 | int ElementsInBuffer(const gl::VertexAttribute &attrib, unsigned int size) |
jbauman@chromium.org | 059fc15 | 2011-11-18 19:26:17 +0000 | [diff] [blame] | 40 | { |
Geoff Lang | a36ead4 | 2013-08-02 11:54:08 -0400 | [diff] [blame] | 41 | // Size cannot be larger than a GLsizei |
| 42 | if (size > static_cast<unsigned int>(std::numeric_limits<int>::max())) |
| 43 | { |
| 44 | size = static_cast<unsigned int>(std::numeric_limits<int>::max()); |
| 45 | } |
| 46 | |
Cooper Partin | 4d61f7e | 2015-08-12 10:56:50 -0700 | [diff] [blame] | 47 | GLsizei stride = static_cast<GLsizei>(ComputeVertexAttributeStride(attrib)); |
| 48 | return (size - attrib.offset % stride + |
| 49 | (stride - static_cast<GLsizei>(ComputeVertexAttributeTypeSize(attrib)))) / |
| 50 | stride; |
jbauman@chromium.org | 059fc15 | 2011-11-18 19:26:17 +0000 | [diff] [blame] | 51 | } |
| 52 | |
Jamie Madill | dbfc6c6 | 2016-02-29 01:08:57 -0500 | [diff] [blame] | 53 | bool DirectStoragePossible(const gl::VertexAttribute &attrib) |
| 54 | { |
| 55 | // Current value attribs may not use direct storage. |
| 56 | if (!attrib.enabled) |
| 57 | { |
| 58 | return false; |
| 59 | } |
| 60 | |
| 61 | gl::Buffer *buffer = attrib.buffer.get(); |
| 62 | if (!buffer) |
| 63 | { |
| 64 | return false; |
| 65 | } |
| 66 | |
| 67 | BufferD3D *bufferD3D = GetImplAs<BufferD3D>(buffer); |
| 68 | ASSERT(bufferD3D); |
| 69 | if (!bufferD3D->supportsDirectBinding()) |
| 70 | { |
| 71 | return false; |
| 72 | } |
| 73 | |
Jamie Madill | dbfc6c6 | 2016-02-29 01:08:57 -0500 | [diff] [blame] | 74 | // Alignment restrictions: In D3D, vertex data must be aligned to the format stride, or to a |
| 75 | // 4-byte boundary, whichever is smaller. (Undocumented, and experimentally confirmed) |
Jamie Madill | d8fa921 | 2016-03-02 11:51:43 -0500 | [diff] [blame] | 76 | size_t alignment = 4; |
Jamie Madill | dbfc6c6 | 2016-02-29 01:08:57 -0500 | [diff] [blame] | 77 | |
| 78 | if (attrib.type != GL_FLOAT) |
| 79 | { |
| 80 | gl::VertexFormatType vertexFormatType = gl::GetVertexFormatType(attrib); |
| 81 | |
Jamie Madill | dbfc6c6 | 2016-02-29 01:08:57 -0500 | [diff] [blame] | 82 | // TODO(jmadill): add VertexFormatCaps |
| 83 | BufferFactoryD3D *factory = bufferD3D->getFactory(); |
Jamie Madill | d8fa921 | 2016-03-02 11:51:43 -0500 | [diff] [blame] | 84 | |
| 85 | auto errorOrElementSize = factory->getVertexSpaceRequired(attrib, 1, 0); |
| 86 | if (errorOrElementSize.isError()) |
| 87 | { |
Yuly Novikov | d73f852 | 2017-01-13 17:48:57 -0500 | [diff] [blame^] | 88 | ERR() << "Unlogged error in DirectStoragePossible."; |
Jamie Madill | d8fa921 | 2016-03-02 11:51:43 -0500 | [diff] [blame] | 89 | return false; |
| 90 | } |
| 91 | |
| 92 | alignment = std::min<size_t>(errorOrElementSize.getResult(), 4); |
| 93 | |
| 94 | // CPU-converted vertex data must be converted (naturally). |
| 95 | if ((factory->getVertexConversionType(vertexFormatType) & VERTEX_CONVERT_CPU) != 0) |
| 96 | { |
| 97 | return false; |
| 98 | } |
Jamie Madill | dbfc6c6 | 2016-02-29 01:08:57 -0500 | [diff] [blame] | 99 | } |
| 100 | |
Jamie Madill | d8fa921 | 2016-03-02 11:51:43 -0500 | [diff] [blame] | 101 | // Final alignment check - unaligned data must be converted. |
| 102 | return (static_cast<size_t>(ComputeVertexAttributeStride(attrib)) % alignment == 0) && |
| 103 | (static_cast<size_t>(attrib.offset) % alignment == 0); |
Jamie Madill | dbfc6c6 | 2016-02-29 01:08:57 -0500 | [diff] [blame] | 104 | } |
| 105 | } // anonymous namespace |
| 106 | |
Jamie Madill | e36b92d | 2016-03-04 15:46:58 -0500 | [diff] [blame] | 107 | TranslatedAttribute::TranslatedAttribute() |
| 108 | : active(false), |
| 109 | attribute(nullptr), |
| 110 | currentValueType(GL_NONE), |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 111 | baseOffset(0), |
| 112 | usesFirstVertexOffset(false), |
Jamie Madill | e36b92d | 2016-03-04 15:46:58 -0500 | [diff] [blame] | 113 | stride(0), |
| 114 | vertexBuffer(), |
| 115 | storage(nullptr), |
| 116 | serial(0), |
| 117 | divisor(0) |
| 118 | { |
| 119 | } |
| 120 | |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 121 | gl::ErrorOrResult<unsigned int> TranslatedAttribute::computeOffset(GLint startVertex) const |
| 122 | { |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 123 | if (!usesFirstVertexOffset) |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 124 | { |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 125 | return baseOffset; |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 126 | } |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 127 | |
| 128 | CheckedNumeric<unsigned int> offset; |
| 129 | |
| 130 | offset = baseOffset + stride * static_cast<unsigned int>(startVertex); |
| 131 | ANGLE_TRY_CHECKED_MATH(offset); |
| 132 | return offset.ValueOrDie(); |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 133 | } |
| 134 | |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 135 | VertexStorageType ClassifyAttributeStorage(const gl::VertexAttribute &attrib) |
| 136 | { |
| 137 | // If attribute is disabled, we use the current value. |
| 138 | if (!attrib.enabled) |
| 139 | { |
| 140 | return VertexStorageType::CURRENT_VALUE; |
| 141 | } |
| 142 | |
| 143 | // If specified with immediate data, we must use dynamic storage. |
| 144 | auto *buffer = attrib.buffer.get(); |
| 145 | if (!buffer) |
| 146 | { |
| 147 | return VertexStorageType::DYNAMIC; |
| 148 | } |
| 149 | |
| 150 | // Check if the buffer supports direct storage. |
| 151 | if (DirectStoragePossible(attrib)) |
| 152 | { |
| 153 | return VertexStorageType::DIRECT; |
| 154 | } |
| 155 | |
| 156 | // Otherwise the storage is static or dynamic. |
| 157 | BufferD3D *bufferD3D = GetImplAs<BufferD3D>(buffer); |
| 158 | ASSERT(bufferD3D); |
| 159 | switch (bufferD3D->getUsage()) |
| 160 | { |
| 161 | case D3DBufferUsage::DYNAMIC: |
| 162 | return VertexStorageType::DYNAMIC; |
| 163 | case D3DBufferUsage::STATIC: |
| 164 | return VertexStorageType::STATIC; |
| 165 | default: |
| 166 | UNREACHABLE(); |
| 167 | return VertexStorageType::UNKNOWN; |
| 168 | } |
| 169 | } |
| 170 | |
Jamie Madill | b3f4e8d | 2015-06-22 13:57:17 -0400 | [diff] [blame] | 171 | VertexDataManager::CurrentValueState::CurrentValueState() |
| 172 | : buffer(nullptr), |
| 173 | offset(0) |
daniel@transgaming.com | 0f7aaf5 | 2010-03-11 19:41:38 +0000 | [diff] [blame] | 174 | { |
Jamie Madill | b3f4e8d | 2015-06-22 13:57:17 -0400 | [diff] [blame] | 175 | data.FloatValues[0] = std::numeric_limits<float>::quiet_NaN(); |
| 176 | data.FloatValues[1] = std::numeric_limits<float>::quiet_NaN(); |
| 177 | data.FloatValues[2] = std::numeric_limits<float>::quiet_NaN(); |
| 178 | data.FloatValues[3] = std::numeric_limits<float>::quiet_NaN(); |
| 179 | data.Type = GL_FLOAT; |
| 180 | } |
daniel@transgaming.com | 8392138 | 2011-01-08 05:46:00 +0000 | [diff] [blame] | 181 | |
Jamie Madill | b3f4e8d | 2015-06-22 13:57:17 -0400 | [diff] [blame] | 182 | VertexDataManager::CurrentValueState::~CurrentValueState() |
| 183 | { |
| 184 | SafeDelete(buffer); |
| 185 | } |
| 186 | |
| 187 | VertexDataManager::VertexDataManager(BufferFactoryD3D *factory) |
| 188 | : mFactory(factory), |
| 189 | mStreamingBuffer(nullptr), |
| 190 | // TODO(jmadill): use context caps |
| 191 | mCurrentValueCache(gl::MAX_VERTEX_ATTRIBS) |
| 192 | { |
Jamie Madill | fd1bf4e | 2015-03-31 09:46:02 -0400 | [diff] [blame] | 193 | mStreamingBuffer = new StreamingVertexBufferInterface(factory, INITIAL_STREAM_BUFFER_SIZE); |
daniel@transgaming.com | 72b9e18 | 2011-04-13 14:58:33 +0000 | [diff] [blame] | 194 | |
| 195 | if (!mStreamingBuffer) |
| 196 | { |
Yuly Novikov | d73f852 | 2017-01-13 17:48:57 -0500 | [diff] [blame^] | 197 | ERR() << "Failed to allocate the streaming vertex buffer."; |
daniel@transgaming.com | 72b9e18 | 2011-04-13 14:58:33 +0000 | [diff] [blame] | 198 | } |
daniel@transgaming.com | 0f7aaf5 | 2010-03-11 19:41:38 +0000 | [diff] [blame] | 199 | } |
| 200 | |
| 201 | VertexDataManager::~VertexDataManager() |
| 202 | { |
Jamie Madill | b3f4e8d | 2015-06-22 13:57:17 -0400 | [diff] [blame] | 203 | SafeDelete(mStreamingBuffer); |
daniel@transgaming.com | 0f7aaf5 | 2010-03-11 19:41:38 +0000 | [diff] [blame] | 204 | } |
| 205 | |
Jamie Madill | 476682e | 2015-06-30 10:04:29 -0400 | [diff] [blame] | 206 | gl::Error VertexDataManager::prepareVertexData(const gl::State &state, |
| 207 | GLint start, |
| 208 | GLsizei count, |
| 209 | std::vector<TranslatedAttribute> *translatedAttribs, |
| 210 | GLsizei instances) |
daniel@transgaming.com | 8392138 | 2011-01-08 05:46:00 +0000 | [diff] [blame] | 211 | { |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 212 | ASSERT(mStreamingBuffer); |
daniel@transgaming.com | 72b9e18 | 2011-04-13 14:58:33 +0000 | [diff] [blame] | 213 | |
Geoff Lang | 5ead927 | 2015-03-25 12:27:43 -0400 | [diff] [blame] | 214 | const gl::VertexArray *vertexArray = state.getVertexArray(); |
Jamie Madill | 63805b4 | 2015-08-25 13:17:39 -0400 | [diff] [blame] | 215 | const auto &vertexAttributes = vertexArray->getVertexAttributes(); |
Geoff Lang | 5ead927 | 2015-03-25 12:27:43 -0400 | [diff] [blame] | 216 | |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 217 | mDynamicAttribsMaskCache.reset(); |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 218 | const gl::Program *program = state.getProgram(); |
| 219 | |
Jamie Madill | 476682e | 2015-06-30 10:04:29 -0400 | [diff] [blame] | 220 | translatedAttribs->clear(); |
Jamie Madill | 27c0891 | 2015-06-22 13:57:20 -0400 | [diff] [blame] | 221 | |
Jamie Madill | 9c38580 | 2015-06-22 13:57:18 -0400 | [diff] [blame] | 222 | for (size_t attribIndex = 0; attribIndex < vertexAttributes.size(); ++attribIndex) |
daniel@transgaming.com | 0f7aaf5 | 2010-03-11 19:41:38 +0000 | [diff] [blame] | 223 | { |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 224 | // Skip attrib locations the program doesn't use. |
| 225 | if (!program->isAttribLocationActive(attribIndex)) |
| 226 | continue; |
| 227 | |
| 228 | const auto &attrib = vertexAttributes[attribIndex]; |
| 229 | |
| 230 | // Resize automatically puts in empty attribs |
| 231 | translatedAttribs->resize(attribIndex + 1); |
| 232 | |
| 233 | TranslatedAttribute *translated = &(*translatedAttribs)[attribIndex]; |
| 234 | auto currentValueData = |
| 235 | state.getVertexAttribCurrentValue(static_cast<unsigned int>(attribIndex)); |
| 236 | |
| 237 | // Record the attribute now |
| 238 | translated->active = true; |
| 239 | translated->attribute = &attrib; |
| 240 | translated->currentValueType = currentValueData.Type; |
| 241 | translated->divisor = attrib.divisor; |
| 242 | |
| 243 | switch (ClassifyAttributeStorage(attrib)) |
daniel@transgaming.com | c828b14 | 2010-05-12 03:42:04 +0000 | [diff] [blame] | 244 | { |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 245 | case VertexStorageType::STATIC: |
Jamie Madill | 9c38580 | 2015-06-22 13:57:18 -0400 | [diff] [blame] | 246 | { |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 247 | // Store static attribute. |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 248 | ANGLE_TRY(StoreStaticAttrib(translated, count, instances)); |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 249 | break; |
Jamie Madill | 9c38580 | 2015-06-22 13:57:18 -0400 | [diff] [blame] | 250 | } |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 251 | case VertexStorageType::DYNAMIC: |
| 252 | // Dynamic attributes must be handled together. |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 253 | mDynamicAttribsMaskCache.set(attribIndex); |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 254 | break; |
| 255 | case VertexStorageType::DIRECT: |
| 256 | // Update translated data for direct attributes. |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 257 | StoreDirectAttrib(translated); |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 258 | break; |
| 259 | case VertexStorageType::CURRENT_VALUE: |
Jamie Madill | 27c0891 | 2015-06-22 13:57:20 -0400 | [diff] [blame] | 260 | { |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 261 | ANGLE_TRY(storeCurrentValue(currentValueData, translated, attribIndex)); |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 262 | break; |
Jamie Madill | 27c0891 | 2015-06-22 13:57:20 -0400 | [diff] [blame] | 263 | } |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 264 | default: |
| 265 | UNREACHABLE(); |
| 266 | break; |
shannon.woods@transgaming.com | a9a509e | 2013-02-28 23:10:44 +0000 | [diff] [blame] | 267 | } |
| 268 | } |
| 269 | |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 270 | if (mDynamicAttribsMaskCache.none()) |
shannon.woods@transgaming.com | a9a509e | 2013-02-28 23:10:44 +0000 | [diff] [blame] | 271 | { |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 272 | return gl::NoError(); |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 273 | } |
| 274 | |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 275 | ANGLE_TRY( |
| 276 | storeDynamicAttribs(translatedAttribs, mDynamicAttribsMaskCache, start, count, instances)); |
| 277 | |
| 278 | PromoteDynamicAttribs(*translatedAttribs, mDynamicAttribsMaskCache, count); |
| 279 | |
| 280 | return gl::NoError(); |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 281 | } |
| 282 | |
| 283 | // static |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 284 | void VertexDataManager::StoreDirectAttrib(TranslatedAttribute *directAttrib) |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 285 | { |
| 286 | const auto &attrib = *directAttrib->attribute; |
| 287 | gl::Buffer *buffer = attrib.buffer.get(); |
| 288 | BufferD3D *bufferD3D = buffer ? GetImplAs<BufferD3D>(buffer) : nullptr; |
| 289 | |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 290 | ASSERT(DirectStoragePossible(attrib)); |
| 291 | directAttrib->vertexBuffer.set(nullptr); |
| 292 | directAttrib->storage = bufferD3D; |
| 293 | directAttrib->serial = bufferD3D->getSerial(); |
| 294 | directAttrib->stride = static_cast<unsigned int>(ComputeVertexAttributeStride(attrib)); |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 295 | directAttrib->baseOffset = static_cast<unsigned int>(attrib.offset); |
| 296 | |
| 297 | // Instanced vertices do not apply the 'start' offset |
| 298 | directAttrib->usesFirstVertexOffset = (attrib.divisor == 0); |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 299 | } |
| 300 | |
| 301 | // static |
| 302 | gl::Error VertexDataManager::StoreStaticAttrib(TranslatedAttribute *translated, |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 303 | GLsizei count, |
| 304 | GLsizei instances) |
| 305 | { |
| 306 | const gl::VertexAttribute &attrib = *translated->attribute; |
| 307 | |
| 308 | gl::Buffer *buffer = attrib.buffer.get(); |
| 309 | ASSERT(buffer && attrib.enabled && !DirectStoragePossible(attrib)); |
| 310 | BufferD3D *bufferD3D = GetImplAs<BufferD3D>(buffer); |
| 311 | |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 312 | // Compute source data pointer |
| 313 | const uint8_t *sourceData = nullptr; |
| 314 | |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 315 | ANGLE_TRY(bufferD3D->getData(&sourceData)); |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 316 | sourceData += static_cast<int>(attrib.offset); |
| 317 | |
| 318 | unsigned int streamOffset = 0; |
| 319 | |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 320 | translated->storage = nullptr; |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 321 | ANGLE_TRY_RESULT(bufferD3D->getFactory()->getVertexSpaceRequired(attrib, 1, 0), |
| 322 | translated->stride); |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 323 | |
| 324 | auto *staticBuffer = bufferD3D->getStaticVertexBuffer(attrib); |
| 325 | ASSERT(staticBuffer); |
| 326 | |
| 327 | if (staticBuffer->empty()) |
| 328 | { |
| 329 | // Convert the entire buffer |
| 330 | int totalCount = ElementsInBuffer(attrib, static_cast<unsigned int>(bufferD3D->getSize())); |
| 331 | int startIndex = static_cast<int>(attrib.offset) / |
| 332 | static_cast<int>(ComputeVertexAttributeStride(attrib)); |
| 333 | |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 334 | ANGLE_TRY( |
| 335 | staticBuffer->storeStaticAttribute(attrib, -startIndex, totalCount, 0, sourceData)); |
daniel@transgaming.com | 8392138 | 2011-01-08 05:46:00 +0000 | [diff] [blame] | 336 | } |
| 337 | |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 338 | unsigned int firstElementOffset = |
| 339 | (static_cast<unsigned int>(attrib.offset) / |
| 340 | static_cast<unsigned int>(ComputeVertexAttributeStride(attrib))) * |
| 341 | translated->stride; |
Jamie Madill | 27c0891 | 2015-06-22 13:57:20 -0400 | [diff] [blame] | 342 | |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 343 | VertexBuffer *vertexBuffer = staticBuffer->getVertexBuffer(); |
| 344 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 345 | CheckedNumeric<unsigned int> checkedOffset(streamOffset); |
| 346 | checkedOffset += firstElementOffset; |
| 347 | |
| 348 | if (!checkedOffset.IsValid()) |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 349 | { |
| 350 | return gl::Error(GL_INVALID_OPERATION, |
| 351 | "Integer overflow in VertexDataManager::StoreStaticAttrib"); |
| 352 | } |
| 353 | |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 354 | translated->vertexBuffer.set(vertexBuffer); |
| 355 | translated->serial = vertexBuffer->getSerial(); |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 356 | translated->baseOffset = streamOffset + firstElementOffset; |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 357 | |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 358 | // Instanced vertices do not apply the 'start' offset |
| 359 | translated->usesFirstVertexOffset = (attrib.divisor == 0); |
| 360 | |
| 361 | return gl::NoError(); |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 362 | } |
| 363 | |
| 364 | gl::Error VertexDataManager::storeDynamicAttribs( |
| 365 | std::vector<TranslatedAttribute> *translatedAttribs, |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 366 | const gl::AttributesMask &dynamicAttribsMask, |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 367 | GLint start, |
| 368 | GLsizei count, |
| 369 | GLsizei instances) |
| 370 | { |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 371 | // Instantiating this class will ensure the streaming buffer is never left mapped. |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 372 | class StreamingBufferUnmapper final : NonCopyable |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 373 | { |
| 374 | public: |
| 375 | StreamingBufferUnmapper(StreamingVertexBufferInterface *streamingBuffer) |
| 376 | : mStreamingBuffer(streamingBuffer) |
| 377 | { |
| 378 | ASSERT(mStreamingBuffer); |
| 379 | } |
| 380 | ~StreamingBufferUnmapper() { mStreamingBuffer->getVertexBuffer()->hintUnmapResource(); } |
| 381 | |
| 382 | private: |
| 383 | StreamingVertexBufferInterface *mStreamingBuffer; |
| 384 | }; |
| 385 | |
| 386 | // Will trigger unmapping on return. |
| 387 | StreamingBufferUnmapper localUnmapper(mStreamingBuffer); |
| 388 | |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 389 | // Reserve the required space for the dynamic buffers. |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 390 | for (auto attribIndex : IterateBitSet(dynamicAttribsMask)) |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 391 | { |
| 392 | const auto &dynamicAttrib = (*translatedAttribs)[attribIndex]; |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 393 | ANGLE_TRY(reserveSpaceForAttrib(dynamicAttrib, count, instances)); |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 394 | } |
| 395 | |
| 396 | // Store dynamic attributes |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 397 | for (auto attribIndex : IterateBitSet(dynamicAttribsMask)) |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 398 | { |
| 399 | auto *dynamicAttrib = &(*translatedAttribs)[attribIndex]; |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 400 | ANGLE_TRY(storeDynamicAttrib(dynamicAttrib, start, count, instances)); |
| 401 | } |
Shannon Woods | 1a96548 | 2014-09-22 18:00:32 -0400 | [diff] [blame] | 402 | |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 403 | return gl::NoError(); |
| 404 | } |
| 405 | |
| 406 | void VertexDataManager::PromoteDynamicAttribs( |
| 407 | const std::vector<TranslatedAttribute> &translatedAttribs, |
| 408 | const gl::AttributesMask &dynamicAttribsMask, |
| 409 | GLsizei count) |
| 410 | { |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 411 | for (auto attribIndex : IterateBitSet(dynamicAttribsMask)) |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 412 | { |
| 413 | const auto &dynamicAttrib = translatedAttribs[attribIndex]; |
| 414 | gl::Buffer *buffer = dynamicAttrib.attribute->buffer.get(); |
Jamie Madill | 27c0891 | 2015-06-22 13:57:20 -0400 | [diff] [blame] | 415 | if (buffer) |
| 416 | { |
| 417 | BufferD3D *bufferD3D = GetImplAs<BufferD3D>(buffer); |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 418 | size_t typeSize = ComputeVertexAttributeTypeSize(*dynamicAttrib.attribute); |
Cooper Partin | 4d61f7e | 2015-08-12 10:56:50 -0700 | [diff] [blame] | 419 | bufferD3D->promoteStaticUsage(count * static_cast<int>(typeSize)); |
daniel@transgaming.com | 78624ca | 2011-04-22 04:17:57 +0000 | [diff] [blame] | 420 | } |
| 421 | } |
daniel@transgaming.com | 0f7aaf5 | 2010-03-11 19:41:38 +0000 | [diff] [blame] | 422 | } |
| 423 | |
Jamie Madill | 3d72cc7 | 2015-06-22 13:57:19 -0400 | [diff] [blame] | 424 | gl::Error VertexDataManager::reserveSpaceForAttrib(const TranslatedAttribute &translatedAttrib, |
Geoff Lang | f7100b9 | 2014-09-08 16:17:08 -0400 | [diff] [blame] | 425 | GLsizei count, |
| 426 | GLsizei instances) const |
Jamie Madill | 6d11380 | 2014-08-25 15:47:52 -0400 | [diff] [blame] | 427 | { |
Jamie Madill | 3d72cc7 | 2015-06-22 13:57:19 -0400 | [diff] [blame] | 428 | const gl::VertexAttribute &attrib = *translatedAttrib.attribute; |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 429 | ASSERT(!DirectStoragePossible(attrib)); |
Jamie Madill | 6d11380 | 2014-08-25 15:47:52 -0400 | [diff] [blame] | 430 | |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 431 | gl::Buffer *buffer = attrib.buffer.get(); |
Jamie Madill | e36b92d | 2016-03-04 15:46:58 -0500 | [diff] [blame] | 432 | BufferD3D *bufferD3D = buffer ? GetImplAs<BufferD3D>(buffer) : nullptr; |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 433 | ASSERT(!bufferD3D || bufferD3D->getStaticVertexBuffer(attrib) == nullptr); |
Jamie Madill | e36b92d | 2016-03-04 15:46:58 -0500 | [diff] [blame] | 434 | |
| 435 | size_t totalCount = ComputeVertexAttributeElementCount(attrib, count, instances); |
| 436 | ASSERT(!bufferD3D || |
| 437 | ElementsInBuffer(attrib, static_cast<unsigned int>(bufferD3D->getSize())) >= |
| 438 | static_cast<int>(totalCount)); |
| 439 | |
| 440 | return mStreamingBuffer->reserveVertexSpace(attrib, static_cast<GLsizei>(totalCount), |
| 441 | instances); |
Jamie Madill | 6d11380 | 2014-08-25 15:47:52 -0400 | [diff] [blame] | 442 | } |
| 443 | |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 444 | gl::Error VertexDataManager::storeDynamicAttrib(TranslatedAttribute *translated, |
| 445 | GLint start, |
| 446 | GLsizei count, |
| 447 | GLsizei instances) |
Jamie Madill | f41522b | 2014-08-18 16:39:49 -0400 | [diff] [blame] | 448 | { |
Jamie Madill | 9c38580 | 2015-06-22 13:57:18 -0400 | [diff] [blame] | 449 | const gl::VertexAttribute &attrib = *translated->attribute; |
| 450 | |
Jamie Madill | f41522b | 2014-08-18 16:39:49 -0400 | [diff] [blame] | 451 | gl::Buffer *buffer = attrib.buffer.get(); |
Jamie Madill | 2b97681 | 2014-08-25 15:47:49 -0400 | [diff] [blame] | 452 | ASSERT(buffer || attrib.pointer); |
Jamie Madill | 7d112bb | 2015-06-22 13:57:19 -0400 | [diff] [blame] | 453 | ASSERT(attrib.enabled); |
Jamie Madill | f41522b | 2014-08-18 16:39:49 -0400 | [diff] [blame] | 454 | |
Jamie Madill | dbfc6c6 | 2016-02-29 01:08:57 -0500 | [diff] [blame] | 455 | BufferD3D *storage = buffer ? GetImplAs<BufferD3D>(buffer) : nullptr; |
Jamie Madill | f41522b | 2014-08-18 16:39:49 -0400 | [diff] [blame] | 456 | |
Jamie Madill | d4b55a0 | 2015-01-09 14:21:49 -0500 | [diff] [blame] | 457 | // Instanced vertices do not apply the 'start' offset |
Jamie Madill | a053733 | 2015-11-19 13:55:26 -0500 | [diff] [blame] | 458 | GLint firstVertexIndex = (attrib.divisor > 0 ? 0 : start); |
Jamie Madill | d4b55a0 | 2015-01-09 14:21:49 -0500 | [diff] [blame] | 459 | |
Jamie Madill | 7d112bb | 2015-06-22 13:57:19 -0400 | [diff] [blame] | 460 | // Compute source data pointer |
| 461 | const uint8_t *sourceData = nullptr; |
| 462 | |
| 463 | if (buffer) |
| 464 | { |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 465 | ANGLE_TRY(storage->getData(&sourceData)); |
Jamie Madill | 7d112bb | 2015-06-22 13:57:19 -0400 | [diff] [blame] | 466 | sourceData += static_cast<int>(attrib.offset); |
| 467 | } |
| 468 | else |
| 469 | { |
| 470 | sourceData = static_cast<const uint8_t*>(attrib.pointer); |
| 471 | } |
| 472 | |
| 473 | unsigned int streamOffset = 0; |
Jamie Madill | d8fa921 | 2016-03-02 11:51:43 -0500 | [diff] [blame] | 474 | |
Jamie Madill | d8fa921 | 2016-03-02 11:51:43 -0500 | [diff] [blame] | 475 | translated->storage = nullptr; |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 476 | ANGLE_TRY_RESULT(mFactory->getVertexSpaceRequired(attrib, 1, 0), translated->stride); |
Jamie Madill | d8fa921 | 2016-03-02 11:51:43 -0500 | [diff] [blame] | 477 | |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 478 | size_t totalCount = ComputeVertexAttributeElementCount(attrib, count, instances); |
Jamie Madill | 7d112bb | 2015-06-22 13:57:19 -0400 | [diff] [blame] | 479 | |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 480 | ANGLE_TRY(mStreamingBuffer->storeDynamicAttribute( |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 481 | attrib, translated->currentValueType, firstVertexIndex, static_cast<GLsizei>(totalCount), |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 482 | instances, &streamOffset, sourceData)); |
Jamie Madill | f41522b | 2014-08-18 16:39:49 -0400 | [diff] [blame] | 483 | |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 484 | VertexBuffer *vertexBuffer = mStreamingBuffer->getVertexBuffer(); |
| 485 | |
| 486 | translated->vertexBuffer.set(vertexBuffer); |
| 487 | translated->serial = vertexBuffer->getSerial(); |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 488 | translated->baseOffset = streamOffset; |
| 489 | translated->usesFirstVertexOffset = false; |
Jamie Madill | f41522b | 2014-08-18 16:39:49 -0400 | [diff] [blame] | 490 | |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 491 | return gl::NoError(); |
Jamie Madill | f41522b | 2014-08-18 16:39:49 -0400 | [diff] [blame] | 492 | } |
| 493 | |
Jamie Madill | 9c38580 | 2015-06-22 13:57:18 -0400 | [diff] [blame] | 494 | gl::Error VertexDataManager::storeCurrentValue(const gl::VertexAttribCurrentValueData ¤tValue, |
Geoff Lang | f7100b9 | 2014-09-08 16:17:08 -0400 | [diff] [blame] | 495 | TranslatedAttribute *translated, |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 496 | size_t attribIndex) |
Jamie Madill | f41522b | 2014-08-18 16:39:49 -0400 | [diff] [blame] | 497 | { |
Jamie Madill | e18eb97 | 2016-03-04 15:46:59 -0500 | [diff] [blame] | 498 | CurrentValueState *cachedState = &mCurrentValueCache[attribIndex]; |
| 499 | auto *&buffer = cachedState->buffer; |
| 500 | |
| 501 | if (!buffer) |
| 502 | { |
| 503 | buffer = new StreamingVertexBufferInterface(mFactory, CONSTANT_VERTEX_BUFFER_SIZE); |
| 504 | } |
Jamie Madill | e36b92d | 2016-03-04 15:46:58 -0500 | [diff] [blame] | 505 | |
Jamie Madill | b3f4e8d | 2015-06-22 13:57:17 -0400 | [diff] [blame] | 506 | if (cachedState->data != currentValue) |
Jamie Madill | f41522b | 2014-08-18 16:39:49 -0400 | [diff] [blame] | 507 | { |
Jamie Madill | 9c38580 | 2015-06-22 13:57:18 -0400 | [diff] [blame] | 508 | const gl::VertexAttribute &attrib = *translated->attribute; |
Jamie Madill | 27c0891 | 2015-06-22 13:57:20 -0400 | [diff] [blame] | 509 | |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 510 | ANGLE_TRY(buffer->reserveVertexSpace(attrib, 1, 0)); |
Jamie Madill | f41522b | 2014-08-18 16:39:49 -0400 | [diff] [blame] | 511 | |
Jamie Madill | 7d112bb | 2015-06-22 13:57:19 -0400 | [diff] [blame] | 512 | const uint8_t *sourceData = reinterpret_cast<const uint8_t*>(currentValue.FloatValues); |
Jamie Madill | f41522b | 2014-08-18 16:39:49 -0400 | [diff] [blame] | 513 | unsigned int streamOffset; |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 514 | ANGLE_TRY(buffer->storeDynamicAttribute(attrib, currentValue.Type, 0, 1, 0, &streamOffset, |
| 515 | sourceData)); |
Jamie Madill | f41522b | 2014-08-18 16:39:49 -0400 | [diff] [blame] | 516 | |
Jamie Madill | e36b92d | 2016-03-04 15:46:58 -0500 | [diff] [blame] | 517 | buffer->getVertexBuffer()->hintUnmapResource(); |
| 518 | |
Jamie Madill | b3f4e8d | 2015-06-22 13:57:17 -0400 | [diff] [blame] | 519 | cachedState->data = currentValue; |
| 520 | cachedState->offset = streamOffset; |
Jamie Madill | f41522b | 2014-08-18 16:39:49 -0400 | [diff] [blame] | 521 | } |
| 522 | |
Jamie Madill | e36b92d | 2016-03-04 15:46:58 -0500 | [diff] [blame] | 523 | translated->vertexBuffer.set(buffer->getVertexBuffer()); |
Jamie Madill | f41522b | 2014-08-18 16:39:49 -0400 | [diff] [blame] | 524 | |
Jamie Madill | e36b92d | 2016-03-04 15:46:58 -0500 | [diff] [blame] | 525 | translated->storage = nullptr; |
| 526 | translated->serial = buffer->getSerial(); |
| 527 | translated->divisor = 0; |
| 528 | translated->stride = 0; |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 529 | translated->baseOffset = static_cast<unsigned int>(cachedState->offset); |
| 530 | translated->usesFirstVertexOffset = false; |
Jamie Madill | f41522b | 2014-08-18 16:39:49 -0400 | [diff] [blame] | 531 | |
Jamie Madill | 52b09c2 | 2016-04-11 14:12:31 -0400 | [diff] [blame] | 532 | return gl::NoError(); |
Jamie Madill | f41522b | 2014-08-18 16:39:49 -0400 | [diff] [blame] | 533 | } |
| 534 | |
Jamie Madill | e36b92d | 2016-03-04 15:46:58 -0500 | [diff] [blame] | 535 | // VertexBufferBinding implementation |
| 536 | VertexBufferBinding::VertexBufferBinding() : mBoundVertexBuffer(nullptr) |
| 537 | { |
| 538 | } |
| 539 | |
| 540 | VertexBufferBinding::VertexBufferBinding(const VertexBufferBinding &other) |
| 541 | : mBoundVertexBuffer(other.mBoundVertexBuffer) |
| 542 | { |
| 543 | if (mBoundVertexBuffer) |
| 544 | { |
| 545 | mBoundVertexBuffer->addRef(); |
| 546 | } |
| 547 | } |
| 548 | |
| 549 | VertexBufferBinding::~VertexBufferBinding() |
| 550 | { |
| 551 | if (mBoundVertexBuffer) |
| 552 | { |
| 553 | mBoundVertexBuffer->release(); |
| 554 | } |
| 555 | } |
| 556 | |
| 557 | VertexBufferBinding &VertexBufferBinding::operator=(const VertexBufferBinding &other) |
| 558 | { |
| 559 | mBoundVertexBuffer = other.mBoundVertexBuffer; |
| 560 | if (mBoundVertexBuffer) |
| 561 | { |
| 562 | mBoundVertexBuffer->addRef(); |
| 563 | } |
| 564 | return *this; |
| 565 | } |
| 566 | |
| 567 | void VertexBufferBinding::set(VertexBuffer *vertexBuffer) |
| 568 | { |
| 569 | if (mBoundVertexBuffer == vertexBuffer) |
| 570 | return; |
| 571 | |
| 572 | if (mBoundVertexBuffer) |
| 573 | { |
| 574 | mBoundVertexBuffer->release(); |
| 575 | } |
| 576 | if (vertexBuffer) |
| 577 | { |
| 578 | vertexBuffer->addRef(); |
| 579 | } |
| 580 | |
| 581 | mBoundVertexBuffer = vertexBuffer; |
| 582 | } |
| 583 | |
| 584 | VertexBuffer *VertexBufferBinding::get() const |
| 585 | { |
| 586 | return mBoundVertexBuffer; |
| 587 | } |
| 588 | |
Jamie Madill | dbfc6c6 | 2016-02-29 01:08:57 -0500 | [diff] [blame] | 589 | } // namespace rx |