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/CLtypes.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 size_t getSize(cl_int &errorCode) const = 0; 25 26 virtual CLMemoryImpl::Ptr createSubBuffer(const cl::Buffer &buffer, 27 cl::MemFlags flags, 28 size_t size, 29 cl_int &errorCode) = 0; 30 31 protected: 32 const cl::Memory &mMemory; 33 }; 34 35 } // namespace rx 36 37 #endif // LIBANGLE_RENDERER_CLMEMORYIMPL_H_ 38