2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2021-05-16 20:51:16 +02:00
|
|
|
* Copyright (C) 2018-2021 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/gmm_helper/gmm_lib.h"
|
|
|
|
|
#include "shared/source/helpers/surface_format_info.h"
|
|
|
|
|
#include "shared/source/utilities/arrayref.h"
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2020-01-07 15:07:48 +01:00
|
|
|
#include "CL/cl.h"
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2018-06-21 11:36:47 +02:00
|
|
|
|
2020-01-08 17:29:15 +01:00
|
|
|
struct ClSurfaceFormatInfo {
|
2017-12-21 00:45:38 +01:00
|
|
|
cl_image_format OCLImageFormat;
|
2020-01-08 17:29:15 +01:00
|
|
|
SurfaceFormatInfo surfaceFormat;
|
2017-12-21 00:45:38 +01:00
|
|
|
};
|
|
|
|
|
|
2018-09-11 13:08:29 +02:00
|
|
|
class SurfaceFormats {
|
|
|
|
|
private:
|
2020-01-10 09:48:09 +01:00
|
|
|
static const ClSurfaceFormatInfo readOnlySurfaceFormats12[];
|
|
|
|
|
static const ClSurfaceFormatInfo readOnlySurfaceFormats20[];
|
2020-01-08 17:29:15 +01:00
|
|
|
static const ClSurfaceFormatInfo writeOnlySurfaceFormats[];
|
|
|
|
|
static const ClSurfaceFormatInfo readWriteSurfaceFormats[];
|
|
|
|
|
static const ClSurfaceFormatInfo readOnlyDepthSurfaceFormats[];
|
|
|
|
|
static const ClSurfaceFormatInfo readWriteDepthSurfaceFormats[];
|
2020-01-07 15:07:48 +01:00
|
|
|
|
2020-01-08 17:29:15 +01:00
|
|
|
static const ClSurfaceFormatInfo packedYuvSurfaceFormats[];
|
|
|
|
|
static const ClSurfaceFormatInfo planarYuvSurfaceFormats[];
|
2020-09-23 17:01:19 +02:00
|
|
|
static const ClSurfaceFormatInfo packedSurfaceFormats[];
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2018-09-11 13:08:29 +02:00
|
|
|
public:
|
2020-01-10 09:48:09 +01:00
|
|
|
static ArrayRef<const ClSurfaceFormatInfo> readOnly12() noexcept;
|
|
|
|
|
static ArrayRef<const ClSurfaceFormatInfo> readOnly20() noexcept;
|
2020-01-08 17:29:15 +01: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;
|
2020-09-23 17:01:19 +02:00
|
|
|
static ArrayRef<const ClSurfaceFormatInfo> packed() noexcept;
|
2020-01-08 17:29:15 +01:00
|
|
|
static ArrayRef<const ClSurfaceFormatInfo> readOnlyDepth() noexcept;
|
|
|
|
|
static ArrayRef<const ClSurfaceFormatInfo> readWriteDepth() noexcept;
|
|
|
|
|
|
2020-04-30 15:47:43 +02:00
|
|
|
static ArrayRef<const ClSurfaceFormatInfo> surfaceFormats(cl_mem_flags flags, bool supportsOcl20Features) noexcept;
|
|
|
|
|
static ArrayRef<const ClSurfaceFormatInfo> surfaceFormats(cl_mem_flags flags, const cl_image_format *imageFormat, bool supportsOcl20Features) noexcept;
|
2018-09-11 13:08:29 +02:00
|
|
|
};
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|