Home | History | Annotate | Download | only in gles31
      1 #ifndef _ES31CTEXTURESTORAGEMULTISAMPLEGETTEXLEVELPARAMETERIFVTESTS_HPP
      2 #define _ES31CTEXTURESTORAGEMULTISAMPLEGETTEXLEVELPARAMETERIFVTESTS_HPP
      3 /*-------------------------------------------------------------------------
      4  * OpenGL Conformance Test Suite
      5  * -----------------------------
      6  *
      7  * Copyright (c) 2014-2016 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  es31cTextureStorageMultisampleGetTexLevelParameterifvTests.hpp
     29  * \brief Declares test classes for glGetTexLevelParameter{i, f}v() conformance
     30  *        tests. (ES3.1 only)
     31  */ /*-------------------------------------------------------------------*/
     32 
     33 #include "es31cTextureStorageMultisampleTests.hpp"
     34 #include "glwEnums.hpp"
     35 
     36 namespace glcts
     37 {
     38 /** Test case: Verifies glGetTexLevelParameter{if}v() entry-points work correctly for
     39  *             all ES3.1 texture targets.
     40  **/
     41 class MultisampleTextureGetTexLevelParametervFunctionalTest : public glcts::TestCase
     42 {
     43 public:
     44 	/* Public methods */
     45 	MultisampleTextureGetTexLevelParametervFunctionalTest(Context& context);
     46 
     47 	virtual void						 deinit();
     48 	virtual tcu::TestNode::IterateResult iterate();
     49 
     50 private:
     51 	typedef struct texture_properties
     52 	{
     53 		glw::GLint	 depth;
     54 		glw::GLboolean fixedsamplelocations;
     55 		glw::GLenum	format;
     56 		glw::GLint	 height;
     57 		glw::GLenum	internalformat;
     58 		bool		   is_2d_texture;
     59 		bool		   is_cm_texture;
     60 		bool		   is_multisample_texture;
     61 		glw::GLint	 samples;
     62 		glw::GLenum	target;
     63 		glw::GLuint*   to_id_ptr;
     64 		glw::GLenum	type;
     65 		glw::GLenum	width;
     66 
     67 		glw::GLint				expected_compressed;
     68 		glw::GLint				expected_texture_alpha_size;
     69 		std::vector<glw::GLint> expected_texture_alpha_types;
     70 		glw::GLint				expected_texture_blue_size;
     71 		std::vector<glw::GLint> expected_texture_blue_types;
     72 		glw::GLint				expected_texture_depth;
     73 		glw::GLint				expected_texture_depth_size;
     74 		std::vector<glw::GLint> expected_texture_depth_types;
     75 		glw::GLint				expected_texture_fixed_sample_locations;
     76 		glw::GLint				expected_texture_green_size;
     77 		std::vector<glw::GLint> expected_texture_green_types;
     78 		glw::GLint				expected_texture_height;
     79 		glw::GLint				expected_texture_internal_format;
     80 		glw::GLint				expected_texture_red_size;
     81 		std::vector<glw::GLint> expected_texture_red_types;
     82 		glw::GLint				expected_texture_samples;
     83 		glw::GLint				expected_texture_shared_size;
     84 		glw::GLint				expected_texture_stencil_size;
     85 		glw::GLint				expected_texture_width;
     86 
     87 		texture_properties()
     88 			: depth(0)
     89 			, fixedsamplelocations(GL_FALSE)
     90 			, format(0)
     91 			, height(0)
     92 			, internalformat(0)
     93 			, is_2d_texture(false)
     94 			, is_cm_texture(false)
     95 			, is_multisample_texture(false)
     96 			, samples(0)
     97 			, target(GL_NONE)
     98 			, to_id_ptr(NULL)
     99 			, type(0)
    100 			, width(0)
    101 			, expected_compressed(0)
    102 			, expected_texture_alpha_size(0)
    103 			, expected_texture_blue_size(0)
    104 			, expected_texture_depth(0)
    105 			, expected_texture_depth_size(0)
    106 			, expected_texture_fixed_sample_locations(0)
    107 			, expected_texture_green_size(0)
    108 			, expected_texture_height(0)
    109 			, expected_texture_internal_format(0)
    110 			, expected_texture_red_size(0)
    111 			, expected_texture_samples(0)
    112 			, expected_texture_shared_size(0)
    113 			, expected_texture_stencil_size(0)
    114 			, expected_texture_width(0)
    115 		{
    116 			/* Left blank intentionally */
    117 		}
    118 	} _texture_properties;
    119 
    120 	/* Private variables */
    121 	glw::GLboolean gl_oes_texture_storage_multisample_2d_array_supported;
    122 	glw::GLuint	to_2d;
    123 	glw::GLuint	to_2d_array;
    124 	glw::GLuint	to_2d_multisample;
    125 	glw::GLuint	to_2d_multisample_array;
    126 	glw::GLuint	to_3d;
    127 	glw::GLuint	to_cubemap;
    128 };
    129 
    130 /** Test case: Verifies glGetTexLevelParameter{if}v() entry-points work correctly for
    131  *             maximum LOD.
    132  *
    133  **/
    134 class MultisampleTextureGetTexLevelParametervWorksForMaximumLodTest : public glcts::TestCase
    135 {
    136 public:
    137 	/* Public methods */
    138 	MultisampleTextureGetTexLevelParametervWorksForMaximumLodTest(Context& context);
    139 
    140 	virtual void						 deinit();
    141 	virtual tcu::TestNode::IterateResult iterate();
    142 
    143 private:
    144 	/* Private variables */
    145 	glw::GLboolean gl_oes_texture_storage_multisample_2d_array_supported;
    146 	glw::GLuint	to_id;
    147 };
    148 
    149 /** Test case: GL_INVALID_ENUM is reported for invalid texture target. */
    150 class MultisampleTextureGetTexLevelParametervInvalidTextureTargetRejectedTest : public glcts::TestCase
    151 {
    152 public:
    153 	/* Public methods */
    154 	MultisampleTextureGetTexLevelParametervInvalidTextureTargetRejectedTest(Context& context);
    155 
    156 	virtual void						 deinit();
    157 	virtual tcu::TestNode::IterateResult iterate();
    158 
    159 private:
    160 	/* Private variables */
    161 	glw::GLfloat float_data;
    162 	glw::GLint   int_data;
    163 };
    164 
    165 /** Test case: GL_INVALID_VALUE is reported for invalid value argument. */
    166 class MultisampleTextureGetTexLevelParametervInvalidValueArgumentRejectedTest : public glcts::TestCase
    167 {
    168 public:
    169 	/* Public methods */
    170 	MultisampleTextureGetTexLevelParametervInvalidValueArgumentRejectedTest(Context& context);
    171 
    172 	virtual void						 deinit();
    173 	virtual tcu::TestNode::IterateResult iterate();
    174 
    175 private:
    176 	/* Private variables */
    177 	glw::GLfloat float_data;
    178 	glw::GLint   int_data;
    179 };
    180 
    181 /** Test case: GL_INVALID_VALUE is reported for negative <lod> argument value. */
    182 class MultisampleTextureGetTexLevelParametervNegativeLodIsRejectedTest : public glcts::TestCase
    183 {
    184 public:
    185 	/* Public methods */
    186 	MultisampleTextureGetTexLevelParametervNegativeLodIsRejectedTest(Context& context);
    187 
    188 	virtual void						 deinit();
    189 	virtual tcu::TestNode::IterateResult iterate();
    190 
    191 private:
    192 	/* Private methods */
    193 	void initInternals();
    194 
    195 	/* Private variables */
    196 	glw::GLfloat float_data;
    197 	glw::GLint   int_data;
    198 	glw::GLuint  to_id;
    199 };
    200 
    201 } /* glcts namespace */
    202 
    203 #endif // _ES31CTEXTURESTORAGEMULTISAMPLEGETTEXLEVELPARAMETERIFVTESTS_HPP
    204