13c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#ifndef _GLSINTERACTIONTESTUTIL_HPP 23c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#define _GLSINTERACTIONTESTUTIL_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 Interaction test utilities. 243c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/ 253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tcuDefs.hpp" 273c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "glsFragmentOpUtil.hpp" 283c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "gluRenderContext.hpp" 293c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "rrRenderState.hpp" 303c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 313c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace de 323c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{ 333c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass Random; 343c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} 353c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 363c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace deqp 373c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{ 383c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace gls 393c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{ 403c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace InteractionTestUtil 413c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{ 423c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 433c827367444ee418f129b2c238299f49d3264554Jarkko Poyrystruct BlendState 443c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{ 453c827367444ee418f129b2c238299f49d3264554Jarkko Poyry deUint32 equation; 463c827367444ee418f129b2c238299f49d3264554Jarkko Poyry deUint32 srcFunc; 473c827367444ee418f129b2c238299f49d3264554Jarkko Poyry deUint32 dstFunc; 483c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 493c827367444ee418f129b2c238299f49d3264554Jarkko Poyry BlendState (void) 503c827367444ee418f129b2c238299f49d3264554Jarkko Poyry : equation (0) 513c827367444ee418f129b2c238299f49d3264554Jarkko Poyry , srcFunc (0) 523c827367444ee418f129b2c238299f49d3264554Jarkko Poyry , dstFunc (0) 533c827367444ee418f129b2c238299f49d3264554Jarkko Poyry { 543c827367444ee418f129b2c238299f49d3264554Jarkko Poyry } 553c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}; 563c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 573c827367444ee418f129b2c238299f49d3264554Jarkko Poyrystruct StencilState 583c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{ 593c827367444ee418f129b2c238299f49d3264554Jarkko Poyry deUint32 function; 603c827367444ee418f129b2c238299f49d3264554Jarkko Poyry int reference; 613c827367444ee418f129b2c238299f49d3264554Jarkko Poyry deUint32 compareMask; 623c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 633c827367444ee418f129b2c238299f49d3264554Jarkko Poyry deUint32 stencilFailOp; 643c827367444ee418f129b2c238299f49d3264554Jarkko Poyry deUint32 depthFailOp; 653c827367444ee418f129b2c238299f49d3264554Jarkko Poyry deUint32 depthPassOp; 663c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 673c827367444ee418f129b2c238299f49d3264554Jarkko Poyry deUint32 writeMask; 683c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 693c827367444ee418f129b2c238299f49d3264554Jarkko Poyry StencilState (void) 703c827367444ee418f129b2c238299f49d3264554Jarkko Poyry : function (0) 713c827367444ee418f129b2c238299f49d3264554Jarkko Poyry , reference (0) 723c827367444ee418f129b2c238299f49d3264554Jarkko Poyry , compareMask (0) 733c827367444ee418f129b2c238299f49d3264554Jarkko Poyry , stencilFailOp (0) 743c827367444ee418f129b2c238299f49d3264554Jarkko Poyry , depthFailOp (0) 753c827367444ee418f129b2c238299f49d3264554Jarkko Poyry , depthPassOp (0) 763c827367444ee418f129b2c238299f49d3264554Jarkko Poyry , writeMask (0) 773c827367444ee418f129b2c238299f49d3264554Jarkko Poyry { 783c827367444ee418f129b2c238299f49d3264554Jarkko Poyry } 793c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}; 803c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 813c827367444ee418f129b2c238299f49d3264554Jarkko Poyrystruct RenderState 823c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{ 833c827367444ee418f129b2c238299f49d3264554Jarkko Poyry bool scissorTestEnabled; 843c827367444ee418f129b2c238299f49d3264554Jarkko Poyry rr::WindowRectangle scissorRectangle; 853c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 863c827367444ee418f129b2c238299f49d3264554Jarkko Poyry bool stencilTestEnabled; 873c827367444ee418f129b2c238299f49d3264554Jarkko Poyry StencilState stencil[rr::FACETYPE_LAST]; 883c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 893c827367444ee418f129b2c238299f49d3264554Jarkko Poyry bool depthTestEnabled; 903c827367444ee418f129b2c238299f49d3264554Jarkko Poyry deUint32 depthFunc; 913c827367444ee418f129b2c238299f49d3264554Jarkko Poyry bool depthWriteMask; 923c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 933c827367444ee418f129b2c238299f49d3264554Jarkko Poyry bool blendEnabled; 943c827367444ee418f129b2c238299f49d3264554Jarkko Poyry BlendState blendRGBState; 953c827367444ee418f129b2c238299f49d3264554Jarkko Poyry BlendState blendAState; 963c827367444ee418f129b2c238299f49d3264554Jarkko Poyry tcu::Vec4 blendColor; 973c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 983c827367444ee418f129b2c238299f49d3264554Jarkko Poyry bool ditherEnabled; 993c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 1003c827367444ee418f129b2c238299f49d3264554Jarkko Poyry tcu::BVec4 colorMask; 1013c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 1023c827367444ee418f129b2c238299f49d3264554Jarkko Poyry RenderState (void) 1033c827367444ee418f129b2c238299f49d3264554Jarkko Poyry : scissorTestEnabled (false) 1043c827367444ee418f129b2c238299f49d3264554Jarkko Poyry , scissorRectangle (0, 0, 0, 0) 1053c827367444ee418f129b2c238299f49d3264554Jarkko Poyry , stencilTestEnabled (false) 1063c827367444ee418f129b2c238299f49d3264554Jarkko Poyry , depthTestEnabled (false) 1073c827367444ee418f129b2c238299f49d3264554Jarkko Poyry , depthFunc (0) 1083c827367444ee418f129b2c238299f49d3264554Jarkko Poyry , depthWriteMask (false) 1093c827367444ee418f129b2c238299f49d3264554Jarkko Poyry , blendEnabled (false) 1103c827367444ee418f129b2c238299f49d3264554Jarkko Poyry , ditherEnabled (false) 1113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry { 1123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry } 1133c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}; 1143c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 1153c827367444ee418f129b2c238299f49d3264554Jarkko Poyrystruct RenderCommand 1163c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{ 1173c827367444ee418f129b2c238299f49d3264554Jarkko Poyry gls::FragmentOpUtil::IntegerQuad quad; 1183c827367444ee418f129b2c238299f49d3264554Jarkko Poyry RenderState state; 1193c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}; 1203c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 1213c827367444ee418f129b2c238299f49d3264554Jarkko Poyryvoid computeRandomRenderState (de::Random& rnd, RenderState& state, glu::ApiType apiType, int targetWidth, int targetHeight); 1223c827367444ee418f129b2c238299f49d3264554Jarkko Poyryvoid computeRandomQuad (de::Random& rnd, gls::FragmentOpUtil::IntegerQuad& quad, int targetWidth, int targetHeight); 1233c827367444ee418f129b2c238299f49d3264554Jarkko Poyryvoid computeRandomRenderCommands (de::Random& rnd, glu::ApiType apiType, int numCommands, int targetW, int targetH, std::vector<RenderCommand>& dst); 1243c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 1253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // InteractionTestUtil 1263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // gls 1273c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // deqp 1283c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 1293c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#endif // _GLSINTERACTIONTESTUTIL_HPP 130