xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/CLMemoryImpl.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 //
2 // Copyright 2021 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 // CLMemoryImpl.h: Defines the abstract rx::CLMemoryImpl class.
7 
8 #ifndef LIBANGLE_RENDERER_CLMEMORYIMPL_H_
9 #define LIBANGLE_RENDERER_CLMEMORYIMPL_H_
10 
11 #include "libANGLE/renderer/cl_types.h"
12 
13 namespace rx
14 {
15 
16 class CLMemoryImpl : angle::NonCopyable
17 {
18   public:
19     using Ptr = std::unique_ptr<CLMemoryImpl>;
20 
21     CLMemoryImpl(const cl::Memory &memory);
22     virtual ~CLMemoryImpl();
23 
24     virtual angle::Result createSubBuffer(const cl::Buffer &buffer,
25                                           cl::MemFlags flags,
26                                           size_t size,
27                                           CLMemoryImpl::Ptr *subBufferOut) = 0;
28 
29   protected:
30     const cl::Memory &mMemory;
31 };
32 
33 }  // namespace rx
34 
35 #endif  // LIBANGLE_RENDERER_CLMEMORYIMPL_H_
36