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 // VertexArray9.h: Defines the rx::VertexArray9 class which implements rx::VertexArrayImpl.
8 
9 #ifndef LIBANGLE_RENDERER_D3D_D3D9_VERTEXARRAY9_H_
10 #define LIBANGLE_RENDERER_D3D_D3D9_VERTEXARRAY9_H_
11 
12 #include "libANGLE/Context.h"
13 #include "libANGLE/renderer/VertexArrayImpl.h"
14 #include "libANGLE/renderer/d3d/d3d9/Context9.h"
15 #include "libANGLE/renderer/d3d/d3d9/Renderer9.h"
16 
17 namespace rx
18 {
19 class Renderer9;
20 
21 class VertexArray9 : public VertexArrayImpl
22 {
23   public:
VertexArray9(const gl::VertexArrayState & data)24     VertexArray9(const gl::VertexArrayState &data) : VertexArrayImpl(data) {}
25 
26     void syncState(const gl::Context *context,
27                    const gl::VertexArray::DirtyBits &dirtyBits) override;
28 
~VertexArray9()29     ~VertexArray9() override {}
30 
getCurrentStateSerial()31     Serial getCurrentStateSerial() const { return mCurrentStateSerial; }
32 
33   private:
34     Serial mCurrentStateSerial;
35 };
36 
syncState(const gl::Context * context,const gl::VertexArray::DirtyBits & dirtyBits)37 inline void VertexArray9::syncState(const gl::Context *context,
38                                     const gl::VertexArray::DirtyBits &dirtyBits)
39 {
40     ASSERT(dirtyBits.any());
41     Renderer9 *renderer = GetImplAs<Context9>(context)->getRenderer();
42     mCurrentStateSerial = renderer->generateSerial();
43 }
44 }
45 
46 #endif // LIBANGLE_RENDERER_D3D_D3D9_VERTEXARRAY9_H_
47