1 //
2 // Copyright 2002 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 // VertexBuffer9.h: Defines the D3D9 VertexBuffer implementation.
8 
9 #ifndef LIBANGLE_RENDERER_D3D_D3D9_VERTEXBUFFER9_H_
10 #define LIBANGLE_RENDERER_D3D_D3D9_VERTEXBUFFER9_H_
11 
12 #include "libANGLE/renderer/d3d/VertexBuffer.h"
13 
14 namespace rx
15 {
16 class Renderer9;
17 
18 class VertexBuffer9 : public VertexBuffer
19 {
20   public:
21     explicit VertexBuffer9(Renderer9 *renderer);
22 
23     angle::Result initialize(const gl::Context *context,
24                              unsigned int size,
25                              bool dynamicUsage) override;
26 
27     // Warning: you should ensure binding really matches attrib.bindingIndex before using this
28     // function.
29     angle::Result storeVertexAttributes(const gl::Context *context,
30                                         const gl::VertexAttribute &attrib,
31                                         const gl::VertexBinding &binding,
32                                         gl::VertexAttribType currentValueType,
33                                         GLint start,
34                                         size_t count,
35                                         GLsizei instances,
36                                         unsigned int offset,
37                                         const uint8_t *sourceData) override;
38 
39     unsigned int getBufferSize() const override;
40     angle::Result setBufferSize(const gl::Context *context, unsigned int size) override;
41     angle::Result discard(const gl::Context *context) override;
42 
43     IDirect3DVertexBuffer9 *getBuffer() const;
44 
45   private:
46     ~VertexBuffer9() override;
47     Renderer9 *mRenderer;
48 
49     IDirect3DVertexBuffer9 *mVertexBuffer;
50     unsigned int mBufferSize;
51     bool mDynamicUsage;
52 };
53 
54 }  // namespace rx
55 
56 #endif  // LIBANGLE_RENDERER_D3D_D3D9_VERTEXBUFFER9_H_
57