1 #ifndef _ES3FASTCDECOMPRESSIONCASES_HPP 2 #define _ES3FASTCDECOMPRESSIONCASES_HPP 3 /*------------------------------------------------------------------------- 4 * drawElements Quality Program OpenGL ES 3.0 Module 5 * ------------------------------------------------- 6 * 7 * Copyright 2014 The Android Open Source Project 8 * 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 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 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. 20 * 21 *//*! 22 * \file 23 * \brief ASTC decompression tests 24 *//*--------------------------------------------------------------------*/ 25 26 #include "deDefs.h" 27 #include "tes3TestCase.hpp" 28 #include "tcuCompressedTexture.hpp" 29 #include "tcuAstcUtil.hpp" 30 #include "deUniquePtr.hpp" 31 32 #include <vector> 33 34 namespace deqp 35 { 36 namespace gles3 37 { 38 namespace Functional 39 { 40 41 namespace ASTCDecompressionCaseInternal 42 { 43 44 class ASTCRenderer2D; 45 46 } 47 48 // General ASTC block test class. 49 class ASTCBlockCase2D : public TestCase 50 { 51 public: 52 ASTCBlockCase2D (Context& context, 53 const char* name, 54 const char* description, 55 tcu::astc::BlockTestType testType, 56 tcu::CompressedTexFormat format); 57 ~ASTCBlockCase2D (void); 58 59 void init (void); 60 void deinit (void); 61 IterateResult iterate (void); 62 63 private: 64 ASTCBlockCase2D (const ASTCBlockCase2D& other); 65 ASTCBlockCase2D& operator= (const ASTCBlockCase2D& other); 66 67 const tcu::astc::BlockTestType m_testType; 68 const tcu::CompressedTexFormat m_format; 69 std::vector<deUint8> m_blockData; 70 71 int m_numBlocksTested; 72 int m_currentIteration; 73 74 de::UniquePtr<ASTCDecompressionCaseInternal::ASTCRenderer2D> m_renderer; 75 }; 76 77 // For a format with block size (W, H), test with texture sizes {(k*W + a, k*H + b) | 0 <= a < W, 0 <= b < H } . 78 class ASTCBlockSizeRemainderCase2D : public TestCase 79 { 80 public: 81 ASTCBlockSizeRemainderCase2D (Context& context, 82 const char* name, 83 const char* description, 84 tcu::CompressedTexFormat format); 85 ~ASTCBlockSizeRemainderCase2D (void); 86 87 void init (void); 88 void deinit (void); 89 IterateResult iterate (void); 90 91 private: 92 enum 93 { 94 MAX_NUM_BLOCKS_X = 5, 95 MAX_NUM_BLOCKS_Y = 5 96 }; 97 98 ASTCBlockSizeRemainderCase2D (const ASTCBlockSizeRemainderCase2D& other); 99 ASTCBlockSizeRemainderCase2D& operator= (const ASTCBlockSizeRemainderCase2D& other); 100 101 const tcu::CompressedTexFormat m_format; 102 103 int m_currentIteration; 104 105 de::UniquePtr<ASTCDecompressionCaseInternal::ASTCRenderer2D> m_renderer; 106 }; 107 108 } // Functional 109 } // gles3 110 } // deqp 111 112 #endif // _ES3FASTCDECOMPRESSIONCASES_HPP 113