Hash :
daf18594
        
        Author :
  
        
        Date :
2021-05-31T12:04:42
        
      
CL: Refactor front end entry functions Move all front end functions that are only called from the OpenCL entry points to a separate section at the top of the front end object class bodies, which improves readability. Bug: angleproject:6001 Change-Id: Id360adbf0c439e4068c379aa4ea1da25e99f7b53 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2928419 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// CLBuffer.cpp: Implements the cl::Buffer class.
#include "libANGLE/CLBuffer.h"
namespace cl
{
cl_mem Buffer::createSubBuffer(MemFlags flags,
                               cl_buffer_create_type createType,
                               const void *createInfo,
                               cl_int &errorCode)
{
    const cl_buffer_region ®ion = *static_cast<const cl_buffer_region *>(createInfo);
    return Object::Create<Buffer>(errorCode, *this, flags, region.origin, region.size);
}
Buffer::~Buffer() = default;
Buffer::Buffer(Context &context,
               PropArray &&properties,
               MemFlags flags,
               size_t size,
               void *hostPtr,
               cl_int &errorCode)
    : Memory(*this, context, std::move(properties), flags, size, hostPtr, errorCode)
{}
Buffer::Buffer(Buffer &parent, MemFlags flags, size_t offset, size_t size, cl_int &errorCode)
    : Memory(*this, parent, flags, offset, size, errorCode)
{}
}  // namespace cl