Brandon Jones | 5bf9829 | 2014-06-06 17:19:38 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright 2014 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 | |
| 7 | // VertexAttribImpl.h: Defines the abstract rx::VertexAttribImpl class. |
| 8 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 9 | #ifndef LIBANGLE_RENDERER_VERTEXARRAYIMPL_H_ |
| 10 | #define LIBANGLE_RENDERER_VERTEXARRAYIMPL_H_ |
Brandon Jones | 5bf9829 | 2014-06-06 17:19:38 -0700 | [diff] [blame] | 11 | |
| 12 | #include "common/angleutils.h" |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 13 | #include "libANGLE/Buffer.h" |
Jamie Madill | 8e34494 | 2015-07-09 14:22:07 -0400 | [diff] [blame] | 14 | #include "libANGLE/VertexArray.h" |
Brandon Jones | 5bf9829 | 2014-06-06 17:19:38 -0700 | [diff] [blame] | 15 | |
Jamie Madill | a56467e | 2018-04-11 16:19:41 -0400 | [diff] [blame] | 16 | // This is a helper X macro for iterating over all dirty attribs/bindings. Useful for dirty bits. |
| 17 | static_assert(gl::MAX_VERTEX_ATTRIBS == 16, "Invalid max vertex attribs"); |
| 18 | static_assert(gl::MAX_VERTEX_ATTRIB_BINDINGS == 16, "Invalid max vertex bindings"); |
| 19 | #define ANGLE_VERTEX_INDEX_CASES(FUNC) \ |
| 20 | FUNC(0) \ |
| 21 | FUNC(1) \ |
| 22 | FUNC(2) \ |
| 23 | FUNC(3) \ |
| 24 | FUNC(4) \ |
| 25 | FUNC(5) FUNC(6) FUNC(7) FUNC(8) FUNC(9) FUNC(10) FUNC(11) FUNC(12) FUNC(13) FUNC(14) FUNC(15) |
| 26 | |
Brandon Jones | 5bf9829 | 2014-06-06 17:19:38 -0700 | [diff] [blame] | 27 | namespace rx |
| 28 | { |
Jamie Madill | dd43e6c | 2017-03-24 14:18:49 -0400 | [diff] [blame] | 29 | class ContextImpl; |
Brandon Jones | 5bf9829 | 2014-06-06 17:19:38 -0700 | [diff] [blame] | 30 | |
Jamie Madill | f0d10f8 | 2015-03-31 12:56:52 -0400 | [diff] [blame] | 31 | class VertexArrayImpl : angle::NonCopyable |
Brandon Jones | 5bf9829 | 2014-06-06 17:19:38 -0700 | [diff] [blame] | 32 | { |
| 33 | public: |
Jamie Madill | 492f58e | 2017-10-09 19:41:33 -0400 | [diff] [blame] | 34 | VertexArrayImpl(const gl::VertexArrayState &state) : mState(state) {} |
Frank Henigman | 0af5b86 | 2018-03-27 20:19:33 -0400 | [diff] [blame] | 35 | virtual gl::Error syncState(const gl::Context *context, |
| 36 | const gl::VertexArray::DirtyBits &dirtyBits, |
| 37 | const gl::VertexArray::DirtyAttribBitsArray &attribBits, |
| 38 | const gl::VertexArray::DirtyBindingBitsArray &bindingBits) |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 39 | { |
Frank Henigman | 0af5b86 | 2018-03-27 20:19:33 -0400 | [diff] [blame] | 40 | return gl::NoError(); |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 41 | } |
| 42 | |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 43 | virtual void destroy(const gl::Context *context) {} |
| 44 | virtual ~VertexArrayImpl() {} |
| 45 | |
Jamie Madill | 2274b65 | 2018-05-31 10:56:08 -0400 | [diff] [blame^] | 46 | const gl::VertexArrayState &getState() const { return mState; } |
| 47 | |
Jamie Madill | 8e34494 | 2015-07-09 14:22:07 -0400 | [diff] [blame] | 48 | protected: |
Jamie Madill | 492f58e | 2017-10-09 19:41:33 -0400 | [diff] [blame] | 49 | const gl::VertexArrayState &mState; |
Brandon Jones | 5bf9829 | 2014-06-06 17:19:38 -0700 | [diff] [blame] | 50 | }; |
| 51 | |
Jamie Madill | e858cb1 | 2018-03-27 09:44:32 -0400 | [diff] [blame] | 52 | } // namespace rx |
Brandon Jones | 5bf9829 | 2014-06-06 17:19:38 -0700 | [diff] [blame] | 53 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 54 | #endif // LIBANGLE_RENDERER_VERTEXARRAYIMPL_H_ |