13c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#ifndef _GLSDRAWTEST_HPP
23c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#define _GLSDRAWTEST_HPP
33c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*-------------------------------------------------------------------------
43c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * drawElements Quality Program OpenGL (ES) 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 Draw tests
243c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/
253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tcuTestCase.hpp"
27ab44fc6da25bb126919615ad2ded101695251161Jarkko Pöyry#include "tcuResultCollector.hpp"
283c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "gluRenderContext.hpp"
293c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
303c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace sglr
313c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
323c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
333c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass ReferenceContextBuffers;
343c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass ReferenceContext;
353c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass Context;
363c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
373c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // sglr
383c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
393c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace deqp
403c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
413c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace gls
423c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
433c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
443c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass AttributePack;
453c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
463c827367444ee418f129b2c238299f49d3264554Jarkko Poyrystruct DrawTestSpec
473c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
483c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	enum Target
493c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
503c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		TARGET_ELEMENT_ARRAY = 0,
513c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		TARGET_ARRAY,
523c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
533c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		TARGET_LAST
543c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	};
553c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
563c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	enum InputType
573c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
583c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		INPUTTYPE_FLOAT = 0,
593c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		INPUTTYPE_FIXED,
603c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		INPUTTYPE_DOUBLE,
613c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
623c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		INPUTTYPE_BYTE,
633c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		INPUTTYPE_SHORT,
643c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
653c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		INPUTTYPE_UNSIGNED_BYTE,
663c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		INPUTTYPE_UNSIGNED_SHORT,
673c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
683c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		INPUTTYPE_INT,
693c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		INPUTTYPE_UNSIGNED_INT,
703c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		INPUTTYPE_HALF,
713c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		INPUTTYPE_UNSIGNED_INT_2_10_10_10,
723c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		INPUTTYPE_INT_2_10_10_10,
733c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
743c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		INPUTTYPE_LAST
753c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	};
763c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
773c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	enum OutputType
783c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
793c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		OUTPUTTYPE_FLOAT = 0,
803c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		OUTPUTTYPE_VEC2,
813c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		OUTPUTTYPE_VEC3,
823c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		OUTPUTTYPE_VEC4,
833c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
843c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		OUTPUTTYPE_INT,
853c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		OUTPUTTYPE_UINT,
863c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
873c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		OUTPUTTYPE_IVEC2,
883c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		OUTPUTTYPE_IVEC3,
893c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		OUTPUTTYPE_IVEC4,
903c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
913c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		OUTPUTTYPE_UVEC2,
923c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		OUTPUTTYPE_UVEC3,
933c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		OUTPUTTYPE_UVEC4,
943c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
953c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		OUTPUTTYPE_LAST
963c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	};
973c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
983c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	enum Usage
993c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
1003c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		USAGE_DYNAMIC_DRAW = 0,
1013c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		USAGE_STATIC_DRAW,
1023c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		USAGE_STREAM_DRAW,
1033c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1043c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		USAGE_STREAM_READ,
1053c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		USAGE_STREAM_COPY,
1063c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1073c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		USAGE_STATIC_READ,
1083c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		USAGE_STATIC_COPY,
1093c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1103c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		USAGE_DYNAMIC_READ,
1113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		USAGE_DYNAMIC_COPY,
1123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1133c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		USAGE_LAST
1143c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	};
1153c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1163c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	enum Storage
1173c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
1183c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		STORAGE_USER = 0,
1193c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		STORAGE_BUFFER,
1203c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1213c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		STORAGE_LAST
1223c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	};
1233c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1243c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	enum Primitive
1253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
1263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		PRIMITIVE_POINTS = 0,
1273c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		PRIMITIVE_TRIANGLES,
1283c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		PRIMITIVE_TRIANGLE_FAN,
1293c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		PRIMITIVE_TRIANGLE_STRIP,
1303c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		PRIMITIVE_LINES,
1313c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		PRIMITIVE_LINE_STRIP,
1323c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		PRIMITIVE_LINE_LOOP,
1333c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1343c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		PRIMITIVE_LINES_ADJACENCY,
1353c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		PRIMITIVE_LINE_STRIP_ADJACENCY,
1363c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		PRIMITIVE_TRIANGLES_ADJACENCY,
1373c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		PRIMITIVE_TRIANGLE_STRIP_ADJACENCY,
1383c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1393c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		PRIMITIVE_LAST
1403c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	};
1413c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1423c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	enum IndexType
1433c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
1443c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		INDEXTYPE_BYTE = 0,
1453c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		INDEXTYPE_SHORT,
1463c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		INDEXTYPE_INT,
1473c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1483c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		INDEXTYPE_LAST
1493c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	};
1503c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1513c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	enum DrawMethod
1523c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
1533c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		DRAWMETHOD_DRAWARRAYS = 0,
1543c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		DRAWMETHOD_DRAWARRAYS_INSTANCED,
1553c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		DRAWMETHOD_DRAWARRAYS_INDIRECT,
1563c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		DRAWMETHOD_DRAWELEMENTS,
1573c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		DRAWMETHOD_DRAWELEMENTS_RANGED,
1583c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		DRAWMETHOD_DRAWELEMENTS_INSTANCED,
1593c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		DRAWMETHOD_DRAWELEMENTS_INDIRECT,
1603c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		DRAWMETHOD_DRAWELEMENTS_BASEVERTEX,
1613c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		DRAWMETHOD_DRAWELEMENTS_INSTANCED_BASEVERTEX,
1623c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		DRAWMETHOD_DRAWELEMENTS_RANGED_BASEVERTEX,
1633c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1643c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		DRAWMETHOD_LAST
1653c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	};
1663c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1673c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	enum CompatibilityTestType
1683c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
1693c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		COMPATIBILITY_NONE = 0,
1703c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		COMPATIBILITY_UNALIGNED_OFFSET,
1713c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		COMPATIBILITY_UNALIGNED_STRIDE,
1723c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1733c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		COMPATIBILITY_LAST
1743c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	};
1753c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1763c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	static std::string			targetToString		(Target target);
1773c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	static std::string			inputTypeToString	(InputType type);
1783c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	static std::string			outputTypeToString	(OutputType type);
1793c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	static std::string			usageTypeToString	(Usage usage);
1803c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	static std::string			storageToString		(Storage storage);
1813c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	static std::string			primitiveToString	(Primitive primitive);
1823c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	static std::string			indexTypeToString	(IndexType type);
1833c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	static std::string			drawMethodToString	(DrawMethod method);
1843c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	static int					inputTypeSize		(InputType type);
1853c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	static int					indexTypeSize		(IndexType type);
1863c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1873c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	struct AttributeSpec
1883c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
1893c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		static AttributeSpec	createAttributeArray	(InputType inputType, OutputType outputType, Storage storage, Usage usage, int componentCount, int offset, int stride, bool normalize, int instanceDivisor);
1903c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		static AttributeSpec	createDefaultAttribute	(InputType inputType, OutputType outputType, int componentCount);	//!< allowed inputType values: INPUTTYPE_INT, INPUTTYPE_UNSIGNED_INT, INPUTTYPE_FLOAT
1913c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1923c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		InputType				inputType;
1933c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		OutputType				outputType;
1943c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		Storage					storage;
1953c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		Usage					usage;
196a15e7d7f566d93c76ca90171eb728e3d1cd82378Pyry Haulos		int						componentCount;
1973c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		int						offset;
1983c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		int						stride;
1993c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		bool					normalize;
2003c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		int						instanceDivisor;				//!< used only if drawMethod = Draw*Instanced
2013c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		bool					useDefaultAttribute;
2023c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2033c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		bool					additionalPositionAttribute;	//!< treat this attribute as position attribute. Attribute at index 0 is alway treated as such. False by default
2043c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		bool					bgraComponentOrder;				//!< component order of this attribute is bgra, valid only for 4-component targets. False by default.
2053c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2063c827367444ee418f129b2c238299f49d3264554Jarkko Poyry								AttributeSpec			(void);
2073c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2083c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		int						hash					(void) const;
2093c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		bool					valid					(glu::ApiType apiType) const;
2103c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		bool					isBufferAligned			(void) const;
2113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		bool					isBufferStrideAligned	(void) const;
2123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	};
2133c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
214a15e7d7f566d93c76ca90171eb728e3d1cd82378Pyry Haulos	std::string					getName				(void) const;
2153c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	std::string					getDesc				(void) const;
2163c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	std::string					getMultilineDesc	(void) const;
2173c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2183c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	glu::ApiType				apiType;			//!< needed in spec validation
2193c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	Primitive					primitive;
2203c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int							primitiveCount;		//!< number of primitives to draw (per instance)
2213c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2223c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	DrawMethod					drawMethod;
2233c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	IndexType					indexType;			//!< used only if drawMethod = DrawElements*
2243c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int							indexPointerOffset;	//!< used only if drawMethod = DrawElements*
2253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	Storage						indexStorage;		//!< used only if drawMethod = DrawElements*
2263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int							first;				//!< used only if drawMethod = DrawArrays*
2273c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int							indexMin;			//!< used only if drawMethod = Draw*Ranged
2283c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int							indexMax;			//!< used only if drawMethod = Draw*Ranged
2293c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int							instanceCount;		//!< used only if drawMethod = Draw*Instanced or Draw*Indirect
2303c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int							indirectOffset;		//!< used only if drawMethod = Draw*Indirect
2313c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int							baseVertex;			//!< used only if drawMethod = DrawElementsIndirect or *BaseVertex
2323c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2333c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	std::vector<AttributeSpec>	attribs;
2343c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2353c827367444ee418f129b2c238299f49d3264554Jarkko Poyry								DrawTestSpec		(void);
2363c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2373c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int							hash				(void) const;
2383c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	bool						valid				(void) const;
2393c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	CompatibilityTestType		isCompatibilityTest	(void) const;
2403c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
2413c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2423c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass DrawTest : public tcu::TestCase
2433c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
2443c827367444ee418f129b2c238299f49d3264554Jarkko Poyrypublic:
2453c827367444ee418f129b2c238299f49d3264554Jarkko Poyry									DrawTest				(tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const DrawTestSpec& spec, const char* name, const char* desc);
2463c827367444ee418f129b2c238299f49d3264554Jarkko Poyry									DrawTest				(tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const char* name, const char* desc);
2473c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	virtual							~DrawTest				(void);
2483c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2493c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	void							addIteration			(const DrawTestSpec& spec, const char* description = DE_NULL);
2503c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2513c827367444ee418f129b2c238299f49d3264554Jarkko Poyryprivate:
2523c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	void							init					(void);
2533c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	void							deinit					(void);
2543c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	IterateResult					iterate					(void);
2553c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2563c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	bool							compare					(gls::DrawTestSpec::Primitive primitiveType);
2573c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	float							getCoordScale			(const DrawTestSpec& spec) const;
2583c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	float							getColorScale			(const DrawTestSpec& spec) const;
2593c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2603c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	glu::RenderContext&				m_renderCtx;
2613c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2623c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	sglr::ReferenceContextBuffers*	m_refBuffers;
2633c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	sglr::ReferenceContext*			m_refContext;
2643c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	sglr::Context*					m_glesContext;
2653c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2663c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	AttributePack*					m_glArrayPack;
2673c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	AttributePack*					m_rrArrayPack;
2683c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2693c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int								m_maxDiffRed;
2703c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int								m_maxDiffGreen;
2713c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int								m_maxDiffBlue;
2723c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2733c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	std::vector<DrawTestSpec>		m_specs;
2743c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	std::vector<std::string>		m_iteration_descriptions;
2753c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int								m_iteration;
2763c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	tcu::ResultCollector			m_result;
2773c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
2783c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2793c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // gls
2803c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // deqp
2813c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2823c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#endif // _GLSDRAWTEST_HPP
283