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

//
// Copyright 2020 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_shader_framebuffer_fetch_test.cpp:
//   Test for EXT_shader_framebuffer_fetch and EXT_shader_framebuffer_fetch_non_coherent
//

#include "tests/test_utils/ShaderExtensionTest.h"

namespace
{
const char EXTPragma[] =;

// Redeclare gl_LastFragData with noncoherent qualifier
const char ESSL100_LastFragDataRedeclared1[] =;

// Use inout variable with noncoherent qualifier
const char ESSL300_InOut[] =;

// Use inout variable with noncoherent qualifier and 3-components vector
const char ESSL300_InOut2[] =;

// Use inout variable with noncoherent qualifier and integer type qualifier
const char ESSL300_InOut3[] =;

// Use inout variable with noncoherent qualifier and unsigned integer type qualifier
const char ESSL300_InOut4[] =;

// Use inout variable with noncoherent qualifier and inout function parameter
const char ESSL300_InOut5[] =;

// Use multiple inout variables with noncoherent qualifier
const char ESSL300_InOut6[] =;

class EXTShaderFramebufferFetchNoncoherentTest : public sh::ShaderExtensionTest
{};

class EXTShaderFramebufferFetchNoncoherentES100Test
    : public EXTShaderFramebufferFetchNoncoherentTest
{};

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

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

class EXTShaderFramebufferFetchNoncoherentES300Test
    : public EXTShaderFramebufferFetchNoncoherentTest
{};

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

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

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

#if defined(ANGLE_ENABLE_VULKAN)

// Use gl_LastFragData without redeclaration of gl_LastFragData with noncoherent qualifier
const char ESSL100_LastFragDataWithoutRedeclaration[] =;

// Redeclare gl_LastFragData without noncoherent qualifier
const char ESSL100_LastFragDataRedeclaredWithoutNoncoherent[] =;

// Use inout variable without noncoherent qualifier
const char ESSL300_InOutWithoutNoncoherent[] =;

class EXTShaderFramebufferFetchNoncoherentSuccessTest
    : public EXTShaderFramebufferFetchNoncoherentTest
{};

class EXTShaderFramebufferFetchNoncoherentFailureTest
    : public EXTShaderFramebufferFetchNoncoherentSuccessTest
{};

class EXTShaderFramebufferFetchNoncoherentES100SuccessTest
    : public EXTShaderFramebufferFetchNoncoherentSuccessTest
{};

class EXTShaderFramebufferFetchNoncoherentES100FailureTest
    : public EXTShaderFramebufferFetchNoncoherentFailureTest
{};

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

//
TEST_P(EXTShaderFramebufferFetchNoncoherentES100FailureTest, CompileFailsWithoutNoncoherent)
{}

class EXTShaderFramebufferFetchNoncoherentES300SuccessTest
    : public EXTShaderFramebufferFetchNoncoherentSuccessTest
{};

class EXTShaderFramebufferFetchNoncoherentES300FailureTest
    : public EXTShaderFramebufferFetchNoncoherentFailureTest
{};

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

//
TEST_P(EXTShaderFramebufferFetchNoncoherentES300FailureTest, CompileFailsWithoutNoncoherent)
{}

// The SL #version 100 shaders that are correct work similarly
// in both GL2 and GL3, with and without the version string.
INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();
#endif

}  // anonymous namespace