// // 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. // // AtomicCounter_test.cpp: // Tests for validating ESSL 3.10 section 4.4.6. // #include "gtest/gtest.h" #include "GLSLANG/ShaderLang.h" #include "angle_gl.h" #include "gtest/gtest.h" #include "tests/test_utils/ShaderCompileTreeTest.h" usingnamespacesh; class AtomicCounterTest : public ShaderCompileTreeTest { … }; // Test that layout qualifiers described in ESSL 3.10 section 4.4.6 can be successfully compiled, // and the values of offset are properly assigned to counter variables. TEST_F(AtomicCounterTest, BasicAtomicCounterDeclaration) { … } // Test that ESSL 3.00 doesn't support atomic_uint. TEST_F(AtomicCounterTest, InvalidShaderVersion) { … } // Test that any qualifier other than uniform leads to compile-time error. TEST_F(AtomicCounterTest, InvalidQualifier) { … } // Test that uniform must be specified for declaration. TEST_F(AtomicCounterTest, UniformMustSpecifiedForDeclaration) { … } // Test that offset overlapping leads to compile-time error(ESSL 3.10 section 4.4.6). TEST_F(AtomicCounterTest, BindingOffsetOverlapping) { … } // Test offset inheritance for multiple variables in one same declaration. TEST_F(AtomicCounterTest, MultipleVariablesDeclaration) { … } // Test that subsequent declarations inherit the globally specified offset. TEST_F(AtomicCounterTest, GlobalBindingOffsetOverlapping) { … } // The spec only demands offset unique and non-overlapping. So this should be allowed. TEST_F(AtomicCounterTest, DeclarationSequenceWithDecrementalOffsetsSpecified) { … } // Test that image format qualifiers are not allowed for atomic counters. TEST_F(AtomicCounterTest, ImageFormatMustNotSpecified) { … } // Test that global layout qualifiers must not use 'offset'. TEST_F(AtomicCounterTest, OffsetMustNotSpecifiedForGlobalLayoutQualifier) { … } // Test that offset overlapping leads to compile-time error (ESSL 3.10 section 4.4.6). // Note that there is some vagueness in the spec when it comes to this test. TEST_F(AtomicCounterTest, BindingOffsetOverlappingForArrays) { … }