• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // Buffer9.h: Defines the rx::Buffer9 class which implements rx::BufferImpl via rx::BufferD3D.
8 
9 #ifndef LIBANGLE_RENDERER_D3D_D3D9_BUFFER9_H_
10 #define LIBANGLE_RENDERER_D3D_D3D9_BUFFER9_H_
11 
12 #include "common/MemoryBuffer.h"
13 #include "libANGLE/angletypes.h"
14 #include "libANGLE/renderer/d3d/BufferD3D.h"
15 
16 namespace rx
17 {
18 class Renderer9;
19 
20 class Buffer9 : public BufferD3D
21 {
22   public:
23     Buffer9(const gl::BufferState &state, Renderer9 *renderer);
24     ~Buffer9() override;
25 
26     // BufferD3D implementation
27     size_t getSize() const override;
28     bool supportsDirectBinding() const override;
29     angle::Result getData(const gl::Context *context, const uint8_t **outData) override;
30 
31     // BufferImpl implementation
32     angle::Result setData(const gl::Context *context,
33                           gl::BufferBinding target,
34                           const void *data,
35                           size_t size,
36                           gl::BufferUsage usage) override;
37     angle::Result setSubData(const gl::Context *context,
38                              gl::BufferBinding target,
39                              const void *data,
40                              size_t size,
41                              size_t offset) override;
42     angle::Result copySubData(const gl::Context *context,
43                               BufferImpl *source,
44                               GLintptr sourceOffset,
45                               GLintptr destOffset,
46                               GLsizeiptr size) override;
47     angle::Result map(const gl::Context *context, GLenum access, void **mapPtr) override;
48     angle::Result mapRange(const gl::Context *context,
49                            size_t offset,
50                            size_t length,
51                            GLbitfield access,
52                            void **mapPtr) override;
53     angle::Result unmap(const gl::Context *context, GLboolean *result) override;
54     angle::Result markTransformFeedbackUsage(const gl::Context *context) override;
55 
56   private:
57     angle::MemoryBuffer mMemory;
58     size_t mSize;
59 };
60 
61 }  // namespace rx
62 
63 #endif  // LIBANGLE_RENDERER_D3D_D3D9_BUFFER9_H_
64