13c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#ifndef _ES31FPROGRAMINTERFACEDEFINITION_HPP 23c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#define _ES31FPROGRAMINTERFACEDEFINITION_HPP 33c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*------------------------------------------------------------------------- 43c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * drawElements Quality Program OpenGL ES 3.1 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 Program interface 243c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/ 253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tcuDefs.hpp" 273c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tes31TestCase.hpp" 283c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "gluShaderUtil.hpp" 293c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "gluVarType.hpp" 303c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 313c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace deqp 323c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{ 333c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace gles31 343c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{ 353c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace Functional 363c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{ 373c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 383c827367444ee418f129b2c238299f49d3264554Jarkko Poyryenum ProgramInterface 393c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{ 403c827367444ee418f129b2c238299f49d3264554Jarkko Poyry PROGRAMINTERFACE_UNIFORM = 0, 413c827367444ee418f129b2c238299f49d3264554Jarkko Poyry PROGRAMINTERFACE_UNIFORM_BLOCK, 423c827367444ee418f129b2c238299f49d3264554Jarkko Poyry PROGRAMINTERFACE_ATOMIC_COUNTER_BUFFER, 433c827367444ee418f129b2c238299f49d3264554Jarkko Poyry PROGRAMINTERFACE_PROGRAM_INPUT, 443c827367444ee418f129b2c238299f49d3264554Jarkko Poyry PROGRAMINTERFACE_PROGRAM_OUTPUT, 453c827367444ee418f129b2c238299f49d3264554Jarkko Poyry PROGRAMINTERFACE_TRANSFORM_FEEDBACK_VARYING, 463c827367444ee418f129b2c238299f49d3264554Jarkko Poyry PROGRAMINTERFACE_BUFFER_VARIABLE, 473c827367444ee418f129b2c238299f49d3264554Jarkko Poyry PROGRAMINTERFACE_SHADER_STORAGE_BLOCK, 483c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 493c827367444ee418f129b2c238299f49d3264554Jarkko Poyry PROGRAMINTERFACE_LAST 503c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}; 513c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 523c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace ProgramInterfaceDefinition 533c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{ 543c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 553c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass Program; 563c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 573c827367444ee418f129b2c238299f49d3264554Jarkko Poyrystruct DefaultBlock 583c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{ 593c827367444ee418f129b2c238299f49d3264554Jarkko Poyry std::vector<glu::VariableDeclaration> variables; 603c827367444ee418f129b2c238299f49d3264554Jarkko Poyry std::vector<glu::InterfaceBlock> interfaceBlocks; 613c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}; 623c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 633c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass Shader 643c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{ 653c827367444ee418f129b2c238299f49d3264554Jarkko Poyrypublic: 663c827367444ee418f129b2c238299f49d3264554Jarkko Poyry glu::ShaderType getType (void) const { return m_shaderType; } 673c827367444ee418f129b2c238299f49d3264554Jarkko Poyry glu::GLSLVersion getVersion (void) const { return m_version; } 683c827367444ee418f129b2c238299f49d3264554Jarkko Poyry bool isValid (void) const; 693c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 703c827367444ee418f129b2c238299f49d3264554Jarkko Poyry DefaultBlock& getDefaultBlock (void) { return m_defaultBlock; } 713c827367444ee418f129b2c238299f49d3264554Jarkko Poyry const DefaultBlock& getDefaultBlock (void) const { return m_defaultBlock; } 723c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 733c827367444ee418f129b2c238299f49d3264554Jarkko Poyryprivate: 743c827367444ee418f129b2c238299f49d3264554Jarkko Poyry Shader (glu::ShaderType type, glu::GLSLVersion version); 753c827367444ee418f129b2c238299f49d3264554Jarkko Poyry ~Shader (void); 763c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 773c827367444ee418f129b2c238299f49d3264554Jarkko Poyry Shader (const Shader&); 783c827367444ee418f129b2c238299f49d3264554Jarkko Poyry Shader& operator= (const Shader&); 793c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 803c827367444ee418f129b2c238299f49d3264554Jarkko Poyry const glu::ShaderType m_shaderType; 813c827367444ee418f129b2c238299f49d3264554Jarkko Poyry const glu::GLSLVersion m_version; 823c827367444ee418f129b2c238299f49d3264554Jarkko Poyry DefaultBlock m_defaultBlock; 833c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 843c827367444ee418f129b2c238299f49d3264554Jarkko Poyry friend class Program; 853c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}; 863c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 873c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass Program 883c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{ 893c827367444ee418f129b2c238299f49d3264554Jarkko Poyrypublic: 90c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry Program (void); 91c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry ~Program (void); 923c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 93c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry Shader* addShader (glu::ShaderType type, glu::GLSLVersion version); 943c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 95c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry void setSeparable (bool separable); 96c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry bool isSeparable (void) const; 973c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 98c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry const std::vector<Shader*>& getShaders (void) const; 99c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry glu::ShaderType getFirstStage (void) const; 100c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry glu::ShaderType getLastStage (void) const; 101c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry bool hasStage (glu::ShaderType stage) const; 1023c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 103c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry void addTransformFeedbackVarying (const std::string& varName); 104c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry const std::vector<std::string>& getTransformFeedbackVaryings (void) const; 105c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry void setTransformFeedbackMode (deUint32 mode); 106c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry deUint32 getTransformFeedbackMode (void) const; 1073c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 108c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry deUint32 getGeometryNumOutputVertices (void) const; 109c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry void setGeometryNumOutputVertices (deUint32); 110c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry deUint32 getTessellationNumOutputPatchVertices (void) const; 111c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry void setTessellationNumOutputPatchVertices (deUint32); 112c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry 113c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry bool isValid (void) const; 1143c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 1153c827367444ee418f129b2c238299f49d3264554Jarkko Poyryprivate: 116c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry Program& operator= (const Program&); 117c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry Program (const Program&); 1183c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 1193c827367444ee418f129b2c238299f49d3264554Jarkko Poyry bool m_separable; 1203c827367444ee418f129b2c238299f49d3264554Jarkko Poyry std::vector<Shader*> m_shaders; 1213c827367444ee418f129b2c238299f49d3264554Jarkko Poyry std::vector<std::string> m_xfbVaryings; 1223c827367444ee418f129b2c238299f49d3264554Jarkko Poyry deUint32 m_xfbMode; 123c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry deUint32 m_geoNumOutputVertices; 124c423ce6164cdd88c8c3e47bec4ec34476743042aJarkko Pöyry deUint32 m_tessNumOutputVertices; 1253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}; 1263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 1273c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // ProgramInterfaceDefinition 1283c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 1293c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // Functional 1303c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // gles31 1313c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // deqp 1323c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 1333c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#endif // _ES31FPROGRAMINTERFACEDEFINITION_HPP 134