blob: 6491ba1e8192228eb2992746237c15e9f82ad9a1 [file] [log] [blame]
Brandon Jones5bf98292014-06-06 17:19:38 -07001//
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 Lang0a73dd82014-11-19 16:18:08 -05009#ifndef LIBANGLE_RENDERER_VERTEXARRAYIMPL_H_
10#define LIBANGLE_RENDERER_VERTEXARRAYIMPL_H_
Brandon Jones5bf98292014-06-06 17:19:38 -070011
12#include "common/angleutils.h"
Geoff Lang2b5420c2014-11-19 14:20:15 -050013#include "libANGLE/Buffer.h"
Jamie Madill8e344942015-07-09 14:22:07 -040014#include "libANGLE/VertexArray.h"
Brandon Jones5bf98292014-06-06 17:19:38 -070015
Jamie Madilla56467e2018-04-11 16:19:41 -040016// This is a helper X macro for iterating over all dirty attribs/bindings. Useful for dirty bits.
17static_assert(gl::MAX_VERTEX_ATTRIBS == 16, "Invalid max vertex attribs");
18static_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 Jones5bf98292014-06-06 17:19:38 -070027namespace rx
28{
Jamie Madilldd43e6c2017-03-24 14:18:49 -040029class ContextImpl;
Brandon Jones5bf98292014-06-06 17:19:38 -070030
Jamie Madillf0d10f82015-03-31 12:56:52 -040031class VertexArrayImpl : angle::NonCopyable
Brandon Jones5bf98292014-06-06 17:19:38 -070032{
33 public:
Jamie Madill492f58e2017-10-09 19:41:33 -040034 VertexArrayImpl(const gl::VertexArrayState &state) : mState(state) {}
Frank Henigman0af5b862018-03-27 20:19:33 -040035 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 Madillc564c072017-06-01 12:45:42 -040039 {
Frank Henigman0af5b862018-03-27 20:19:33 -040040 return gl::NoError();
Jamie Madillc564c072017-06-01 12:45:42 -040041 }
42
Jamie Madill4928b7c2017-06-20 12:57:39 -040043 virtual void destroy(const gl::Context *context) {}
44 virtual ~VertexArrayImpl() {}
45
Jamie Madill2274b652018-05-31 10:56:08 -040046 const gl::VertexArrayState &getState() const { return mState; }
47
Jamie Madill8e344942015-07-09 14:22:07 -040048 protected:
Jamie Madill492f58e2017-10-09 19:41:33 -040049 const gl::VertexArrayState &mState;
Brandon Jones5bf98292014-06-06 17:19:38 -070050};
51
Jamie Madille858cb12018-03-27 09:44:32 -040052} // namespace rx
Brandon Jones5bf98292014-06-06 17:19:38 -070053
Geoff Lang0a73dd82014-11-19 16:18:08 -050054#endif // LIBANGLE_RENDERER_VERTEXARRAYIMPL_H_