Debian Codegraph @

opencl/source/sharings/gl/gl_cl_image_format.cpp

raw
1 /*
2 * Copyright (C) 2018-2020 Intel Corporation
3 *
4 * SPDX-License-Identifier: MIT
5 *
6 */
7
8 #include "opencl/extensions/public/cl_gl_private_intel.h"
9 #include "opencl/source/sharings/gl/gl_sharing.h"
10 #include "opencl/source/sharings/gl/gl_texture.h"
11
12 #include "GL/gl.h"
13 #include "config.h"
14
15 namespace NEO {
16 bool GlTexture::setClImageFormat(int glFormat, cl_image_format &clImgFormat) {
17 auto clFormat = GlSharing::glToCLFormats.find(static_cast<GLenum>(glFormat));
18
19 if (clFormat != GlSharing::glToCLFormats.end()) {
20 clImgFormat.image_channel_data_type = clFormat->second.image_channel_data_type;
21 clImgFormat.image_channel_order = clFormat->second.image_channel_order;
22 return true;
23 }
24 return false;
25 }
26 } // namespace NEO