Home | History | Annotate | Download | only in gl
      1 #ifndef _GL4CINDIRECTPARAMETERSTESTS_HPP
      2 #define _GL4CINDIRECTPARAMETERSTESTS_HPP
      3 /*-------------------------------------------------------------------------
      4  * OpenGL Conformance Test Suite
      5  * -----------------------------
      6  *
      7  * Copyright (c) 2017 The Khronos Group Inc.
      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
     24  */ /*-------------------------------------------------------------------*/
     25 
     26 /**
     27  */ /*!
     28  * \file  gl4cIndirectParametersTests.hpp
     29  * \brief Conformance tests for the GL_ARB_indirect_parameters functionality.
     30  */ /*-------------------------------------------------------------------*/
     31 
     32 #include "glcTestCase.hpp"
     33 #include "glwDefs.hpp"
     34 #include "tcuDefs.hpp"
     35 
     36 using namespace glw;
     37 using namespace glu;
     38 
     39 namespace gl4cts
     40 {
     41 
     42 typedef struct
     43 {
     44 	GLuint count;
     45 	GLuint instanceCount;
     46 	GLuint first;
     47 	GLuint baseInstance;
     48 } DrawArraysIndirectCommand;
     49 
     50 typedef struct
     51 {
     52 	GLuint count;
     53 	GLuint instanceCount;
     54 	GLuint firstIndex;
     55 	GLuint baseVertex;
     56 	GLuint baseInstance;
     57 } DrawElementsIndirectCommand;
     58 
     59 /** Test verifies if operations on new buffer object PARAMETER_BUFFER_ARB works as expected.
     60  **/
     61 class ParameterBufferOperationsCase : public deqp::TestCase
     62 {
     63 public:
     64 	/* Public methods */
     65 	ParameterBufferOperationsCase(deqp::Context& context);
     66 
     67 	virtual void						 init();
     68 	virtual tcu::TestNode::IterateResult iterate();
     69 
     70 private:
     71 	/* Private methods */
     72 	/* Private members */
     73 };
     74 
     75 /** Base class for specific vertex array indirect drawing classes.
     76  **/
     77 class VertexArrayIndirectDrawingBaseCase : public deqp::TestCase
     78 {
     79 public:
     80 	/* Public methods */
     81 	VertexArrayIndirectDrawingBaseCase(deqp::Context& context, const char* name, const char* description);
     82 
     83 	virtual void						 init()   = DE_NULL;
     84 	virtual void						 deinit() = DE_NULL;
     85 	virtual tcu::TestNode::IterateResult iterate();
     86 
     87 protected:
     88 	/* Protected methods */
     89 	virtual bool draw() = DE_NULL;
     90 	virtual bool verify();
     91 	virtual bool verifyErrors() = DE_NULL;
     92 };
     93 
     94 /** Test verifies if MultiDrawArraysIndirectCountARB function works properly.
     95  **/
     96 class MultiDrawArraysIndirectCountCase : public VertexArrayIndirectDrawingBaseCase
     97 {
     98 public:
     99 	/* Public methods */
    100 	MultiDrawArraysIndirectCountCase(deqp::Context& context);
    101 
    102 	virtual void init();
    103 	virtual void deinit();
    104 
    105 protected:
    106 	/* Protected methods */
    107 	virtual bool draw();
    108 	virtual bool verifyErrors();
    109 
    110 	/* Protected methods */
    111 	GLuint m_vao;
    112 	GLuint m_arrayBuffer;
    113 	GLuint m_drawIndirectBuffer;
    114 	GLuint m_parameterBuffer;
    115 };
    116 
    117 /** Test verifies if MultiDrawArraysIndirectCountARB function works properly.
    118  **/
    119 class MultiDrawElementsIndirectCountCase : public VertexArrayIndirectDrawingBaseCase
    120 {
    121 public:
    122 	/* Public methods */
    123 	MultiDrawElementsIndirectCountCase(deqp::Context& context);
    124 
    125 	virtual void init();
    126 	virtual void deinit();
    127 
    128 protected:
    129 	/* Protected methods */
    130 	virtual bool draw();
    131 	virtual bool verifyErrors();
    132 
    133 	/* Protected methods */
    134 	GLuint m_vao;
    135 	GLuint m_arrayBuffer;
    136 	GLuint m_elementBuffer;
    137 	GLuint m_drawIndirectBuffer;
    138 	GLuint m_parameterBuffer;
    139 };
    140 
    141 /** Test group which encapsulates all sparse buffer conformance tests */
    142 class IndirectParametersTests : public deqp::TestCaseGroup
    143 {
    144 public:
    145 	/* Public methods */
    146 	IndirectParametersTests(deqp::Context& context);
    147 
    148 	void init();
    149 
    150 private:
    151 	IndirectParametersTests(const IndirectParametersTests& other);
    152 	IndirectParametersTests& operator=(const IndirectParametersTests& other);
    153 };
    154 
    155 } /* glcts namespace */
    156 
    157 #endif // _GL4CINDIRECTPARAMETERSTESTS_HPP
    158