xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/cl/CLMemoryCL.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 // CLMemoryCL.h: Defines the class interface for CLMemoryCL, implementing CLMemoryImpl.
7 
8 #ifndef LIBANGLE_RENDERER_CL_CLMEMORYCL_H_
9 #define LIBANGLE_RENDERER_CL_CLMEMORYCL_H_
10 
11 #include "libANGLE/renderer/CLMemoryImpl.h"
12 
13 namespace rx
14 {
15 
16 class CLMemoryCL : public CLMemoryImpl
17 {
18   public:
19     CLMemoryCL(const cl::Memory &memory, cl_mem native);
20     ~CLMemoryCL() override;
21 
22     cl_mem getNative() const;
23 
24     angle::Result createSubBuffer(const cl::Buffer &buffer,
25                                   cl::MemFlags flags,
26                                   size_t size,
27                                   CLMemoryImpl::Ptr *subBufferOut) override;
28 
29   private:
30     const cl_mem mNative;
31 };
32 
getNative()33 inline cl_mem CLMemoryCL::getNative() const
34 {
35     return mNative;
36 }
37 
38 }  // namespace rx
39 
40 #endif  // LIBANGLE_RENDERER_CL_CLMEMORYCL_H_
41