1 #ifndef _TCUASTCUTIL_HPP
2 #define _TCUASTCUTIL_HPP
3 /*-------------------------------------------------------------------------
4 * drawElements Quality Program Tester Core
5 * ----------------------------------------
7 * Copyright 2016 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 Utilities.
24 *//*--------------------------------------------------------------------*/
26 #include "tcuDefs.hpp"
27 #include "tcuCompressedTexture.hpp"
38 BLOCK_TEST_TYPE_VOID_EXTENT_LDR = 0,
39 BLOCK_TEST_TYPE_VOID_EXTENT_HDR,
40 BLOCK_TEST_TYPE_WEIGHT_GRID,
41 BLOCK_TEST_TYPE_WEIGHT_ISE,
43 BLOCK_TEST_TYPE_PARTITION_SEED,
44 BLOCK_TEST_TYPE_ENDPOINT_VALUE_LDR,
45 BLOCK_TEST_TYPE_ENDPOINT_VALUE_HDR_NO_15,
46 BLOCK_TEST_TYPE_ENDPOINT_VALUE_HDR_15,
47 BLOCK_TEST_TYPE_ENDPOINT_ISE,
49 BLOCK_TEST_TYPE_RANDOM,
56 BLOCK_SIZE_BYTES = 128/8,
59 const char* getBlockTestTypeName (BlockTestType testType);
60 const char* getBlockTestTypeDescription (BlockTestType testType);
61 bool isBlockTestTypeHDROnly (BlockTestType testType);
62 Vec4 getBlockTestTypeColorScale (BlockTestType testType);
63 Vec4 getBlockTestTypeColorBias (BlockTestType testType);
65 void generateBlockCaseTestData (std::vector<deUint8>& dst, CompressedTexFormat format, BlockTestType testType);
67 void generateRandomBlocks (deUint8* dst, size_t numBlocks, CompressedTexFormat format, deUint32 seed);
68 void generateRandomValidBlocks (deUint8* dst, size_t numBlocks, CompressedTexFormat format, TexDecompressionParams::AstcMode mode, deUint32 seed);
70 void generateDummyVoidExtentBlocks (deUint8* dst, size_t numBlocks);
71 void generateDummyNormalBlocks (deUint8* dst, size_t numBlocks, int blockWidth, int blockHeight);
73 bool isValidBlock (const deUint8* data, CompressedTexFormat format, TexDecompressionParams::AstcMode mode);
75 void decompress (const PixelBufferAccess& dst, const deUint8* data, CompressedTexFormat format, TexDecompressionParams::AstcMode mode);
80 #endif // _TCUASTCUTIL_HPP