• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _ES31CTEXTURESTORAGEMULTISAMPLEDEPENDENCIESTESTS_HPP
2 #define _ES31CTEXTURESTORAGEMULTISAMPLEDEPENDENCIESTESTS_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  es31cTextureStorageMultisampleDependenciesTests.hpp
29  * \brief Declares test classes for testing dependencies of multisample
30  *        textures with other parts of the API (ES3.1 only)
31  */ /*-------------------------------------------------------------------*/
32 
33 #include "es31cTextureStorageMultisampleTests.hpp"
34 
35 namespace glcts
36 {
37 /** Test case: FBOs with multisample texture attachments, whose amount of samples differs
38  *  between attachments, should be considered incomplete (GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE)
39  */
40 class MultisampleTextureDependenciesFBOIncompleteness1Test : public glcts::TestCase
41 {
42 public:
43 	/* Public methods */
44 	MultisampleTextureDependenciesFBOIncompleteness1Test(Context& context);
45 
46 	virtual void						 deinit();
47 	virtual tcu::TestNode::IterateResult iterate();
48 
49 private:
50 	/* Private variables */
51 	glw::GLuint fbo_id;
52 	glw::GLuint to_id_multisample_2d_array;
53 	glw::GLuint to_ids_multisample_2d[2];
54 };
55 
56 /** Test case: FBOs with multisample texture and normal 2D texture attachments should be
57  *  considered incomplete (GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE)
58  */
59 class MultisampleTextureDependenciesFBOIncompleteness2Test : public glcts::TestCase
60 {
61 public:
62 	/* Public methods */
63 	MultisampleTextureDependenciesFBOIncompleteness2Test(Context& context);
64 
65 	virtual void						 deinit();
66 	virtual tcu::TestNode::IterateResult iterate();
67 
68 private:
69 	/* Private variables */
70 	glw::GLuint fbo_id;
71 	glw::GLuint to_id_2d;
72 	glw::GLuint to_id_multisample_2d;
73 	glw::GLuint to_id_multisample_2d_array;
74 };
75 
76 /** Test case: FBOs with multisample texture attachments of different "fixed sample
77  *             location" settings should be considered incomplete
78  *             (GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE)
79  */
80 class MultisampleTextureDependenciesFBOIncompleteness3Test : public glcts::TestCase
81 {
82 public:
83 	/* Public methods */
84 	MultisampleTextureDependenciesFBOIncompleteness3Test(Context& context);
85 
86 	virtual void						 deinit();
87 	virtual tcu::TestNode::IterateResult iterate();
88 
89 private:
90 	/* Private variables */
91 	glw::GLuint fbo_id;
92 	glw::GLuint to_id_2d_multisample_color_1;
93 	glw::GLuint to_id_2d_multisample_color_2;
94 	glw::GLuint to_id_2d_multisample_depth;
95 	glw::GLuint to_id_2d_multisample_depth_stencil;
96 };
97 
98 /** Test case: FBOs with multisample texture attachments of different "fixed sample
99  *             location" settings and with multisampled renderbuffers (of the same amount
100  *             of samples) should be considered incomplete
101  *             (GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE)
102  */
103 class MultisampleTextureDependenciesFBOIncompleteness4Test : public glcts::TestCase
104 {
105 public:
106 	/* Public methods */
107 	MultisampleTextureDependenciesFBOIncompleteness4Test(Context& context);
108 
109 	virtual void						 deinit();
110 	virtual tcu::TestNode::IterateResult iterate();
111 
112 private:
113 	/* Private variables */
114 	glw::GLuint fbo_id;
115 	glw::GLuint rbo_id;
116 	glw::GLuint to_id_2d_multisample_array_color;
117 	glw::GLuint to_id_2d_multisample_color;
118 };
119 
120 /** Test case: FBOs with renderbuffer and multisample texture attachments, where amount
121  *             of samples used for multisample texture attachments differs from the
122  *             amount of samples used for renderbuffer attachments, should be considered
123  *             incomplete (GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE)
124  */
125 class MultisampleTextureDependenciesFBOIncompleteness5Test : public glcts::TestCase
126 {
127 public:
128 	/* Public methods */
129 	MultisampleTextureDependenciesFBOIncompleteness5Test(Context& context);
130 
131 	virtual void						 deinit();
132 	virtual tcu::TestNode::IterateResult iterate();
133 
134 private:
135 	/* Private variables */
136 	glw::GLuint fbo_id;
137 	glw::GLuint rbo_id;
138 	glw::GLuint to_id_multisample_2d;
139 	glw::GLuint to_id_multisample_2d_array;
140 };
141 
142 /** Test case: GL_INVALID_OPERATION error is reported if 2D or cube-map texture target is
143  *             used with a multisample 2D texture for a glFramebufferTexture2D() call.
144  */
145 class MultisampleTextureDependenciesInvalidFramebufferTexture2DCalls1Test : public glcts::TestCase
146 {
147 public:
148 	/* Public methods */
149 	MultisampleTextureDependenciesInvalidFramebufferTexture2DCalls1Test(Context& context);
150 
151 	virtual void						 deinit();
152 	virtual tcu::TestNode::IterateResult iterate();
153 
154 private:
155 	/* Private methods */
156 	void initInternals();
157 
158 	/* Private variables */
159 	glw::GLuint fbo_id;
160 	glw::GLuint to_id;
161 };
162 
163 /** Test case: GL_INVALID_VALUE error is reported if a glFramebufferTexture2D() call is
164  *             made with level not equal to zero for a 2D multisample texture.
165  */
166 class MultisampleTextureDependenciesInvalidFramebufferTexture2DCalls2Test : public glcts::TestCase
167 {
168 public:
169 	/* Public methods */
170 	MultisampleTextureDependenciesInvalidFramebufferTexture2DCalls2Test(Context& context);
171 
172 	virtual void						 deinit();
173 	virtual tcu::TestNode::IterateResult iterate();
174 
175 private:
176 	/* Private methods */
177 	void initInternals();
178 
179 	/* Private variables */
180 	glw::GLuint fbo_id;
181 	glw::GLuint to_id;
182 };
183 
184 /** Test case: GL_INVALID_OPERATION error is reported if a multisample 2D texture
185  *  is used for a glFramebufferTextureLayer() call.
186  */
187 class MultisampleTextureDependenciesInvalidFramebufferTextureLayerCalls1Test : public glcts::TestCase
188 {
189 public:
190 	/* Public methods */
191 	MultisampleTextureDependenciesInvalidFramebufferTextureLayerCalls1Test(Context& context);
192 
193 	virtual void						 deinit();
194 	virtual tcu::TestNode::IterateResult iterate();
195 
196 private:
197 	/* Private methods */
198 	void initInternals();
199 
200 	/* Private variables */
201 	glw::GLuint fbo_id;
202 	glw::GLuint to_id;
203 };
204 
205 /** Test case: GL_INVALID_VALUE error is reported if a glFramebufferTextureLayer() call
206  *             is made with level exceeding amount of layers defined for a 2D multisample
207  *             array texture.
208  */
209 class MultisampleTextureDependenciesInvalidFramebufferTextureLayerCalls2Test : public glcts::TestCase
210 {
211 public:
212 	/* Public methods */
213 	MultisampleTextureDependenciesInvalidFramebufferTextureLayerCalls2Test(Context& context);
214 
215 	virtual void						 deinit();
216 	virtual tcu::TestNode::IterateResult iterate();
217 
218 private:
219 	/* Private methods */
220 	void initInternals();
221 
222 	/* Private variables */
223 	glw::GLuint fbo_id;
224 	glw::GLuint to_id;
225 };
226 
227 /** Test case: GL_INVALID_OPERATION error is reported for
228  *             glRenderbufferStorageMultisample() calls, for which samples argument
229  *             exceeds MAX_SAMPLES for non-integer internalformats.
230  */
231 class MultisampleTextureDependenciesInvalidRenderbufferStorageMultisampleCalls1Test : public glcts::TestCase
232 {
233 public:
234 	/* Public methods */
235 	MultisampleTextureDependenciesInvalidRenderbufferStorageMultisampleCalls1Test(Context& context);
236 
237 	virtual void						 deinit();
238 	virtual tcu::TestNode::IterateResult iterate();
239 
240 private:
241 	/* Private methods */
242 	void initInternals();
243 
244 	/* Private variables */
245 	glw::GLuint rbo_id;
246 };
247 
248 /** Test case: GL_INVALID_OPERATION error is reported for
249  *             glRenderbufferStorageMultisample() calls, for which samples argument
250  *             exceeds MAX_INTEGER_SAMPLES for integer internalformats.
251  */
252 class MultisampleTextureDependenciesInvalidRenderbufferStorageMultisampleCalls2Test : public glcts::TestCase
253 {
254 public:
255 	/* Public methods */
256 	MultisampleTextureDependenciesInvalidRenderbufferStorageMultisampleCalls2Test(Context& context);
257 
258 	virtual void						 deinit();
259 	virtual tcu::TestNode::IterateResult iterate();
260 
261 private:
262 	/* Private methods */
263 	void initInternals();
264 
265 	/* Private variables */
266 	glw::GLuint rbo_id;
267 };
268 
269 /** Test case: No error is reported by glFramebufferTexture2D() calls, for
270  *             which GL_TEXTURE_2D_MULTISAMPLE texture target is used.
271  */
272 class MultisampleTextureDependenciesNoErrorGeneratedForValidFramebufferTexture2DCallsTest : public glcts::TestCase
273 {
274 public:
275 	/* Public methods */
276 	MultisampleTextureDependenciesNoErrorGeneratedForValidFramebufferTexture2DCallsTest(Context& context);
277 
278 	virtual void						 deinit();
279 	virtual tcu::TestNode::IterateResult iterate();
280 
281 private:
282 	/* Private methods */
283 	void initInternals();
284 
285 	/* Private variables */
286 	glw::GLuint fbo_id;
287 	glw::GLuint to_id;
288 };
289 
290 /** Test case: No error is reported for glRenderbufferStorageMultisample() calls, for
291  *             which samples argument is in 0 < samples <= GL_MAX_SAMPLES range for
292  *             non-integer internalformats, and within 0 < samples <= GL_MAX_INTEGER_SAMPLES
293  *             for integer internalformats.
294  */
295 class MultisampleTextureDependenciesNoErrorGeneratedForValidRenderbufferStorageMultisampleCallsTest
296 	: public glcts::TestCase
297 {
298 public:
299 	/* Public methods */
300 	MultisampleTextureDependenciesNoErrorGeneratedForValidRenderbufferStorageMultisampleCallsTest(Context& context);
301 
302 	virtual void						 deinit();
303 	virtual tcu::TestNode::IterateResult iterate();
304 
305 private:
306 	/* Private methods */
307 	void initInternals();
308 
309 	/* Private variables */
310 	glw::GLuint rbo_id;
311 };
312 
313 /** Test case: When used against multisample texture targets, glTexParameter*() should not generate
314  *             any error if GL_TEXTURE_BASE_LEVEL is set to 0. Using any other value should generate
315  *             GL_INVALID_OPERATION.
316  *             Modifying sampler states should generate GL_INVALID_ENUM.
317  */
318 class MultisampleTextureDependenciesTexParameterTest : public glcts::TestCase
319 {
320 public:
321 	/* Public methods */
322 	MultisampleTextureDependenciesTexParameterTest(Context& context);
323 
324 	virtual void						 deinit();
325 	virtual tcu::TestNode::IterateResult iterate();
326 
327 private:
328 	/* Private methods */
329 	void checkAllTexParameterInvocations(glw::GLenum expected_error_code, glw::GLint value, glw::GLenum pname,
330 										 glw::GLenum texture_target);
331 
332 	/* Private variables */
333 	glw::GLuint to_id_multisample_2d;
334 	glw::GLuint to_id_multisample_2d_array;
335 };
336 } /* glcts namespace */
337 
338 #endif // _ES31CTEXTURESTORAGEMULTISAMPLEDEPENDENCIESTESTS_HPP
339