1 #ifndef _ES3FASTCDECOMPRESSIONCASES_HPP
2 #define _ES3FASTCDECOMPRESSIONCASES_HPP
3 /*-------------------------------------------------------------------------
4 * drawElements Quality Program OpenGL ES 3.0 Module
5 * -------------------------------------------------
7 * Copyright 2014 The Android Open Source Project
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 * \brief ASTC decompression tests
24 *//*--------------------------------------------------------------------*/
27 #include "tes3TestCase.hpp"
28 #include "tcuCompressedTexture.hpp"
29 #include "deUniquePtr.hpp"
40 namespace ASTCDecompressionCaseInternal
47 enum ASTCBlockTestType
49 ASTCBLOCKTESTTYPE_VOID_EXTENT_LDR = 0,
50 ASTCBLOCKTESTTYPE_VOID_EXTENT_HDR,
51 ASTCBLOCKTESTTYPE_WEIGHT_GRID,
52 ASTCBLOCKTESTTYPE_WEIGHT_ISE,
53 ASTCBLOCKTESTTYPE_CEMS,
54 ASTCBLOCKTESTTYPE_PARTITION_SEED,
55 ASTCBLOCKTESTTYPE_ENDPOINT_VALUE_LDR,
56 ASTCBLOCKTESTTYPE_ENDPOINT_VALUE_HDR_NO_15,
57 ASTCBLOCKTESTTYPE_ENDPOINT_VALUE_HDR_15,
58 ASTCBLOCKTESTTYPE_ENDPOINT_ISE,
59 ASTCBLOCKTESTTYPE_CCS,
60 ASTCBLOCKTESTTYPE_RANDOM,
62 ASTCBLOCKTESTTYPE_LAST
65 // General ASTC block test class.
66 class ASTCBlockCase2D : public TestCase
69 ASTCBlockCase2D (Context& context,
71 const char* description,
72 ASTCBlockTestType testType,
73 tcu::CompressedTexFormat format);
74 ~ASTCBlockCase2D (void);
78 IterateResult iterate (void);
81 static void generateDummyBlocks (deUint8* dst, int num);
83 ASTCBlockCase2D (const ASTCBlockCase2D& other);
84 ASTCBlockCase2D& operator= (const ASTCBlockCase2D& other);
86 const ASTCBlockTestType m_testType;
87 const tcu::CompressedTexFormat m_format;
88 std::vector<deUint8> m_blockData;
90 int m_numBlocksTested;
91 int m_currentIteration;
93 de::UniquePtr<ASTCDecompressionCaseInternal::ASTCRenderer2D> m_renderer;
96 // For a format with block size (W, H), test with texture sizes {(k*W + a, k*H + b) | 0 <= a < W, 0 <= b < H } .
97 class ASTCBlockSizeRemainderCase2D : public TestCase
100 ASTCBlockSizeRemainderCase2D (Context& context,
102 const char* description,
103 tcu::CompressedTexFormat format);
104 ~ASTCBlockSizeRemainderCase2D (void);
108 IterateResult iterate (void);
113 MAX_NUM_BLOCKS_X = 5,
117 static void generateDefaultBlockData (deUint8* dst, int numBlocks, int blockWidth, int blockHeight);
119 ASTCBlockSizeRemainderCase2D (const ASTCBlockSizeRemainderCase2D& other);
120 ASTCBlockSizeRemainderCase2D& operator= (const ASTCBlockSizeRemainderCase2D& other);
122 const tcu::CompressedTexFormat m_format;
124 int m_currentIteration;
126 de::UniquePtr<ASTCDecompressionCaseInternal::ASTCRenderer2D> m_renderer;
129 const char* getBlockTestTypeName (ASTCBlockTestType testType);
130 const char* getBlockTestTypeDescription (ASTCBlockTestType testType);
131 bool isBlockTestTypeHDROnly (ASTCBlockTestType testType);
137 #endif // _ES3FASTCDECOMPRESSIONCASES_HPP