13c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#ifndef _ES3FASTCDECOMPRESSIONCASES_HPP
23c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#define _ES3FASTCDECOMPRESSIONCASES_HPP
33c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*-------------------------------------------------------------------------
43c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * drawElements Quality Program OpenGL ES 3.0 Module
53c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * -------------------------------------------------
63c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
73c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Copyright 2014 The Android Open Source Project
83c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
93c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Licensed under the Apache License, Version 2.0 (the "License");
103c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * you may not use this file except in compliance with the License.
113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * You may obtain a copy of the License at
123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
133c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *      http://www.apache.org/licenses/LICENSE-2.0
143c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
153c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Unless required by applicable law or agreed to in writing, software
163c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * distributed under the License is distributed on an "AS IS" BASIS,
173c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
183c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * See the License for the specific language governing permissions and
193c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * limitations under the License.
203c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
213c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*!
223c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \file
233c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \brief ASTC decompression tests
243c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/
253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "deDefs.h"
273c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tes3TestCase.hpp"
283c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tcuCompressedTexture.hpp"
29efb83e1354edd463650ad0404b18e9a7efc307e4Pyry Haulos#include "tcuAstcUtil.hpp"
303c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "deUniquePtr.hpp"
313c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
323c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include <vector>
333c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
343c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace deqp
353c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
363c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace gles3
373c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
383c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace Functional
393c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
403c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
413c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace ASTCDecompressionCaseInternal
423c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
433c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
443c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass ASTCRenderer2D;
453c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
463c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}
473c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
483c827367444ee418f129b2c238299f49d3264554Jarkko Poyry// General ASTC block test class.
493c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass ASTCBlockCase2D : public TestCase
503c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
513c827367444ee418f129b2c238299f49d3264554Jarkko Poyrypublic:
52becd5d53015521acf7536ba754de326d8b1da2f3Mika Isojärvi																	ASTCBlockCase2D			(Context&						context,
53becd5d53015521acf7536ba754de326d8b1da2f3Mika Isojärvi																							 const char*					name,
54becd5d53015521acf7536ba754de326d8b1da2f3Mika Isojärvi																							 const char*					description,
55efb83e1354edd463650ad0404b18e9a7efc307e4Pyry Haulos																							 tcu::astc::BlockTestType		testType,
56becd5d53015521acf7536ba754de326d8b1da2f3Mika Isojärvi																							 tcu::CompressedTexFormat		format);
573c827367444ee418f129b2c238299f49d3264554Jarkko Poyry																	~ASTCBlockCase2D		(void);
583c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
593c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	void															init					(void);
603c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	void															deinit					(void);
613c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	IterateResult													iterate					(void);
623c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
633c827367444ee418f129b2c238299f49d3264554Jarkko Poyryprivate:
643c827367444ee418f129b2c238299f49d3264554Jarkko Poyry																	ASTCBlockCase2D			(const ASTCBlockCase2D& other);
653c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	ASTCBlockCase2D&												operator=				(const ASTCBlockCase2D& other);
663c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
67efb83e1354edd463650ad0404b18e9a7efc307e4Pyry Haulos	const tcu::astc::BlockTestType									m_testType;
68becd5d53015521acf7536ba754de326d8b1da2f3Mika Isojärvi	const tcu::CompressedTexFormat									m_format;
693c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	std::vector<deUint8>											m_blockData;
703c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
713c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int																m_numBlocksTested;
723c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int																m_currentIteration;
733c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
743c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	de::UniquePtr<ASTCDecompressionCaseInternal::ASTCRenderer2D>	m_renderer;
753c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
763c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
773c827367444ee418f129b2c238299f49d3264554Jarkko Poyry// For a format with block size (W, H), test with texture sizes {(k*W + a, k*H + b) | 0 <= a < W, 0 <= b < H } .
783c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass ASTCBlockSizeRemainderCase2D : public TestCase
793c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
803c827367444ee418f129b2c238299f49d3264554Jarkko Poyrypublic:
81becd5d53015521acf7536ba754de326d8b1da2f3Mika Isojärvi																	ASTCBlockSizeRemainderCase2D	(Context&						context,
82becd5d53015521acf7536ba754de326d8b1da2f3Mika Isojärvi																									 const char*					name,
83becd5d53015521acf7536ba754de326d8b1da2f3Mika Isojärvi																									 const char*					description,
84becd5d53015521acf7536ba754de326d8b1da2f3Mika Isojärvi																									 tcu::CompressedTexFormat		format);
853c827367444ee418f129b2c238299f49d3264554Jarkko Poyry																	~ASTCBlockSizeRemainderCase2D	(void);
863c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
873c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	void															init							(void);
883c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	void															deinit							(void);
893c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	IterateResult													iterate							(void);
903c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
913c827367444ee418f129b2c238299f49d3264554Jarkko Poyryprivate:
923c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	enum
933c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
943c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		MAX_NUM_BLOCKS_X = 5,
953c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		MAX_NUM_BLOCKS_Y = 5
963c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	};
973c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
983c827367444ee418f129b2c238299f49d3264554Jarkko Poyry																	ASTCBlockSizeRemainderCase2D	(const ASTCBlockSizeRemainderCase2D& other);
993c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	ASTCBlockSizeRemainderCase2D&									operator=						(const ASTCBlockSizeRemainderCase2D& other);
1003c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
101becd5d53015521acf7536ba754de326d8b1da2f3Mika Isojärvi	const tcu::CompressedTexFormat									m_format;
1023c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1033c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int																m_currentIteration;
1043c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1053c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	de::UniquePtr<ASTCDecompressionCaseInternal::ASTCRenderer2D>	m_renderer;
1063c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
1073c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1083c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // Functional
1093c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // gles3
1103c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // deqp
1113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#endif // _ES3FASTCDECOMPRESSIONCASES_HPP
113