// // 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. // #include "test_utils/ANGLETest.h" #include <stdint.h> #include <memory> #include "common/string_utils.h" #include "test_utils/angle_test_configs.h" #include "test_utils/gl_raii.h" #include "util/EGLWindow.h" #include "util/OSWindow.h" usingnamespaceangle; class ProgramBinaryTest : public ANGLETest<> { … }; // This tests the assumption that float attribs of different size // should not internally cause a vertex shader recompile (for conversion). TEST_P(ProgramBinaryTest, FloatDynamicShaderSize) { … } // Tests that switching between signed and unsigned un-normalized data doesn't trigger a bug // in the D3D11 back-end. TEST_P(ProgramBinaryTest, DynamicShadersSignatureBug) { … } // This tests the ability to successfully save and load a program binary. TEST_P(ProgramBinaryTest, SaveAndLoadBinary) { … } // This tests the ability to successfully save and load a program binary and then // save and load from the same program that was loaded. TEST_P(ProgramBinaryTest, SaveAndLoadBinaryTwice) { … } // Ensures that we init the compiler before calling ProgramBinary. TEST_P(ProgramBinaryTest, CallProgramBinaryBeforeLink) { … } // Test that unlinked programs have a binary size of 0 TEST_P(ProgramBinaryTest, ZeroSizedUnlinkedBinary) { … } // Use this to select which configurations (e.g. which renderer, which GLES major version) these // tests should be run against. ANGLE_INSTANTIATE_TEST_ES2_AND_ES3_AND(…); class ProgramBinaryES3Test : public ProgramBinaryTest { … }; class ProgramBinaryES31Test : public ANGLETest<> { … }; void ProgramBinaryES3Test::testBinaryAndUBOBlockIndexes(bool drawWithProgramFirst) { … } // Tests that saving and loading a program perserves uniform block binding info. TEST_P(ProgramBinaryES3Test, UniformBlockBindingWithDraw) { … } // Same as UniformBlockBindingWithDraw, but does not do an initial draw with the program. Covers an // ANGLE crash. http://anglebug.com/42260591 TEST_P(ProgramBinaryES3Test, UniformBlockBindingNoDraw) { … } // Same as UniformBlockBindingWithDraw, but specifies the binding in the shader itself. TEST_P(ProgramBinaryES31Test, UniformBlockBindingSpecifiedInShader) { … } // Ensure that uniform block bindings are reset to their original value on program binary TEST_P(ProgramBinaryES31Test, UniformBlockBindingResetOnReload) { … } // Test the shaders with arrays-of-struct uniforms are properly saved and restored TEST_P(ProgramBinaryES3Test, TestArrayOfStructUniform) { … } // Verify that saving/loading binary with detached shaders followed by indexed // drawing works. TEST_P(ProgramBinaryES3Test, SaveAndLoadDetachedShaders) { … } // Tests the difference between uniform static and active use TEST_P(ProgramBinaryES3Test, ActiveUniformShader) { … } // Test that uses many uniforms in the shaders TEST_P(ProgramBinaryES3Test, BinaryWithLargeUniformCount) { … } // Test that sampler texelFetch references are saved and loaded correctly TEST_P(ProgramBinaryTest, SRGBDecodeWithSamplerAndTexelFetchTest) { … } // Test that array of structs containing array of samplers work as expected. TEST_P(ProgramBinaryES3Test, ArrayOfStructContainingArrayOfSamplers) { … } GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(…); ANGLE_INSTANTIATE_TEST_ES3(…); // Tests that saving and loading a program attached with computer shader. TEST_P(ProgramBinaryES31Test, ProgramBinaryWithComputeShader) { … } // Tests saving and loading a separable program that has a computer shader using a uniform and a // uniform block. TEST_P(ProgramBinaryES31Test, SeparableProgramLinkedUniforms) { … } // Tests that saving and loading a program attached with computer shader. TEST_P(ProgramBinaryES31Test, ProgramBinaryWithAtomicCounterComputeShader) { … } // Tests that image texture works correctly when loading a program from binary. TEST_P(ProgramBinaryES31Test, ImageTextureBinding) { … } GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(…); ANGLE_INSTANTIATE_TEST_ES31(…); class ProgramBinaryTransformFeedbackTest : public ANGLETest<> { … }; // This tests the assumption that float attribs of different size // should not internally cause a vertex shader recompile (for conversion). TEST_P(ProgramBinaryTransformFeedbackTest, GetTransformFeedbackVarying) { … } GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(…); ANGLE_INSTANTIATE_TEST_ES3(…); // For the ProgramBinariesAcrossPlatforms tests, we need two sets of params: // - a set to save the program binary // - a set to load the program binary // We combine these into one struct extending PlatformParameters so we can reuse existing ANGLE test // macros struct PlatformsWithLinkResult : PlatformParameters { … }; // Provide a custom gtest parameter name function for PlatformsWithLinkResult // to avoid returning the same parameter name twice. Such a conflict would happen // between ES2_D3D11_to_ES2D3D11 and ES2_D3D11_to_ES3D3D11 as they were both // named ES2_D3D11 std::ostream &operator<<(std::ostream &stream, const PlatformsWithLinkResult &platform) { … } class ProgramBinariesAcrossPlatforms : public testing::TestWithParam<PlatformsWithLinkResult> { … }; // Tries to create a program binary using one set of platform params, then load it using a different // sent of params TEST_P(ProgramBinariesAcrossPlatforms, CreateAndReloadBinary) { … } // clang-format off GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(…); ANGLE_INSTANTIATE_TEST(…); // clang-format on