Files
compute-runtime/opencl/source/sharings/gl/gl_cl_image_format.cpp
Maciej Dziuban 24cee4611d Remove gl sharing related code from os_interface
Change-Id: Iece2fbdadefe338384f8961eef2720ff9b381e23
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
2020-04-01 08:02:21 +02:00

27 lines
756 B
C++

/*
* Copyright (C) 2018-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "opencl/extensions/public/cl_gl_private_intel.h"
#include "opencl/source/sharings/gl/gl_sharing.h"
#include "opencl/source/sharings/gl/gl_texture.h"
#include "GL/gl.h"
#include "config.h"
namespace NEO {
bool GlTexture::setClImageFormat(int glFormat, cl_image_format &clImgFormat) {
auto clFormat = GlSharing::glToCLFormats.find(static_cast<GLenum>(glFormat));
if (clFormat != GlSharing::glToCLFormats.end()) {
clImgFormat.image_channel_data_type = clFormat->second.image_channel_data_type;
clImgFormat.image_channel_order = clFormat->second.image_channel_order;
return true;
}
return false;
}
} // namespace NEO