2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2020-01-07 22:07:48 +08:00
|
|
|
* Copyright (C) 2017-2020 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-24 01:46:50 +08:00
|
|
|
#include "gmm_helper/gmm_lib.h"
|
|
|
|
#include "helpers/surface_format_info.h"
|
|
|
|
#include "utilities/arrayref.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-01-07 22:07:48 +08:00
|
|
|
#include "CL/cl.h"
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2018-06-21 17:36:47 +08:00
|
|
|
|
2020-01-09 00:29:15 +08:00
|
|
|
struct ClSurfaceFormatInfo {
|
2017-12-21 07:45:38 +08:00
|
|
|
cl_image_format OCLImageFormat;
|
2020-01-09 00:29:15 +08:00
|
|
|
SurfaceFormatInfo surfaceFormat;
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
|
|
|
|
2018-09-11 19:08:29 +08:00
|
|
|
class SurfaceFormats {
|
|
|
|
private:
|
2020-01-10 16:48:09 +08:00
|
|
|
static const ClSurfaceFormatInfo readOnlySurfaceFormats12[];
|
|
|
|
static const ClSurfaceFormatInfo readOnlySurfaceFormats20[];
|
2020-01-09 00:29:15 +08:00
|
|
|
static const ClSurfaceFormatInfo writeOnlySurfaceFormats[];
|
|
|
|
static const ClSurfaceFormatInfo readWriteSurfaceFormats[];
|
|
|
|
static const ClSurfaceFormatInfo readOnlyDepthSurfaceFormats[];
|
|
|
|
static const ClSurfaceFormatInfo readWriteDepthSurfaceFormats[];
|
2020-01-07 22:07:48 +08:00
|
|
|
|
2020-01-09 00:29:15 +08:00
|
|
|
static const ClSurfaceFormatInfo packedYuvSurfaceFormats[];
|
|
|
|
static const ClSurfaceFormatInfo planarYuvSurfaceFormats[];
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-09-11 19:08:29 +08:00
|
|
|
public:
|
2020-01-10 16:48:09 +08:00
|
|
|
static ArrayRef<const ClSurfaceFormatInfo> readOnly12() noexcept;
|
|
|
|
static ArrayRef<const ClSurfaceFormatInfo> readOnly20() noexcept;
|
2020-01-09 00:29:15 +08:00
|
|
|
static ArrayRef<const ClSurfaceFormatInfo> writeOnly() noexcept;
|
|
|
|
static ArrayRef<const ClSurfaceFormatInfo> readWrite() noexcept;
|
|
|
|
static ArrayRef<const ClSurfaceFormatInfo> packedYuv() noexcept;
|
|
|
|
static ArrayRef<const ClSurfaceFormatInfo> planarYuv() noexcept;
|
|
|
|
static ArrayRef<const ClSurfaceFormatInfo> readOnlyDepth() noexcept;
|
|
|
|
static ArrayRef<const ClSurfaceFormatInfo> readWriteDepth() noexcept;
|
|
|
|
|
2020-01-10 16:48:09 +08:00
|
|
|
static ArrayRef<const ClSurfaceFormatInfo> surfaceFormats(cl_mem_flags flags, unsigned int clVersionSupport) noexcept;
|
|
|
|
static ArrayRef<const ClSurfaceFormatInfo> surfaceFormats(cl_mem_flags flags, const cl_image_format *imageFormat, unsigned int clVersionSupport) noexcept;
|
2018-09-11 19:08:29 +08:00
|
|
|
};
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|