1 #ifndef _ESEXTCTEXTURECUBEMAPARRAYGETTERCALLS_HPP
2 #define _ESEXTCTEXTURECUBEMAPARRAYGETTERCALLS_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  * \file  esextcTextureCubeMapArrayGetterCalls.hpp
28  * \brief Texture Cube Map Array Getter Calls (Test 6)
29  */ /*-------------------------------------------------------------------*/
30 
31 #include "../esextcTestCaseBase.hpp"
32 #include <map>
33 #include <vector>
34 
35 namespace glcts
36 {
37 /*   Implementation of Test 6 from CTS_EXT_texture_cube_map_array. Test description follows:
38  *
39  *   Make sure getter calls work correctly in regard to cube-map array textures.
40  *
41  *   Category: API;
42  *   Priority: Must-have.
43  *
44  *   Consider a cube-map array texture. Make sure that getter calls operating
45  *   on the texture object report valid default properties for a newly created
46  *   and initialized cube-map array texture.
47  *   Modify texture properties of the object and make sure valid values are
48  *   reported by the getter calls.
49  *   Getter calls to consider: glGetTexParameterfv(), glGetTexParameteriv().
50  *
51  *   Make sure that GL_TEXTURE_CUBE_MAP_ARRAY_EXT texture binding is reported
52  *   correctly by glGetBooleanv(), glGetFloatv() and glGetIntegerv().
53  *
54  *   Make sure that glGetTexLevelParameterfv() and glGetTexLevelParameteriv()
55  *   do not report an error, when all relevant properties defined for the
56  *   GL_TEXTURE_CUBE_MAP_ARRAY_EXT texture target are queried.
57  *
58  *   Both immutable and mutable textures should be checked
59  */
60 class TextureCubeMapArrayGetterCalls : public TestCaseBase
61 {
62 public:
63 	/* Public functions */
64 	TextureCubeMapArrayGetterCalls(Context& context, const ExtParameters& extParams, const char* name,
65 								   const char* description);
66 
~TextureCubeMapArrayGetterCalls()67 	virtual ~TextureCubeMapArrayGetterCalls()
68 	{
69 	}
70 
71 	virtual void		  deinit(void);
72 	virtual IterateResult iterate(void);
73 
74 private:
75 	/* Private functions */
76 	void initTest(void);
77 	void verifyTextureBindings(void);
78 	void verifyGetTexParameter(glw::GLenum pname, glw::GLint expected_value);
79 	void verifyGetTexLevelParameters(void);
80 
81 	static const char* getStringForGetTexParameterPname(glw::GLenum pname);
82 	static const char* getStringForGetTexLevelParameterPname(glw::GLenum pname);
83 
84 	/* Private variables */
85 	glw::GLuint	m_to_id;
86 	glw::GLboolean m_test_passed;
87 
88 	static const glw::GLuint  m_depth;
89 	static const glw::GLsizei m_height;
90 	static const glw::GLsizei m_width;
91 	static const glw::GLuint  m_n_components;
92 
93 	/* Values represented by variables below are used by
94 	 * verifyTextureLevelParameterValues() */
95 	glw::GLint m_expected_alpha_size;
96 	glw::GLint m_expected_alpha_type;
97 	glw::GLint m_expected_blue_size;
98 	glw::GLint m_expected_blue_type;
99 	glw::GLint m_expected_compressed;
100 	glw::GLint m_expected_depth_size;
101 	glw::GLint m_expected_depth_type;
102 	glw::GLint m_expected_green_size;
103 	glw::GLint m_expected_green_type;
104 	glw::GLint m_expected_red_size;
105 	glw::GLint m_expected_red_type;
106 	glw::GLint m_expected_shared_size;
107 	glw::GLint m_expected_stencil_size;
108 	glw::GLint m_expected_texture_internal_format;
109 
110 	typedef std::map<glw::GLenum, glw::GLint> PNamesMap;
111 	typedef std::vector<glw::GLenum> PNamesVec;
112 
113 	PNamesMap pnames_for_gettexparameter_default;
114 	PNamesMap pnames_for_gettexparameter_modified;
115 	PNamesVec pnames_for_gettexlevelparameter;
116 };
117 
118 } // namespace glcts
119 
120 #endif // _ESEXTCTEXTURECUBEMAPARRAYGETTERCALLS_HPP
121