diff --git a/runtime/helpers/surface_formats.cpp b/runtime/helpers/surface_formats.cpp index d8c5a393dd..7485403df3 100644 --- a/runtime/helpers/surface_formats.cpp +++ b/runtime/helpers/surface_formats.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -170,7 +170,6 @@ const SurfaceFormatInfo SurfaceFormats::readWriteSurfaceFormats[] = { {{CL_RGBA, CL_SNORM_INT16}, GMM_FORMAT_R16G16B16A16_SNORM_TYPE, GFX3DSTATE_SURFACEFORMAT_R16G16B16A16_SNORM , 0, 4, 2, 8}, }; -#if SUPPORT_YUV const SurfaceFormatInfo SurfaceFormats::packedYuvSurfaceFormats[] = { {{CL_YUYV_INTEL, CL_UNORM_INT8}, GMM_FORMAT_YUY2, GFX3DSTATE_SURFACEFORMAT_YCRCB_NORMAL , 0, 2, 1, 2}, {{CL_UYVY_INTEL, CL_UNORM_INT8}, GMM_FORMAT_UYVY, GFX3DSTATE_SURFACEFORMAT_YCRCB_SWAPY , 0, 2, 1, 2}, @@ -182,8 +181,6 @@ const SurfaceFormatInfo SurfaceFormats::planarYuvSurfaceFormats[] = { {{CL_NV12_INTEL, CL_UNORM_INT8}, GMM_FORMAT_NV12, GFX3DSTATE_SURFACEFORMAT_NV12 , 0, 1, 1, 1} }; -#endif - const SurfaceFormatInfo SurfaceFormats::readOnlyDepthSurfaceFormats[] = { {{ CL_DEPTH, CL_FLOAT}, GMM_FORMAT_R32_FLOAT_TYPE, GFX3DSTATE_SURFACEFORMAT_R32_FLOAT , 0, 1, 4, 4}, {{ CL_DEPTH, CL_UNORM_INT16}, GMM_FORMAT_R16_UNORM_TYPE, GFX3DSTATE_SURFACEFORMAT_R16_UNORM , 0, 1, 2, 2}, @@ -209,19 +206,11 @@ ArrayRef SurfaceFormats::readWrite() noexcept { } ArrayRef SurfaceFormats::packedYuv() noexcept { -#if SUPPORT_YUV return ArrayRef(packedYuvSurfaceFormats); -#else - return ArrayRef(); -#endif } ArrayRef SurfaceFormats::planarYuv() noexcept { -#if SUPPORT_YUV return ArrayRef(planarYuvSurfaceFormats); -#else - return ArrayRef(); -#endif } ArrayRef SurfaceFormats::readOnlyDepth() noexcept { diff --git a/runtime/helpers/surface_formats.h b/runtime/helpers/surface_formats.h index 1afbc4f787..06c91d359d 100644 --- a/runtime/helpers/surface_formats.h +++ b/runtime/helpers/surface_formats.h @@ -1,21 +1,16 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ #pragma once -#include "CL/cl.h" - -#ifndef SUPPORT_YUV -#define SUPPORT_YUV 1 -#include "CL/cl_ext.h" -#endif - #include "core/gmm_helper/gmm_lib.h" #include "core/utilities/arrayref.h" +#include "CL/cl.h" + namespace NEO { enum GFX3DSTATE_SURFACEFORMAT : unsigned short { GFX3DSTATE_SURFACEFORMAT_R32G32B32A32_FLOAT = 0x000, @@ -237,10 +232,9 @@ class SurfaceFormats { static const SurfaceFormatInfo readWriteSurfaceFormats[]; static const SurfaceFormatInfo readOnlyDepthSurfaceFormats[]; static const SurfaceFormatInfo readWriteDepthSurfaceFormats[]; -#ifdef SUPPORT_YUV + static const SurfaceFormatInfo packedYuvSurfaceFormats[]; static const SurfaceFormatInfo planarYuvSurfaceFormats[]; -#endif public: static ArrayRef readOnly() noexcept; diff --git a/runtime/mem_obj/image.cpp b/runtime/mem_obj/image.cpp index e6906d7216..8dfbc8e211 100644 --- a/runtime/mem_obj/image.cpp +++ b/runtime/mem_obj/image.cpp @@ -523,10 +523,9 @@ cl_int Image::validateImageFormat(const cl_image_format *imageFormat) { isValidRGBAFormat(imageFormat) || isValidSRGBFormat(imageFormat) || isValidARGBFormat(imageFormat) || - isValidDepthStencilFormat(imageFormat); -#if SUPPORT_YUV - isValidFormat = isValidFormat || isValidYUVFormat(imageFormat); -#endif + isValidDepthStencilFormat(imageFormat) || + isValidYUVFormat(imageFormat); + if (isValidFormat) { return CL_SUCCESS; }