mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Updating files modified in 2018 only. Older files remain with old style copyright header Change-Id: Ic99f2e190ad74b4b7f2bd79dd7b9fa5fbe36ec92 Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
/*
|
|
* Copyright (C) 2018 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "runtime/sharings/gl/gl_sharing.h"
|
|
#include "CL/cl_gl.h"
|
|
|
|
struct _tagCLGLBufferInfo;
|
|
|
|
namespace OCLRT {
|
|
class Buffer;
|
|
class Context;
|
|
|
|
class GlBuffer : public GlSharing {
|
|
public:
|
|
static Buffer *createSharedGlBuffer(Context *context, cl_mem_flags flags, unsigned int bufferId, cl_int *errcodeRet);
|
|
void synchronizeObject(UpdateData &updateData) override;
|
|
void releaseReusedGraphicsAllocation() override;
|
|
|
|
protected:
|
|
GlBuffer(GLSharingFunctions *sharingFunctions, unsigned int glObjectId)
|
|
: GlSharing(sharingFunctions, CL_GL_OBJECT_BUFFER, glObjectId){};
|
|
|
|
void releaseResource(MemObj *memObject) override;
|
|
|
|
void resolveGraphicsAllocationChange(osHandle currentSharedHandle, UpdateData *updateData) override;
|
|
void popGraphicsAllocationFromReuse(GraphicsAllocation *graphicsAllocation);
|
|
|
|
static GraphicsAllocation *createGraphicsAllocation(Context *context, unsigned int bufferId, _tagCLGLBufferInfo &bufferInfo);
|
|
};
|
|
} // namespace OCLRT
|