chromium/third_party/angle/src/tests/compiler_tests/EXT_YUV_target_test.cpp

//
// Copyright 2017 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// EXT_YUV_target.cpp:
//   Test for EXT_YUV_target implementation.
//

#include "tests/test_utils/ShaderExtensionTest.h"

namespace
{
class EXTYUVTargetTest : public sh::ShaderExtensionTest
{};

const char EXTYTPragma[] =;

const char ESSL300_SimpleShader[] =;

// Shader that samples the texture and writes to FragColor.
const char ESSL300_FragColorShader[] =;

// Shader that samples the texture and swizzle and writes to FragColor.
const char ESSL300_textureSwizzleFragColorShader[] =;

// Shader that specifies yuv layout qualifier multiple times.
const char ESSL300_YUVQualifierMultipleTimesShader[] =;

// Shader that specifies yuv layout qualifier for not output fails to compile.
const char ESSL300_YUVQualifierFailureShader1[] =;

const char ESSL300_YUVQualifierFailureShader2[] =;

// Shader that specifies yuv layout qualifier with location fails to compile.
const char ESSL300_LocationAndYUVFailureShader[] =;

// Shader that specifies yuv layout qualifier with multiple color outputs fails to compile.
const char ESSL300_MultipleColorAndYUVOutputsFailureShader1[] =;

const char ESSL300_MultipleColorAndYUVOutputsFailureShader2[] =;

// Shader that specifies yuv layout qualifier with depth output fails to compile.
const char ESSL300_DepthAndYUVOutputsFailureShader[] =;

// Shader that specifies yuv layout qualifier with multiple outputs fails to compile.
const char ESSL300_MultipleYUVOutputsFailureShader[] =;

// Shader that specifies yuvCscStandartEXT type and associated values.
const char ESSL300_YuvCscStandardEXTShader[] =;

// Shader that specifies yuvCscStandardEXT type constructor fails to compile.
const char ESSL300_YuvCscStandardEXTConstructFailureShader1[] =;

const char ESSL300_YuvCscStandardEXTConstructFailureShader2[] =;

// Shader that specifies yuvCscStandardEXT type conversion fails to compile.
const char ESSL300_YuvCscStandardEXTConversionFailureShader1[] =;

const char ESSL300_YuvCscStandardEXTConversionFailureShader2[] =;

const char ESSL300_YuvCscStandardEXTConversionFailureShader3[] =;

const char ESSL300_YuvCscStandardEXTConversionFailureShader4[] =;

const char ESSL300_YuvCscStandardEXTConversionFailureShader5[] =;

// Shader that specifies yuvCscStandardEXT type qualifiers fails to compile.
const char ESSL300_YuvCscStandardEXTQualifiersFailureShader1[] =;

const char ESSL300_YuvCscStandardEXTQualifiersFailureShader2[] =;

const char ESSL300_YuvCscStandardEXTQualifiersFailureShader3[] =;

// Shader that specifies yuv_to_rgb() and rgb_to_yuv() built-in functions.
const char ESSL300_BuiltInFunctionsShader[] =;

// Shader with nested yuv_to_rgb() and rgb_to_yuv() built-in functions.
const char ESSL300_BuiltInFunctionsNested1Shader[] =;
const char ESSL300_BuiltInFunctionsNested2Shader[] =;
const char ESSL300_BuiltInFunctionsNested3Shader[] =;
const char ESSL300_BuiltInFunctionsNested4Shader[] =;

// Shader with yuv_to_rgb() and rgb_to_yuv() built-in functions with different precision.
const char ESSL300_BuiltInFunctionsPrecisionShader[] =;

const char ESSL300_OverloadRgb2Yuv[] =;

const char ESSL300_OverloadYuv2Rgb[] =;

// Extension flag is required to compile properly. Expect failure when it is
// not present.
TEST_P(EXTYUVTargetTest, CompileFailsWithoutExtension)
{}

// Extension directive is required to compile properly. Expect failure when
// it is not present.
TEST_P(EXTYUVTargetTest, CompileFailsWithExtensionWithoutPragma)
{}

// With extension flag and extension directive, compiling succeeds.
// Also test that the extension directive state is reset correctly.
TEST_P(EXTYUVTargetTest, CompileSucceedsWithExtensionAndPragma)
{}

INSTANTIATE_TEST_SUITE_P();

class EXTYUVTargetCompileSuccessTest : public EXTYUVTargetTest
{};

TEST_P(EXTYUVTargetCompileSuccessTest, CompileSucceeds)
{}

#ifdef ANGLE_ENABLE_VULKAN
// Test that YUV built-in emulation works on Vulkan
TEST_P(EXTYUVTargetCompileSuccessTest, CompileSucceedsWithExtensionAndPragmaOnVulkan)
{}
#endif

INSTANTIATE_TEST_SUITE_P();

class EXTYUVTargetCompileFailureTest : public EXTYUVTargetTest
{};

TEST_P(EXTYUVTargetCompileFailureTest, CompileFails)
{}

INSTANTIATE_TEST_SUITE_P();

class EXTYUVNotEnabledTest : public EXTYUVTargetTest
{};

TEST_P(EXTYUVNotEnabledTest, CanOverloadConversions)
{}

INSTANTIATE_TEST_SUITE_P();

}  // namespace