• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _ESEXTCTEXTUREBORDERCLAMPPARAMETERTEXTUREBORDERCOLOR_HPP
2 #define _ESEXTCTEXTUREBORDERCLAMPPARAMETERTEXTUREBORDERCOLOR_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  esextcTextureBorderClampParameterTextureBorderColor.hpp
28  * \brief Verify that GL_TEXTURE_BORDER_COLOR_EXT state is correctly retrieved
29  *        by glGetSamplerParameter*() and glGetTexParameter*() functions. (Test 6)
30  */ /*-------------------------------------------------------------------*/
31 
32 #include "esextcTextureBorderClampBase.hpp"
33 
34 namespace glcts
35 {
36 /**  Implementation of Test 6 from CTS_EXT_texture_border_clamp. Description follows
37  *
38  *    Verify that GL_TEXTURE_BORDER_COLOR_EXT state is correctly retrieved
39  *    by glGetSamplerParameter*() and glGetTexParameter*() functions.
40  *
41  *    Category: Functional tests;
42  *              Optional dependency on EXT_texture_cube_map_array.
43  *    Priority: Must-have.
44  *
45  *    Verify default border color is set to (0.0, 0.0, 0.0, 0.0) and
46  *    (0, 0, 0, 0).
47  *
48  *    Verify setting signed integer border color of (-1, -2, 3, 4) using
49  *    glSamplerParameterIivEXT() / glTexParameterIivEXT() call affects the values
50  *    later reported by glGetSamplerParameterIivEXT() and glGetTexParameterIivEXT().
51  *    These values should match.
52  *
53  *    Verify setting unsigned integer border color of (1, 2, 3, 4) using
54  *    glSamplerParameterIuivEXT() / glTexParameterIuivEXT() call affects the values
55  *    later reported by glGetSamplerParameterIuivEXT() and glGetTexParameterIuivEXT().
56  *    These values should match.
57  *
58  *    Verify setting floating-point border color of (0.1, 0.2, 0.3, 0.4)
59  *    affects the values later reported by glGetSamplerParameterfv() /
60  *    glGetTexParameterfv(). These values should match.
61  *
62  *    Verify setting integer border color of
63  *    (0, 1, 2, 4) using glSamplerParameteriv()
64  *    / glTexParameteriv() affects the values later reported by
65  *    glGetSamplerParameteriv() / glGetTexParameteriv(). The returned values
66  *    should correspond to the outcome of equation 2.2 from ES3.0.2 spec
67  *    applied to each component.
68  *
69  *    All texture targets available in ES3.1, as well as
70  *    GL_TEXTURE_CUBE_MAP_ARRAY_EXT (if supported).
71  */
72 class TextureBorderClampParameterTextureBorderColor : public TextureBorderClampBase
73 {
74 public:
75 	/* Public methods */
76 	TextureBorderClampParameterTextureBorderColor(Context& context, const ExtParameters& extParams, const char* name,
77 												  const char* description);
78 
~TextureBorderClampParameterTextureBorderColor()79 	virtual ~TextureBorderClampParameterTextureBorderColor()
80 	{
81 	}
82 
83 	virtual void		  deinit(void);
84 	virtual IterateResult iterate(void);
85 
86 private:
87 	/* Private methods */
88 	void initTest(void);
89 
90 	bool verifyGLGetSamplerParameterfvResult(glw::GLuint sampler_id, glw::GLenum target,
91 											 const glw::GLfloat* expected_data);
92 
93 	bool verifyGLGetSamplerParameterivResult(glw::GLuint sampler_id, glw::GLenum target,
94 											 const glw::GLint* expected_data);
95 
96 	bool verifyGLGetSamplerParameterIivResult(glw::GLuint sampler_id, glw::GLenum target,
97 											  const glw::GLint* expected_data);
98 
99 	bool verifyGLGetSamplerParameterIuivResult(glw::GLuint sampler_id, glw::GLenum target,
100 											   const glw::GLuint* expected_data);
101 
102 	bool verifyGLGetTexParameterfvResult(glw::GLenum target, const glw::GLfloat* expected_data);
103 
104 	bool verifyGLGetTexParameterivResult(glw::GLenum target, const glw::GLint* expected_data);
105 
106 	bool verifyGLGetTexParameterIivResult(glw::GLenum target, const glw::GLint* expected_data);
107 
108 	bool verifyGLGetTexParameterIuivResult(glw::GLenum target, const glw::GLuint* expected_data);
109 
110 	/* Private variables */
111 	glw::GLuint				 m_sampler_id;
112 	std::vector<glw::GLenum> m_texture_targets;
113 	glw::GLuint				 m_to_id;
114 
115 	/* Private static constants */
116 	static const glw::GLuint m_buffer_length;
117 	static const glw::GLuint m_texture_unit_index;
118 };
119 
120 } // namespace glcts
121 
122 #endif // _ESEXTCTEXTUREBORDERCLAMPPARAMETERTEXTUREBORDERCOLOR_HPP
123