// // Copyright 2015 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. // // RecordConstantPrecision_test.cpp: // Test for recording constant variable precision when it affects consuming expression. // #include "GLSLANG/ShaderLang.h" #include "angle_gl.h" #include "gtest/gtest.h" #include "tests/test_utils/compiler_test.h" usingnamespacesh; class RecordConstantPrecisionTest : public MatchOutputCodeTest { … }; // The constant's precision must be specified if its precision is higher than the other operands, // since it increases the precision of the consuming expression. TEST_F(RecordConstantPrecisionTest, HigherPrecisionConstantAsParameter) { … } // The constant's precision does not need to be specified if its precision is equal to the other // operands, as it does not increase the precision of the consuming expression. For simplicity // however, the constant's precision is specified anyway. TEST_F(RecordConstantPrecisionTest, EqualPrecisionConstantAsParameter) { … } // The constant's precision must be specified if its precision is higher than the other operands, // since it increases the precision of the consuming expression. This applies also when the // constant is part of a constant expression that can be folded. TEST_F(RecordConstantPrecisionTest, FoldedBinaryConstantPrecisionIsHigher) { … } // The constant's precision must be specified if its precision is higher than the other operands, // since it increases the precision of the consuming expression. This applies also when the // constant is part of a constant expression that can be folded. TEST_F(RecordConstantPrecisionTest, FoldedUnaryConstantPrecisionIsHigher) { … } // The constant's precision must be specified if its precision is higher than the other operands, // since it increases the precision of the consuming expression. This applies also when the // constant is part of a constructor expression. Note that lowp constants never need their // precision specified. TEST_F(RecordConstantPrecisionTest, HigherPrecisionConstantInConstructor) { … } // The constant's precision does not need to be specified if its used to initialize a variable. TEST_F(RecordConstantPrecisionTest, HigherPrecisionConstantInAssignment) { … } // The constant's precision does not need to be specified if its used as an index. TEST_F(RecordConstantPrecisionTest, HigherPrecisionConstantInIndex) { … }