// // Copyright 2018 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. // // BPTCCompressedTextureTest.cpp: Tests of the GL_EXT_texture_compression_bptc extension #include "test_utils/ANGLETest.h" #include "test_utils/gl_raii.h" usingnamespaceangle; namespace { const unsigned int kPixelTolerance = …; // The pixel data represents a 4x4 pixel image with the left side colored red and the right side // green. It was BC7 encoded using Microsoft's BC6HBC7Encoder. const std::array<GLubyte, 16> kBC7Data4x4 = …; // The pixel data represents a 4x4 pixel image with the transparent black solid color. // Sampling from a zero-filled block is undefined, so use a valid one. const std::array<GLubyte, 16> kBC7BlackData4x4 = …; } // anonymous namespace class BPTCCompressedTextureTest : public ANGLETest<> { … }; class BPTCCompressedTextureTestES3 : public BPTCCompressedTextureTest { … }; // Test sampling from a BC7 non-SRGB image. TEST_P(BPTCCompressedTextureTest, CompressedTexImageBC7) { … } // Test sampling from a BC7 SRGB image. TEST_P(BPTCCompressedTextureTest, CompressedTexImageBC7SRGB) { … } // Test that using the BC6H floating point formats doesn't crash. TEST_P(BPTCCompressedTextureTest, CompressedTexImageBC6HNoCrash) { … } // Test texStorage2D with a BPTC format. TEST_P(BPTCCompressedTextureTestES3, CompressedTexStorage) { … } // Test validation of glCompressedTexSubImage2D with BPTC formats TEST_P(BPTCCompressedTextureTest, CompressedTexSubImageValidation) { … } // Test that copying BPTC textures is not allowed. This restriction exists only in // EXT_texture_compression_bptc, and not in the ARB variant. TEST_P(BPTCCompressedTextureTest, CopyTexImage2DDisallowed) { … } // Test that copying BPTC textures is not allowed. This restriction exists only in // EXT_texture_compression_bptc, and not in the ARB variant. TEST_P(BPTCCompressedTextureTest, CopyTexSubImage2DDisallowed) { … } // Test that copying BPTC textures is not allowed. This restriction exists only in // EXT_texture_compression_bptc, and not in the ARB variant. TEST_P(BPTCCompressedTextureTestES3, CopyTexSubImage3DDisallowed) { … } // Test uploading texture data from a PBO to a texture. TEST_P(BPTCCompressedTextureTestES3, PBOCompressedTexImage) { … } // Test uploading texture data from a PBO to a non-zero base texture. TEST_P(BPTCCompressedTextureTestES3, PBOCompressedTexImageNonZeroBase) { … } // Test uploading texture data from a PBO to a texture allocated with texStorage2D. TEST_P(BPTCCompressedTextureTestES3, PBOCompressedTexStorage) { … } // Test validation of glCompressedTexSubImage3D with BPTC formats TEST_P(BPTCCompressedTextureTestES3, CompressedTexSubImage3DValidation) { … } // 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(…); GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(…); ANGLE_INSTANTIATE_TEST_ES3(…);