1 #ifndef _GL4CDIRECTSTATEACCESSTESTS_HPP
2 #define _GL4CDIRECTSTATEACCESSTESTS_HPP
3 /*-------------------------------------------------------------------------
4 * OpenGL Conformance Test Suite
5 * -----------------------------
7 * Copyright (c) 2015-2016 The Khronos Group Inc.
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
24 */ /*-------------------------------------------------------------------*/
28 * \file gl4cDirectStateAccessTests.hpp
29 * \brief Conformance tests for the Direct State Access feature functionality.
30 */ /*-----------------------------------------------------------------------------*/
34 #include "glcTestCase.hpp"
35 #include "glwDefs.hpp"
36 #include "tcuDefs.hpp"
43 namespace DirectStateAccess
47 * @brief Direct State Access test group.
49 class Tests : public deqp::TestCaseGroup
52 /* Public member functions */
53 Tests(deqp::Context& context);
58 /* Private member functions */
59 Tests(const Tests& other);
60 Tests& operator=(const Tests& other);
64 /* Direct State Access Feature Interfaces */
66 /* Direct State Access Transform Feedback Tests */
67 namespace TransformFeedback
69 /** @class CreationTest
71 * @brief Direct State Access Transform Feedback Creation test cases.
73 * Test follows the steps:
75 * Create at least two transform feedback objects names with
76 * GenTransformFeedbacks function. Check them without binding, using
77 * IsTransformFeedback function. Expect GL_FALSE.
79 * Create at least two transform feedback objects with
80 * CreateTransformFeedbacks function. Check them without binding, using
81 * IsTransformFeedback function. Expect GL_TRUE.
83 * Check that transform feedback binding point is unchanged.
85 class CreationTest : public deqp::TestCase
88 /* Public member functions */
89 CreationTest(deqp::Context& context);
91 virtual tcu::TestNode::IterateResult iterate();
94 /* Private member functions */
95 CreationTest(const CreationTest& other);
96 CreationTest& operator=(const CreationTest& other);
98 /* CreationTest class */
100 /** @class DefaultsTest
102 * @brief Direct State Access Transform Feedback Default State test cases.
104 * Test follows the steps:
106 * Create transform feedback object with CreateTransformFeedbacks function.
108 * Query parameters TRANSFORM_FEEDBACK_BUFFER_BINDING using
109 * GetTransformFeedbacki_v for all available indexed binding points. For
110 * all queries, expect value equal to 0.
113 * - TRANSFORM_FEEDBACK_BUFFER_START and
114 * - TRANSFORM_FEEDBACK_BUFFER_SIZE
115 * using GetTransformFeedbacki64_v for all available indexed binding
116 * points. For all queries, expect value equal to 0.
119 * - TRANSFORM_FEEDBACK_PAUSED and
120 * - TRANSFORM_FEEDBACK_ACTIVE
121 * using GetTransformFeedbackiv. For all queries, expect value equal to
124 class DefaultsTest : public deqp::TestCase
127 /* Public member functions */
128 DefaultsTest(deqp::Context& context);
130 virtual tcu::TestNode::IterateResult iterate();
133 /* Private member functions */
134 DefaultsTest(const DefaultsTest& other);
135 DefaultsTest& operator=(const DefaultsTest& other);
137 /* Function pointers type definitions and declarations. */
138 typedef void(GLW_APIENTRY* GetTransformFeedbackiv_ProcAddress)(glw::GLuint xfb, glw::GLenum pname,
140 typedef void(GLW_APIENTRY* GetTransformFeedbacki_v_ProcAddress)(glw::GLuint xfb, glw::GLenum pname,
141 glw::GLuint index, glw::GLint* param);
142 typedef void(GLW_APIENTRY* GetTransformFeedbacki64_v_ProcAddress)(glw::GLuint xfb, glw::GLenum pname,
143 glw::GLuint index, glw::GLint64* param);
145 GetTransformFeedbackiv_ProcAddress m_gl_getTransformFeedbackiv;
146 GetTransformFeedbacki_v_ProcAddress m_gl_getTransformFeedbacki_v;
147 GetTransformFeedbacki64_v_ProcAddress m_gl_getTransformFeedbacki64_v;
149 /* Private member variables */
150 glw::GLuint m_xfb_dsa;
151 glw::GLint m_xfb_indexed_binding_points_count;
153 /* Private member functions. */
155 bool testBuffersBindingPoints();
156 bool testBuffersDimensions();
161 /* DefaultsTest class */
163 /** @class BuffersTest
165 * @brief Direct State Access Transform Feedback Buffer Objects binding test cases.
166 * The test follows the steps:
168 * Create transform feedback object with CreateTransformFeedbacks function.
170 * Create two buffer objects using GenBuffers and BindBuffer functions.
171 * Allocate storage for them using BufferData.
173 * Bind the first buffer to transform feedback object indexed binding point
174 * 0 using TransformFeedbackBufferBase function.
176 * Bind a first half of the second buffer to transform feedback object
177 * indexed binding point 1 using TransformFeedbackBufferRange.
179 * Bind a second half of the second buffer to transform feedback object
180 * indexed binding point 12 using TransformFeedbackBufferRange.
182 * Query parameter TRANSFORM_FEEDBACK_BUFFER_BINDING using
183 * GetTransformFeedbacki_v for all 1st, 2nd and 3rd indexed binding point.
184 * For all queries, expect value equal to the corresponding buffers'
188 * - TRANSFORM_FEEDBACK_BUFFER_START and
189 * - TRANSFORM_FEEDBACK_BUFFER_SIZE
190 * using GetTransformFeedbacki64_v for indexed binding points 0, 1 and 2.
191 * Verify returned values.
193 class BuffersTest : public deqp::TestCase
196 /* Public member functions */
197 BuffersTest(deqp::Context& context);
199 virtual tcu::TestNode::IterateResult iterate();
202 /* Private member functions */
203 BuffersTest(const BuffersTest& other);
204 BuffersTest& operator=(const BuffersTest& other);
206 /* Function pointers type definitions and declarations. */
207 typedef void(GLW_APIENTRY* GetTransformFeedbacki_v_ProcAddress)(glw::GLuint xfb, glw::GLenum pname,
208 glw::GLuint index, glw::GLint* param);
209 typedef void(GLW_APIENTRY* GetTransformFeedbacki64_v_ProcAddress)(glw::GLuint xfb, glw::GLenum pname,
210 glw::GLuint index, glw::GLint64* param);
211 typedef void(GLW_APIENTRY* TransformFeedbackBufferBase_ProcAddress)(glw::GLuint xfb, glw::GLuint index,
213 typedef void(GLW_APIENTRY* TransformFeedbackBufferRange_ProcAddress)(glw::GLuint xfb, glw::GLuint index,
214 glw::GLuint buffer, glw::GLintptr offset,
217 GetTransformFeedbacki_v_ProcAddress m_gl_getTransformFeedbacki_v;
218 GetTransformFeedbacki64_v_ProcAddress m_gl_getTransformFeedbacki64_v;
219 TransformFeedbackBufferBase_ProcAddress m_gl_TransformFeedbackBufferBase;
220 TransformFeedbackBufferRange_ProcAddress m_gl_TransformFeedbackBufferRange;
222 /* Private member variables */
223 glw::GLuint m_xfb_dsa;
227 /* Private static variables */
228 static const glw::GLuint s_bo_size;
230 /* Private member functions. */
231 void prepareObjects();
232 bool prepareTestSetup();
233 bool testBindingPoint(glw::GLuint const index, glw::GLint const expected_value,
234 glw::GLchar const* const tested_function_name);
235 bool testStart(glw::GLuint const index, glw::GLint const expected_value,
236 glw::GLchar const* const tested_function_name);
237 bool testSize(glw::GLuint const index, glw::GLint const expected_value,
238 glw::GLchar const* const tested_function_name);
241 /* BuffersTest class */
243 /** @class ErrorsTest
245 * @brief Direct State Access Transform Feedback Negative test cases.
246 * The test follows steps:
248 * Check that CreateTransformFeedbacks generates INVALID_VALUE error if
249 * number of transform feedback objects to create is negative.
251 * Check that GetTransformFeedbackiv, GetTransformFeedbacki_v and
252 * GetTransformFeedbacki64_v generate INVALID_OPERATION error if xfb is not
253 * zero or the name of an existing transform feedback object.
255 * Check that GetTransformFeedbackiv generates INVALID_ENUM error if pname
256 * is not TRANSFORM_FEEDBACK_PAUSED or TRANSFORM_FEEDBACK_ACTIVE.
258 * Check that GetTransformFeedbacki_v generates INVALID_ENUM error if pname
259 * is not TRANSFORM_FEEDBACK_BUFFER_BINDING.
261 * Check that GetTransformFeedbacki64_v generates INVALID_ENUM error if
262 * pname is not TRANSFORM_FEEDBACK_BUFFER_START or
263 * TRANSFORM_FEEDBACK_BUFFER_SIZE.
265 * Check that GetTransformFeedbacki_v and GetTransformFeedbacki64_v
266 * generate INVALID_VALUE error by GetTransformFeedbacki_v and
267 * GetTransformFeedbacki64_v if index is greater than or equal to the
268 * number of binding points for transform feedback (the value of
269 * MAX_TRANSFORM_FEEDBACK_BUFFERS).
271 class ErrorsTest : public deqp::TestCase
274 /* Public member functions */
275 ErrorsTest(deqp::Context& context);
277 virtual tcu::TestNode::IterateResult iterate();
280 /* Private member functions */
281 ErrorsTest(const ErrorsTest& other);
282 ErrorsTest& operator=(const ErrorsTest& other);
284 /* Function pointers type definitions and declarations. */
285 typedef void(GLW_APIENTRY* GetTransformFeedbackiv_ProcAddress)(glw::GLuint xfb, glw::GLenum pname,
287 typedef void(GLW_APIENTRY* GetTransformFeedbacki_v_ProcAddress)(glw::GLuint xfb, glw::GLenum pname,
288 glw::GLuint index, glw::GLint* param);
289 typedef void(GLW_APIENTRY* GetTransformFeedbacki64_v_ProcAddress)(glw::GLuint xfb, glw::GLenum pname,
290 glw::GLuint index, glw::GLint64* param);
292 GetTransformFeedbackiv_ProcAddress m_gl_getTransformFeedbackiv;
293 GetTransformFeedbacki_v_ProcAddress m_gl_getTransformFeedbacki_v;
294 GetTransformFeedbacki64_v_ProcAddress m_gl_getTransformFeedbacki64_v;
296 /* Private member functions. */
297 void prepareFunctionPointers();
300 bool testCreateTransformFeedbacksForInvalidNumberOfObjects();
301 bool testQueriesForInvalidNameOfObject();
302 bool testGetTransformFeedbackivQueryForInvalidParameterName();
303 bool testGetTransformFeedbacki_vQueryForInvalidParameterName();
304 bool testGetTransformFeedbacki64_vQueryForInvalidParameterName();
305 bool testIndexedQueriesForInvalidBindingPoint();
307 /* BuffersTest class */
309 /** @class FunctionalTest
311 * @brief Direct State Access Transform Feedback Functional test cases.
313 * @note The test follows steps:
315 * Create transform feedback object with CreateTransformFeedbacks function.
317 * Create buffer object using GenBuffers and BindBuffer functions.
318 * Allocate storage for it using BufferData.
320 * Bind the buffer to transform feedback object indexed binding point 0
321 * using TransformFeedbackBufferBase function.
323 * Prepare program with vertex shader which outputs VertexID to transform
326 * Create and bind empty vertex array object.
328 * Begin transform feedback environment.
330 * Using the program with discarded rasterizer, draw array of 4 indices
333 * Pause transform feedback environment.
335 * Query parameter TRANSFORM_FEEDBACK_PAUSED using GetTransformFeedbackiv.
336 * Expect value equal to TRUE.
338 * Query parameter TRANSFORM_FEEDBACK_PAUSED using GetTransformFeedbackiv.
339 * Expect value equal to FALSE.
341 * Resume transform feedback environment.
343 * Query parameter TRANSFORM_FEEDBACK_PAUSED using GetTransformFeedbackiv.
344 * Expect value equal to FALSE.
346 * Query parameter TRANSFORM_FEEDBACK_PAUSED using GetTransformFeedbackiv.
347 * Expect value equal to TRUE.
349 * End Transform feedback environment.
351 * Verify data in the buffer using MapBuffer function.
353 class FunctionalTest : public deqp::TestCase
356 /* Public member functions */
357 FunctionalTest(deqp::Context& context);
359 virtual tcu::TestNode::IterateResult iterate();
362 /* Private member functions */
363 FunctionalTest(const FunctionalTest& other);
364 FunctionalTest& operator=(const FunctionalTest& other);
366 /* Function pointers type definitions and declarations. */
367 typedef void(GLW_APIENTRY* GetTransformFeedbackiv_ProcAddress)(glw::GLuint xfb, glw::GLenum pname,
369 typedef void(GLW_APIENTRY* TransformFeedbackBufferBase_ProcAddress)(glw::GLuint xfb, glw::GLuint index,
372 GetTransformFeedbackiv_ProcAddress m_gl_getTransformFeedbackiv;
373 TransformFeedbackBufferBase_ProcAddress m_gl_TransformFeedbackBufferBase;
375 /* Private member variables. */
376 glw::GLuint m_xfb_dsa;
381 /* Private member functions. */
382 void prepareFunctionPointers();
383 void prepareTransformFeedback();
384 void prepareBuffer();
385 void prepareProgram();
386 void prepareVertexArrayObject();
389 bool testTransformFeedbackStatus(glw::GLenum parameter_name, glw::GLint expected_value);
390 bool verifyBufferContent();
394 /* Private static variables. */
395 static const glw::GLuint s_bo_size;
396 static const glw::GLchar s_vertex_shader[];
397 static const glw::GLchar s_fragment_shader[];
398 static const glw::GLchar* const s_xfb_varying;
400 /* FunctionalTest class */
401 } /* xfb namespace */
405 /** @class CreationTest
407 * @brief Direct State Access Sampler Objects Creation test cases.
409 * Test follows the steps:
411 * Create at least two Sampler Objects names using GenSamplers function.
412 * Check them without binding, using IsSampler function. Expect GL_FALSE.
414 * Create at least two Sampler Objects using CreateSamplers function. Check
415 * them without binding, using IsSampler function. Expect GL_TRUE.
419 class CreationTest : public deqp::TestCase
422 /* Public member functions */
423 CreationTest(deqp::Context& context);
425 virtual tcu::TestNode::IterateResult iterate();
428 /* Private member functions */
429 CreationTest(const CreationTest& other);
430 CreationTest& operator=(const CreationTest& other);
432 /* CreationTest class */
434 /** @class DefaultsTest
436 * @brief Direct State Access Sampler Objects Default State test.
438 * Test follows the steps:
440 * Create Sampler Object with CreateSamplers function.
442 * Verify that default value of TEXTURE_BORDER_COLOR queried with function
443 * GetSamplerParameterfv is 0.0, 0.0, 0.0, 0.0.
445 * Verify that default value of TEXTURE_COMPARE_FUNC queried with function
446 * GetSamplerParameteriv is LEQUAL.
448 * Verify that default value of TEXTURE_COMPARE_MODE queried with function
449 * GetSamplerParameteriv is NONE.
451 * Verify that default value of TEXTURE_LOD_BIAS queried with function
452 * GetSamplerParameterfv is 0.0.
454 * Verify that default value of TEXTURE_MAX_LOD queried with function
455 * GetSamplerParameterfv is 1000.
457 * Verify that default value of TEXTURE_MAG_FILTER queried with function
458 * GetSamplerParameteriv is LINEAR.
460 * Verify that default value of TEXTURE_MIN_FILTER queried with function
461 * GetSamplerParameteriv is NEAREST_MIPMAP_LINEAR.
463 * Verify that default value of TEXTURE_MIN_LOD queried with function
464 * GetSamplerParameterfv is -1000.
466 * Verify that default value of TEXTURE_WRAP_S queried with function
467 * GetSamplerParameteriv is REPEAT.
469 * Verify that default value of TEXTURE_WRAP_T queried with function
470 * GetSamplerParameteriv is REPEAT.
472 * Verify that default value of TEXTURE_WRAP_R queried with function
473 * GetSamplerParameteriv is REPEAT.
477 class DefaultsTest : public deqp::TestCase
480 /* Public member functions */
481 DefaultsTest(deqp::Context& context);
483 virtual tcu::TestNode::IterateResult iterate();
486 /* Private member functions */
487 DefaultsTest(const DefaultsTest& other);
488 DefaultsTest& operator=(const DefaultsTest& other);
490 /* Private member variables */
491 glw::GLuint m_sampler_dsa;
493 /* Private member functions. */
495 bool testSamplerIntegerParameter(glw::GLenum pname, glw::GLint expected_value);
496 bool testSamplerFloatParameter(glw::GLenum pname, glw::GLfloat expected_value);
497 bool testSamplerFloatVectorParameter(glw::GLenum pname, glw::GLfloat expected_value[4]);
500 /* DefaultsTest class */
502 /** @class ErrorsTest
504 * @brief Direct State Access Samplers Negative test.
506 * The test follows steps:
508 * Check that CreateSamplers generates INVALID_VALUE error if
509 * number of sampler objects to create is negative.
511 class ErrorsTest : public deqp::TestCase
514 /* Public member functions */
515 ErrorsTest(deqp::Context& context);
517 virtual tcu::TestNode::IterateResult iterate();
520 /* Private member functions */
521 ErrorsTest(const ErrorsTest& other);
522 ErrorsTest& operator=(const ErrorsTest& other);
524 /* ErrorsTest class */
526 /** @class FunctionalTest
528 * @brief Direct State Access Samplers Functional test cases.
530 * @note The test follows steps:
532 * Create framebuffer with renderbuffer with color attachment and 1x1 pixel
533 * size. Clean framebuffer content with black color.
535 * Create and bind empty vertex array object.
537 * Build and use simple GLSL program drawing full screen textured quad
538 * depending on VertexID. Fragment shader shall output texture point at
541 * Create texture 2 x 2 texels in size. Bind it. Upload texture with
542 * following color data:
546 * Create Sampler object using CreateSamplers function and bind it to the
547 * texture unit. Setup following sampler parameters:
548 * * TEXTURE_WRAP_S to the value of REPEAT,
549 * * TEXTURE_WRAP_T to REPEAT,
550 * * TEXTURE_MIN_FILTER to NEAREST,
551 * * TEXTURE_MAG_FILTER to NEAREST.
553 * Draw full screen quad.
555 * Fetch framebuffer content with ReadPixels function. Check that,
556 * framebuffer is filled with red color.
560 class FunctionalTest : public deqp::TestCase
563 /* Public member functions */
564 FunctionalTest(deqp::Context& context);
566 virtual tcu::TestNode::IterateResult iterate();
569 /* Private member functions. */
570 FunctionalTest(const FunctionalTest& other);
571 FunctionalTest& operator=(const FunctionalTest& other);
573 void prepareFramebuffer();
574 void prepareVertexArrayObject();
575 void prepareProgram();
576 void prepareTexture();
577 void prepareSampler();
579 bool checkFramebufferContent();
582 /* Private member variables. */
590 /* Private static variables. */
591 static const glw::GLchar s_vertex_shader[];
592 static const glw::GLchar s_fragment_shader[];
593 static const glw::GLchar s_uniform_sampler[];
594 static const glw::GLubyte s_texture_data[];
596 /* FunctionalTest class */
597 } /* Samplers namespace */
599 namespace ProgramPipelines
601 /** @class CreationTest
603 * @brief Direct State Access Program Pipeline Objects Creation test cases.
605 * @note Test follows the steps:
607 * Create at least two Program Pipeline Objects names using
608 * GenProgramPipelines function. Check them without binding, using
609 * IsProgramPipeline function. Expect GL_FALSE.
611 * Create at least two Program Pipeline Objects using
612 * CreateProgramPipelines function. Check them without binding, using
613 * IsProgramPipeline function. Expect GL_TRUE.
617 class CreationTest : public deqp::TestCase
620 /* Public member functions */
621 CreationTest(deqp::Context& context);
623 virtual tcu::TestNode::IterateResult iterate();
626 /* Private member functions */
627 CreationTest(const CreationTest& other);
628 CreationTest& operator=(const CreationTest& other);
630 /* CreationTest class */
632 /** @class DefaultsTest
634 * @brief Direct State Access Program Pipeline Objects Default State test.
636 * @note Test follows the steps:
638 * Create Program Pipeline Object with CreateProgramPipelines function.
640 * Verify that default value of ACTIVE_PROGRAM queried with function
641 * GetProgramPipelineiv is 0.
643 * Verify that default value of VERTEX_SHADER queried with function
644 * GetProgramPipelineiv is 0.
646 * Verify that default value of GEOMETRY_SHADER queried with function
647 * GetProgramPipelineiv is 0.
649 * Verify that default value of FRAGMENT_SHADER queried with function
650 * GetProgramPipelineiv is 0.
652 * Verify that default value of COMPUTE_SHADER queried with function
653 * GetProgramPipelineiv is 0.
655 * Verify that default value of TESS_CONTROL_SHADER queried with function
656 * GetProgramPipelineiv is 0.
658 * Verify that default value of TESS_EVALUATION_SHADER queried with
659 * function GetProgramPipelineiv is 0.
661 * Verify that default value of VALIDATE_STATUS queried with function
662 * GetProgramPipelineiv is 0.
664 * Verify that default value of info log queried with function
665 * GetProgramPiplineInfoLog is 0.
667 * Verify that default value of INFO_LOG_LENGTH queried with function
668 * GetProgramPipelineiv is 0.
672 class DefaultsTest : public deqp::TestCase
675 /* Public member functions */
676 DefaultsTest(deqp::Context& context);
678 virtual tcu::TestNode::IterateResult iterate();
681 /* Private member functions */
682 DefaultsTest(const DefaultsTest& other);
683 DefaultsTest& operator=(const DefaultsTest& other);
685 /* Private member variables */
686 glw::GLuint m_program_pipeline_dsa;
688 /* Private member functions. */
690 bool testProgramPipelineParameter(glw::GLenum pname, glw::GLint expected_value);
691 bool testProgramPipelineInfoLog(glw::GLchar* expected_value);
694 /* DefaultsTest class */
696 /** @class ErrorsTest
698 * @brief Direct State Access Program Pipeline Negative test.
700 * The test follows steps:
702 * Check that CreateProgramPipelines generates INVALID_VALUE error if
703 * number of program pipeline objects to create is negative.
705 class ErrorsTest : public deqp::TestCase
708 /* Public member functions */
709 ErrorsTest(deqp::Context& context);
711 virtual tcu::TestNode::IterateResult iterate();
714 /* Private member functions */
715 ErrorsTest(const ErrorsTest& other);
716 ErrorsTest& operator=(const ErrorsTest& other);
718 /* ErrorsTest class */
720 /** @class FunctionalTest
722 * @brief Direct State Access Program Pipeline Functional test cases.
724 * @note The test follows steps:
726 * Create framebuffer with renderbuffer with color attachment and 1x1 pixel
727 * size. Clean framebuffer content with black color.
729 * Create and bind empty vertex array object.
731 * Make sure that no GLSL program is being used.
733 * Create two shader programs (with CreateShaderProgramv) - one vertex
734 * shader and one fragment shader. The vertex shader shall output full
735 * screen quad depending on VertexID. The fragment shader shall output red
738 * Create the Program Pipeline Object using CreateProgramPipelines
739 * function. Bind it using BindProgramPipeline. Setup Program Pipeline
740 * with the created shader programs using UseProgramStages.
742 * Draw full screen quad.
744 * Fetch framebuffer content with ReadPixels function. Check that,
745 * framebuffer is filled with red color.
749 class FunctionalTest : public deqp::TestCase
752 /* Public member functions */
753 FunctionalTest(deqp::Context& context);
755 virtual tcu::TestNode::IterateResult iterate();
758 /* Private member functions. */
759 FunctionalTest(const FunctionalTest& other);
760 FunctionalTest& operator=(const FunctionalTest& other);
762 void prepareFramebuffer();
763 void prepareVertexArrayObject();
764 void prepareShaderPrograms();
765 void preparePipeline();
767 bool checkFramebufferContent();
770 /* Private member variables. */
778 /* Private static variables. */
779 static const glw::GLchar* s_vertex_shader;
780 static const glw::GLchar* s_fragment_shader;
782 /* FunctionalTest class */
783 } /* ProgramPipelines namespace */
787 /** @class CreationTest
789 * @brief Direct State Access Queries Creation test cases.
791 * @note Test follows the steps:
793 * Create at least two Query Objects names using GenQueries function.
794 * Check them without binding, using IsQuery function. Expect GL_FALSE.
796 * Create at least two Query Objects using CreateQueries function. Check
797 * them without binding, using IsQuery function. Expect GL_TRUE.
801 * Repeat test for all of following supported targets:
803 * - ANY_SAMPLES_PASSED,
804 * - ANY_SAMPLES_PASSED_CONSERVATIVE,
807 * - PRIMITIVES_GENERATED and
808 * - TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN.
810 * See Ref. OpenGL 4.5 Core Profile, Section 4.2.
812 class CreationTest : public deqp::TestCase
815 /* Public member functions */
816 CreationTest(deqp::Context& context);
818 virtual tcu::TestNode::IterateResult iterate();
821 /* Private member functions */
822 CreationTest(const CreationTest& other);
823 CreationTest& operator=(const CreationTest& other);
825 /* CreationTest class */
827 /** @class DefaultsTest
829 * @brief Direct State Access Queries Default State test.
831 * @note Test follows the steps:
833 * Create Query Object with CreateQueries function.
835 * Verify that default value of QUERY_RESULT queried with function
836 * GetQueryObjectuiv is 0 or FALSE.
838 * Verify that default value of QUERY_RESULT_AVAILABLE queried with
839 * function GetQueryObjectiv is TRUE.
843 * Repeat test for all of following supported targets:
845 * - ANY_SAMPLES_PASSED,
846 * - ANY_SAMPLES_PASSED_CONSERVATIVE,
849 * - PRIMITIVES_GENERATED and
850 * - TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN.
852 * See Ref. OpenGL 4.5 Core Profile, Section 4.2.
854 class DefaultsTest : public deqp::TestCase
857 /* Public member functions */
858 DefaultsTest(deqp::Context& context);
860 virtual tcu::TestNode::IterateResult iterate();
863 /* Private member functions */
864 DefaultsTest(const DefaultsTest& other);
865 DefaultsTest& operator=(const DefaultsTest& other);
867 /* Private member variables */
868 glw::GLuint m_query_dsa;
870 /* Private member functions. */
871 void prepare(const glw::GLenum target);
872 bool testQueryParameter(const glw::GLenum pname, const glw::GLuint expected_value, const glw::GLchar* target_name);
875 /* DefaultsTest class */
877 /** @class ErrorsTest
879 * @brief Direct State Access Queries Negative test.
881 * @note The test follows steps:
883 * Check that CreateQueries generates INVALID_VALUE error if number of
884 * query objects to create is negative.
886 * Check that CreateQueries generates INVALID_ENUM error if target is not
887 * one of accepted values:
889 * - ANY_SAMPLES_PASSED,
890 * - ANY_SAMPLES_PASSED_CONSERVATIVE,
893 * - PRIMITIVES_GENERATED or
894 * - TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN.
896 * Check that GetQueryBufferObjectiv, GetQueryBufferObjectuiv,
897 * GetQueryBufferObjecti64v and GetQueryBufferObjectui64v generate
898 * INVALID_OPERATION error if <id> is not the name of a query object, or
899 * if the query object named by <id> is currently active.
901 * Check that GetQueryBufferObjectiv, GetQueryBufferObjectuiv,
902 * GetQueryBufferObjecti64v and GetQueryBufferObjectui64v generate
903 * INVALID_OPERATION error if <buffer> is not the name of an existing
906 * Check that GetQueryBufferObjectiv, GetQueryBufferObjectuiv,
907 * GetQueryBufferObjecti64v and GetQueryBufferObjectui64v generate
908 * INVALID_ENUM error if <pname> is not QUERY_RESULT,
909 * QUERY_RESULT_AVAILABLE, QUERY_RESULT_NO_WAIT or QUERY_TARGET.
911 * Check that GetQueryBufferObjectiv, GetQueryBufferObjectuiv,
912 * GetQueryBufferObjecti64v and GetQueryBufferObjectui64v generate
913 * INVALID_OPERATION error if the query writes to a buffer object, and the
914 * specified buffer offset would cause data to be written beyond the bounds
915 * of that buffer object.
917 * Check that GetQueryBufferObjectiv, GetQueryBufferObjectuiv,
918 * GetQueryBufferObjecti64v and GetQueryBufferObjectui64v generate
919 * INVALID_VALUE error if <offset> is negative.
921 * See Ref. OpenGL 4.5 Core Profile, Section 4.2.
923 class ErrorsTest : public deqp::TestCase
926 /* Public member functions */
927 ErrorsTest(deqp::Context& context);
929 virtual tcu::TestNode::IterateResult iterate();
932 /* Private member functions */
933 ErrorsTest(const ErrorsTest& other);
934 ErrorsTest& operator=(const ErrorsTest& other);
936 /* Private member functions. */
937 bool testNegativeNumberOfObjects();
938 bool testInvalidTarget();
939 bool testInvalidQueryName();
940 bool testInvalidBufferName();
941 bool testInvalidParameterName();
942 bool testBufferOverflow();
943 bool testBufferNegativeOffset();
945 bool isTarget(glw::GLenum maybe_target);
946 bool isParameterName(glw::GLenum maybe_pname);
948 /* Function pointers. */
949 typedef void(GLW_APIENTRY* PFNGLGETQUERYBUFFEROBJECT)(glw::GLuint id, glw::GLuint buffer, glw::GLenum pname,
950 glw::GLintptr offset);
952 PFNGLGETQUERYBUFFEROBJECT m_pGetQueryBufferObjectiv;
953 PFNGLGETQUERYBUFFEROBJECT m_pGetQueryBufferObjectuiv;
954 PFNGLGETQUERYBUFFEROBJECT m_pGetQueryBufferObjecti64v;
955 PFNGLGETQUERYBUFFEROBJECT m_pGetQueryBufferObjectui64v;
957 /* Private static variables. */
958 static const glw::GLenum s_targets[];
959 static const glw::GLchar* s_target_names[];
960 static const glw::GLuint s_targets_count;
962 /* ErrorsTest class */
964 /** @class FunctionalTest
966 * @brief Direct State Access Queries Functional test cases.
968 * @note The test follows steps:
970 * Create framebuffer with renderbuffer with color attachment and 1x1 pixel
971 * size. Clean framebuffer content with black color.
973 * Create and bind empty vertex array object.
975 * Create buffer object. Bind it to TRANFORM_FEEDBACK_BUFFER binding point.
976 * Bind buffer base to TRANFORM_FEEDBACK_BUFFER binding point with index 0.
977 * Setup data storage of the buffer with size equal to 6 * sizeof(int).
979 * Build GLSL program consisting of vertex and fragment shader stages.
980 * Vertex shader shall output full screen quad depending on VertexID. The
981 * VertexID shall be saved to transform feedback varying. Fragment shader
982 * shall output red color.
984 * Create query objects with CreateQueries function for following targets:
986 * - PRIMITIVES_GENERATED,
987 * - TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN,
990 * Begin query for every target.
992 * Begin transform feedback for TRIANGLES primitive type.
994 * Draw full screen quad with TRIANGLE_STRIP primitive type.
996 * End transform feedback.
1000 * Call Finish function.
1002 * Check that framebuffer is filled with red color.
1004 * Check that transform feedback buffer contains successive primitive
1005 * vertex ids (0, 1, 2, 2, 1, 3).
1007 * For every query objects, using GetQueryBufferObjectiv,
1008 * GetQueryBufferObjectuiv, GetQueryBufferObjecti64v,
1009 * GetQueryBufferObjectui64v functions do following comparisons:
1011 * Check that value of parameter QUERY_TARGET is equal to target.
1013 * Check that value of parameter QUERY_RESULT_AVAILABLE is TRUE.
1015 * Check that value of parameter QUERY_RESULT and QUERY_RESULT_NO_WAIT:
1016 * - is equal to 1 if target is SAMPLES_PASSED; or
1017 * - is equal to 2 if target is PRIMITIVES_GENERATED or
1018 * TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN; or
1019 * - is positive if target is TIME_ELAPSED.
1023 class FunctionalTest : public deqp::TestCase
1026 /* Public member functions */
1027 FunctionalTest(deqp::Context& context);
1029 virtual tcu::TestNode::IterateResult iterate();
1032 /* Private member functions. */
1033 FunctionalTest(const FunctionalTest& other);
1034 FunctionalTest& operator=(const FunctionalTest& other);
1036 /* Function pointers. */
1037 typedef void(GLW_APIENTRY* PFNGLGETQUERYBUFFEROBJECT)(glw::GLuint id, glw::GLuint buffer, glw::GLenum pname,
1038 glw::GLintptr offset);
1040 PFNGLGETQUERYBUFFEROBJECT m_pGetQueryBufferObjectiv;
1041 PFNGLGETQUERYBUFFEROBJECT m_pGetQueryBufferObjectuiv;
1042 PFNGLGETQUERYBUFFEROBJECT m_pGetQueryBufferObjecti64v;
1043 PFNGLGETQUERYBUFFEROBJECT m_pGetQueryBufferObjectui64v;
1045 /* Private templated functions. */
1046 template <typename T>
1047 static bool equal(T, T);
1049 template <typename T>
1050 static bool less(T, T);
1052 template <typename T>
1053 void GetQueryBufferObject(glw::GLuint id, glw::GLuint buffer, glw::GLenum pname, glw::GLintptr offset);
1055 template <typename T>
1056 bool checkQueryBufferObject(glw::GLuint query, glw::GLenum pname, T expected_value, bool (*comparison)(T, T));
1058 /* Private member functions. */
1060 void prepareVertexArray();
1061 void prepareBuffers();
1062 void prepareQueries();
1063 void prepareProgram();
1069 /* Private member variables. */
1073 glw::GLuint m_bo_query;
1074 glw::GLuint m_bo_xfb;
1078 /* Private static variables. */
1079 static const glw::GLenum s_targets[];
1080 static const glw::GLuint s_targets_count;
1082 static const glw::GLint s_results[];
1084 static const glw::GLchar s_vertex_shader[];
1085 static const glw::GLchar s_fragment_shader[];
1086 static const glw::GLchar* s_xfb_varying_name;
1088 /* FunctionalTest class */
1089 } /* Queries namespace */
1093 /** @class CreationTest
1095 * @brief Direct State Access Buffers Creation test cases.
1097 * Test follows the steps:
1099 * Create at least two buffer objects using GenBuffers function. Check
1100 * them without binding, using IsBuffer function. Expect GL_FALSE.
1102 * Create at least two buffer objects using CreateBuffers function. Check
1103 * them without binding, using IsBuffer function. Expect GL_TRUE.
1107 class CreationTest : public deqp::TestCase
1110 /* Public member functions */
1111 CreationTest(deqp::Context& context);
1113 virtual tcu::TestNode::IterateResult iterate();
1116 /* Private member functions */
1117 CreationTest(const CreationTest& other);
1118 CreationTest& operator=(const CreationTest& other);
1120 /* CreationTest class */
1124 * @brief Direct State Access Buffers Data test cases.
1126 * Test follows the steps:
1128 * Prepare test case with following steps:
1130 * Create buffer object using CreateBuffers.
1132 * Create data storage using given function and reference data.
1136 * Check buffer content using MapBuffer function.
1140 * Repeat the test case with function for data creation:
1141 * - NamedBufferData,
1142 * - NamedBufferData and it with NamedBufferSubData,
1143 * - NamedBufferStorage,
1144 * - CopyNamedBufferSubData from auxiliary buffer.
1146 * If NamedBufferData function is used then repeat the test case for
1155 * - DYNAMIC_READ, and
1158 * If NamedBufferStorage function is used then repeat the test case using
1159 * flag MAP_READ_BIT and one of following:
1160 * - DYNAMIC_STORAGE_BIT,
1162 * - MAP_PERSISTENT_BIT,
1163 * - MAP_COHERENT_BIT and
1164 * - CLIENT_STORAGE_BIT.
1166 class DataTest : public deqp::TestCase
1169 /* Public member functions */
1170 DataTest(deqp::Context& context);
1172 virtual tcu::TestNode::IterateResult iterate();
1175 /* Private member functions */
1176 DataTest(const DataTest& other);
1177 DataTest& operator=(const DataTest& other);
1179 typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLsizei size, const glw::GLvoid* data,
1181 typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERSUBDATA)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei size,
1182 const glw::GLvoid* data);
1183 typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERSTORAGE)(glw::GLuint buffer, glw::GLsizeiptr size,
1184 const glw::GLvoid* data, glw::GLbitfield flags);
1185 typedef void(GLW_APIENTRY* PFNGLCOPYNAMEDBUFFERSUBDATA)(glw::GLuint readBuffer, glw::GLuint writeBuffer,
1186 glw::GLintptr readOffset, glw::GLintptr writeOffset,
1187 glw::GLsizeiptr size);
1189 PFNGLNAMEDBUFFERDATA m_pNamedBufferData;
1190 PFNGLNAMEDBUFFERSUBDATA m_pNamedBufferSubData;
1191 PFNGLNAMEDBUFFERSTORAGE m_pNamedBufferStorage;
1192 PFNGLCOPYNAMEDBUFFERSUBDATA m_pCopyNamedBufferSubData;
1194 bool TestCase(void (DataTest::*UploadDataFunction)(glw::GLuint, glw::GLenum), glw::GLenum parameter);
1196 void UploadUsingNamedBufferData(glw::GLuint id, glw::GLenum parameter);
1197 void UploadUsingNamedBufferSubData(glw::GLuint id, glw::GLenum parameter);
1198 void UploadUsingNamedBufferStorage(glw::GLuint id, glw::GLenum parameter);
1199 void UploadUsingCopyNamedBufferSubData(glw::GLuint id, glw::GLenum parameter);
1201 bool compare(const glw::GLuint* data, const glw::GLuint* reference, const glw::GLsizei count);
1202 void LogFail(void (DataTest::*UploadDataFunction)(glw::GLuint, glw::GLenum), glw::GLenum parameter,
1203 const glw::GLuint* data, const glw::GLuint* reference, const glw::GLsizei count);
1204 void LogError(void (DataTest::*UploadDataFunction)(glw::GLuint, glw::GLenum), glw::GLenum parameter);
1206 static const glw::GLuint s_reference[];
1207 static const glw::GLsizei s_reference_size;
1208 static const glw::GLsizei s_reference_count;
1210 /* DataTest class */
1212 /** @class ClearTest
1214 * @brief Direct State Access Buffers Clear test cases.
1216 * Test follows the steps:
1218 * Prepare test case with following steps:
1220 * Create buffer object using CreateBuffers.
1222 * Create data storage using NamedBufferData without data
1225 * Clear buffer content using given function.
1229 * Check buffer content using MapBuffer function.
1233 * Repeat test case for following clear functions:
1234 * - ClearNamedBufferData and
1235 * - ClearNamedBufferSubData.
1237 * Repeat test case for following internal formats:
1272 class ClearTest : public deqp::TestCase
1275 /* Public member functions */
1276 ClearTest(deqp::Context& context);
1278 virtual tcu::TestNode::IterateResult iterate();
1281 /* Private member functions */
1282 ClearTest(const ClearTest& other);
1283 ClearTest& operator=(const ClearTest& other);
1285 typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLsizei size, const glw::GLvoid* data,
1287 typedef void(GLW_APIENTRY* PFNGLCLEARNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLenum internalformat,
1288 glw::GLenum format, glw::GLenum type,
1289 const glw::GLvoid* data);
1290 typedef void(GLW_APIENTRY* PFNGLCLEARNAMEDBUFFERSUBDATA)(glw::GLuint buffer, glw::GLenum internalformat,
1291 glw::GLintptr offset, glw::GLsizei size,
1292 glw::GLenum format, glw::GLenum type,
1293 const glw::GLvoid* data);
1295 PFNGLNAMEDBUFFERDATA m_pNamedBufferData;
1296 PFNGLCLEARNAMEDBUFFERDATA m_pClearNamedBufferData;
1297 PFNGLCLEARNAMEDBUFFERSUBDATA m_pClearNamedBufferSubData;
1299 template <typename T, bool USE_SUB_DATA>
1300 bool TestClearNamedBufferData(glw::GLenum internalformat, glw::GLsizei count, glw::GLenum format, glw::GLenum type,
1303 template <bool USE_SUB_DATA>
1304 void ClearNamedBuffer(glw::GLuint buffer, glw::GLenum internalformat, glw::GLsizei size, glw::GLenum format,
1305 glw::GLenum type, glw::GLvoid* data);
1307 template <typename T>
1308 bool Compare(const T* data, const T* reference, const glw::GLsizei count);
1310 template <typename T>
1311 void LogFail(bool use_sub_data, glw::GLenum internalformat, const T* data, const T* reference,
1312 const glw::GLsizei count);
1314 void LogError(bool use_sub_data, glw::GLenum internalformat);
1316 /* ClearTest class */
1318 /** @class MapReadOnlyTest
1320 * @brief Direct State Access Buffers Map Read Only test cases.
1322 * Test follows the steps:
1324 * Create buffer object using CreateBuffers.
1326 * Create data storage using NamedBufferData function and reference
1329 * Map buffer with MapNamedBuffer function and READ_ONLY access flag.
1331 * Compare mapped buffer content with reference data.
1333 * Unmap buffer using UnmapNamedBuffer. Test if UnmapNamedBuffer
1338 class MapReadOnlyTest : public deqp::TestCase
1341 /* Public member functions */
1342 MapReadOnlyTest(deqp::Context& context);
1344 virtual tcu::TestNode::IterateResult iterate();
1347 /* Private member functions */
1348 MapReadOnlyTest(const MapReadOnlyTest& other);
1349 MapReadOnlyTest& operator=(const MapReadOnlyTest& other);
1351 /* API entry points. */
1352 typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLsizei size, const glw::GLvoid* data,
1354 typedef void*(GLW_APIENTRY* PFNGLMAPNAMEDBUFFER)(glw::GLuint buffer, glw::GLenum access);
1355 typedef glw::GLboolean(GLW_APIENTRY* PFNGLUNMAPNAMEDBUFFER)(glw::GLuint buffer);
1357 PFNGLNAMEDBUFFERDATA m_pNamedBufferData;
1358 PFNGLMAPNAMEDBUFFER m_pMapNamedBuffer;
1359 PFNGLUNMAPNAMEDBUFFER m_pUnmapNamedBuffer;
1361 static const glw::GLuint s_reference[]; //<! Reference data.
1362 static const glw::GLsizei s_reference_size; //<! Reference data size.
1363 static const glw::GLsizei s_reference_count; //<! Reference data count (number of GLuint elements).
1365 /* MapReadOnlyTest class */
1367 /** @class MapReadWriteTest
1369 * @brief Direct State Access Buffers Map Read Write test cases.
1371 * Test follows the steps:
1373 * Create buffer object using CreateBuffers.
1375 * Create data storage using NamedBufferData function and reference
1378 * Map buffer with MapNamedBuffer function and READ_WRITE access flag.
1380 * Compare mapped buffer content with reference.
1382 * Write to the mapped buffer inverted reference content.
1386 * Map buffer with MapNamedBuffer function and READ_WRITE access flag.
1388 * Compare mapped buffer content with inverted reference.
1394 class MapReadWriteTest : public deqp::TestCase
1397 /* Public member functions */
1398 MapReadWriteTest(deqp::Context& context);
1400 virtual tcu::TestNode::IterateResult iterate();
1403 /* Private member functions */
1404 MapReadWriteTest(const MapReadWriteTest& other);
1405 MapReadWriteTest& operator=(const MapReadWriteTest& other);
1407 /* API entry points. */
1408 typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLsizei size, const glw::GLvoid* data,
1410 typedef void*(GLW_APIENTRY* PFNGLMAPNAMEDBUFFER)(glw::GLuint buffer, glw::GLenum access);
1411 typedef glw::GLboolean(GLW_APIENTRY* PFNGLUNMAPNAMEDBUFFER)(glw::GLuint buffer);
1413 PFNGLNAMEDBUFFERDATA m_pNamedBufferData;
1414 PFNGLMAPNAMEDBUFFER m_pMapNamedBuffer;
1415 PFNGLUNMAPNAMEDBUFFER m_pUnmapNamedBuffer;
1417 static const glw::GLuint s_reference[]; //<! Reference data.
1418 static const glw::GLsizei s_reference_size; //<! Reference data size.
1419 static const glw::GLsizei s_reference_count; //<! Reference data count (number of GLuint elements).
1421 /* MapReadWriteTest class */
1423 /** @class MapWriteOnlyTest
1425 * @brief Direct State Access Buffers Map Write Only test cases.
1427 * Test follows the steps:
1429 * Create buffer object using CreateBuffers.
1431 * Create data storage using NamedBufferData function.
1433 * Map buffer with MapNamedBuffer function and WRITE_ONLY access flag.
1435 * Write reference data.
1439 * Bind buffer to the binding point.
1441 * Map buffer with MapBuffer function and READ_ONLY access flag.
1443 * Compare mapped buffer content with reference.
1449 class MapWriteOnlyTest : public deqp::TestCase
1452 /* Public member functions */
1453 MapWriteOnlyTest(deqp::Context& context);
1455 virtual tcu::TestNode::IterateResult iterate();
1458 /* Private member functions */
1459 MapWriteOnlyTest(const MapWriteOnlyTest& other);
1460 MapWriteOnlyTest& operator=(const MapWriteOnlyTest& other);
1462 /* API entry points. */
1463 typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLsizei size, const glw::GLvoid* data,
1465 typedef void*(GLW_APIENTRY* PFNGLMAPNAMEDBUFFER)(glw::GLuint buffer, glw::GLenum access);
1466 typedef glw::GLboolean(GLW_APIENTRY* PFNGLUNMAPNAMEDBUFFER)(glw::GLuint buffer);
1468 PFNGLNAMEDBUFFERDATA m_pNamedBufferData;
1469 PFNGLMAPNAMEDBUFFER m_pMapNamedBuffer;
1470 PFNGLUNMAPNAMEDBUFFER m_pUnmapNamedBuffer;
1472 static const glw::GLuint s_reference[]; //<! Reference data.
1473 static const glw::GLsizei s_reference_size; //<! Reference data size.
1474 static const glw::GLsizei s_reference_count; //<! Reference data count (number of GLuint elements).
1476 /* MapReadOnlyTest class */
1478 /** @class MapRangeReadBitTest
1480 * @brief Direct State Access Buffers Range Map Read Bit test cases.
1482 * Test follows the steps:
1484 * Create buffer object using CreateBuffers.
1486 * Create data storage using NamedBufferStorage function, reference
1487 * data and MAP_READ_BIT access flag.
1489 * Map first half of buffer with MapNamedBufferRange and MAP_READ_BIT
1492 * Compare mapped buffer content with reference.
1496 * Map second half of buffer with MapNamedBufferRange and MAP_READ_BIT
1499 * Compare mapped buffer content with reference.
1505 * Repeat the test with also MAP_PERSISTENT_BIT flag turned on.
1507 * Repeat the test with also MAP_PERSISTENT_BIT and MAP_COHERENT_BIT
1510 class MapRangeReadBitTest : public deqp::TestCase
1513 /* Public member functions */
1514 MapRangeReadBitTest(deqp::Context& context);
1516 virtual tcu::TestNode::IterateResult iterate();
1519 /* Private member functions */
1520 MapRangeReadBitTest(const MapRangeReadBitTest& other);
1521 MapRangeReadBitTest& operator=(const MapRangeReadBitTest& other);
1523 /* API entry points. */
1524 typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERSTORAGE)(glw::GLuint buffer, glw::GLsizeiptr size,
1525 const glw::GLvoid* data, glw::GLbitfield flags);
1526 typedef void*(GLW_APIENTRY* PFNGLMAPNAMEDBUFFERRANGE)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei length,
1527 glw::GLbitfield access);
1528 typedef glw::GLboolean(GLW_APIENTRY* PFNGLUNMAPNAMEDBUFFER)(glw::GLuint buffer);
1530 PFNGLNAMEDBUFFERSTORAGE m_pNamedBufferStorage;
1531 PFNGLMAPNAMEDBUFFERRANGE m_pMapNamedBufferRange;
1532 PFNGLUNMAPNAMEDBUFFER m_pUnmapNamedBuffer;
1534 bool CompareWithReference(glw::GLuint* data, glw::GLintptr offset, glw::GLsizei length);
1536 static const glw::GLuint s_reference[]; //<! Reference data.
1537 static const glw::GLsizei s_reference_size; //<! Reference data size.
1538 static const glw::GLsizei s_reference_count; //<! Reference data count (number of GLuint elements).
1540 /* MapRangeReadBitTest class */
1542 /** @class MapRangeWriteBitTest
1544 * @brief Direct State Access Buffers Range Map Read Bit test cases.
1546 * Test follows the steps:
1548 * Create buffer object using CreateBuffers.
1550 * Create data storage using NamedBufferStorage function, reference
1551 * data and (MAP_READ_BIT | MAP_WRITE_BIT) access flag.
1553 * Map first half of buffer with MapNamedBufferRange and MAP_WRITE_BIT
1556 * Write reference data.
1560 * Map second half of buffer with MapNamedBufferRange and MAP_WRITE_BIT
1563 * Write reference data.
1567 * Bind buffer to the binding point.
1569 * Map buffer with MapBuffer function and READ_ONLY access flag.
1571 * Compare mapped buffer content with reference.
1577 * Repeat the test with also MAP_INVALIDATE_RANGE_BIT flag turned on.
1579 * Repeat the test with also MAP_INVALIDATE_BUFFER_BIT flag turned on with
1580 * only the first mapping.
1582 * Repeat the test with also MAP_FLUSH_EXPLICIT_BIT flag turned on. Make
1583 * sure that all writes are flushed using FlushNamedMappedBufferRange
1586 * Repeat the test with also MAP_UNSYNCHRONIZED_BIT flag turned on with
1587 * only the second mapping.
1589 class MapRangeWriteBitTest : public deqp::TestCase
1592 /* Public member functions */
1593 MapRangeWriteBitTest(deqp::Context& context);
1595 virtual tcu::TestNode::IterateResult iterate();
1598 /* Private member functions */
1599 MapRangeWriteBitTest(const MapRangeWriteBitTest& other);
1600 MapRangeWriteBitTest& operator=(const MapRangeWriteBitTest& other);
1602 /* API entry points. */
1603 typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERSTORAGE)(glw::GLuint buffer, glw::GLsizeiptr size,
1604 const glw::GLvoid* data, glw::GLbitfield flags);
1605 typedef void*(GLW_APIENTRY* PFNGLMAPNAMEDBUFFERRANGE)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei length,
1606 glw::GLbitfield access);
1607 typedef glw::GLboolean(GLW_APIENTRY* PFNGLUNMAPNAMEDBUFFER)(glw::GLuint buffer);
1608 typedef void(GLW_APIENTRY* PFNGLFLUSHMAPPEDNAMEDBUFFERRANGE)(glw::GLuint buffer, glw::GLintptr offset,
1609 glw::GLsizei length);
1611 PFNGLNAMEDBUFFERSTORAGE m_pNamedBufferStorage;
1612 PFNGLMAPNAMEDBUFFERRANGE m_pMapNamedBufferRange;
1613 PFNGLUNMAPNAMEDBUFFER m_pUnmapNamedBuffer;
1614 PFNGLFLUSHMAPPEDNAMEDBUFFERRANGE m_pFlushMappedNamedBufferRange;
1616 bool CompareWithReference(glw::GLuint buffer, glw::GLbitfield access_flag);
1618 static const glw::GLuint s_reference[]; //<! Reference data.
1619 static const glw::GLsizei s_reference_size; //<! Reference data size.
1620 static const glw::GLsizei s_reference_count; //<! Reference data count (number of GLuint elements).
1622 /* MapRangeWriteBitTest class */
1624 /** @class SubDataQueryTest
1626 * @brief Direct State Access GetNamedBufferSubData Query test cases.
1628 * Test follows the steps:
1630 * Create buffer object using CreateBuffers.
1632 * Create data storage using NamedBufferData function and reference data.
1634 * Fetch first half of the buffer using GetNamedBufferSubData function.
1636 * Fetch second half of the buffer using GetNamedBufferSubData function.
1638 * Compare fetched data with reference values.
1642 class SubDataQueryTest : public deqp::TestCase
1645 /* Public member functions */
1646 SubDataQueryTest(deqp::Context& context);
1648 virtual tcu::TestNode::IterateResult iterate();
1651 /* Private member functions */
1652 SubDataQueryTest(const SubDataQueryTest& other);
1653 SubDataQueryTest& operator=(const SubDataQueryTest& other);
1655 /* API entry points. */
1656 typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLsizei size, const glw::GLvoid* data,
1658 typedef void*(GLW_APIENTRY* PFNGLGETNAMEDBUFFERSUBDATA)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei size,
1661 PFNGLNAMEDBUFFERDATA m_pNamedBufferData;
1662 PFNGLGETNAMEDBUFFERSUBDATA m_pGetNamedBufferSubData;
1664 static const glw::GLuint s_reference[]; //<! Reference data.
1665 static const glw::GLsizei s_reference_size; //<! Reference data size.
1666 static const glw::GLsizei s_reference_count; //<! Reference data count (number of GLuint elements).
1668 /* SubDataQueryTest class */
1670 /** @class DefaultsTest
1672 * @brief Direct State Access Buffer Objects Default Values Test.
1674 * Test follows the steps:
1676 * Create buffer object using CreateBuffers.
1678 * Check that GetNamedBufferParameteriv and GetNamedBufferParameteri64v
1679 * function called with parameter name
1680 * - BUFFER_SIZE returns value equal to 0;
1681 * - BUFFER_USAGE returns value equal to STATIC_DRAW;
1682 * - BUFFER_ACCESS returns value equal to READ_WRITE;
1683 * - BUFFER_ACCESS_FLAGS returns value equal to 0;
1684 * - BUFFER_IMMUTABLE_STORAGE returns value equal to FALSE;
1685 * - BUFFER_MAPPED returns value equal to FALSE;
1686 * - BUFFER_MAP_OFFSET returns value equal to 0;
1687 * - BUFFER_MAP_LENGTH returns value equal to 0;
1688 * - BUFFER_STORAGE_FLAGS returns value equal to 0.
1690 * Check that GetNamedBufferPointerv function called with parameter name
1691 * BUFFER_MAP_POINTER returns value equal to NULL;
1693 class DefaultsTest : public deqp::TestCase
1696 /* Public member functions */
1697 DefaultsTest(deqp::Context& context);
1699 virtual tcu::TestNode::IterateResult iterate();
1702 /* Private member functions */
1703 DefaultsTest(const DefaultsTest& other);
1704 DefaultsTest& operator=(const DefaultsTest& other);
1706 bool CheckParameterError(const glw::GLchar* pname_string, const glw::GLchar* function_string);
1708 template <typename T>
1709 bool CheckValue(const T value, const T reference_value, const glw::GLchar* pname_string,
1710 const glw::GLchar* function_string);
1712 /* API entry points. */
1713 typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLsizei size, const glw::GLvoid* data,
1715 typedef void(GLW_APIENTRY* PFNGLGETNAMEDBUFFERPARAMETERI64V)(glw::GLuint buffer, glw::GLenum pname,
1716 glw::GLint64* data);
1717 typedef void(GLW_APIENTRY* PFNGLGETNAMEDBUFFERPARAMETERIV)(glw::GLuint buffer, glw::GLenum pname, glw::GLint* data);
1718 typedef void(GLW_APIENTRY* PFNGLGETNAMEDBUFFERPOINTERV)(glw::GLuint buffer, glw::GLenum pname,
1719 glw::GLvoid** params);
1721 PFNGLNAMEDBUFFERDATA m_pNamedBufferData;
1722 PFNGLGETNAMEDBUFFERPARAMETERI64V m_pGetNamedBufferParameteri64v;
1723 PFNGLGETNAMEDBUFFERPARAMETERIV m_pGetNamedBufferParameteriv;
1724 PFNGLGETNAMEDBUFFERPOINTERV m_pGetNamedBufferPointerv;
1726 /* DefaultsTest class */
1728 /** @class ErrorsTest
1730 * @brief Direct State Access Buffer Objects Errors Test.
1732 * Test follows the steps:
1734 * Check that INVALID_VALUE is generated by CreateBuffers if n is negative.
1737 * Check that INVALID_OPERATION is generated by NamedBufferStorage if
1738 * buffer is not the name of an existing buffer object.
1740 * Check that INVALID_VALUE is generated by NamedBufferStorage if size is
1741 * less than or equal to zero.
1743 * Check that INVALID_VALUE is generated by NamedBufferStorage if flags has
1744 * any bits set other than DYNAMIC_STORAGE_BIT, MAP_READ_BIT,
1745 * MAP_WRITE_BIT, MAP_PERSISTENT_BIT, MAP_COHERENT_BIT or
1746 * CLIENT_STORAGE_BIT.
1748 * Check that INVALID_VALUE error is generated by NamedBufferStorage if
1749 * flags contains MAP_PERSISTENT_BIT but does not contain at least one of
1750 * MAP_READ_BIT or MAP_WRITE_BIT.
1752 * Check that INVALID_VALUE is generated by NamedBufferStorage if flags
1753 * contains MAP_COHERENT_BIT, but does not also contain MAP_PERSISTENT_BIT.
1755 * Check that OUT_OF_MEMORY is generated if the GL is unable to create a
1756 * data store with the specified size. Do not set result, if out of memory
1757 * situation was impossible to generate or unable to verify.
1760 * Check that INVALID_OPERATION is generated by NamedBufferData if buffer
1761 * is not the name of an existing buffer object.
1763 * Check that INVALID_ENUM is generated by NamedBufferData if usage is not
1764 * STREAM_DRAW, STREAM_READ, STREAM_COPY, STATIC_DRAW, STATIC_READ,
1765 * STATIC_COPY, DYNAMIC_DRAW, DYNAMIC_READ or DYNAMIC_COPY.
1767 * Check that INVALID_VALUE is generated by NamedBufferData if size is
1770 * Check that INVALID_OPERATION is generated by NamedBufferData if the
1771 * BUFFER_IMMUTABLE_STORAGE flag of the buffer object is TRUE.
1773 * Check that OUT_OF_MEMORY is generated if the GL is unable to create a
1774 * data store with the specified size. Do not set result, if out of memory
1775 * situation was impossible to generate or unable to verify.
1778 * Check that INVALID_OPERATION is generated by NamedBufferSubData if
1779 * buffer is not the name of an existing buffer object.
1781 * Check that INVALID_VALUE is generated by NamedBufferSubData if offset or
1782 * size is negative, or if offset+size is greater than the value of
1783 * BUFFER_SIZE for the specified buffer object.
1785 * Check that INVALID_OPERATION is generated by NamedBufferSubData if any
1786 * part of the specified range of the buffer object is mapped with
1787 * MapBufferRange or MapBuffer, unless it was mapped with the
1788 * MAP_PERSISTENT_BIT bit set in the MapBufferRange access flags.
1790 * Check that INVALID_OPERATION is generated by NamedBufferSubData if the
1791 * value of the BUFFER_IMMUTABLE_STORAGE flag of the buffer object is TRUE
1792 * and the value of BUFFER_STORAGE_FLAGS for the buffer object does not
1793 * have the DYNAMIC_STORAGE_BIT bit set.
1796 * Check that INVALID_OPERATION is generated by ClearNamedBufferData if
1797 * buffer is not the name of an existing buffer object.
1799 * Check that INVALID_ENUM is generated by ClearNamedBufferData if
1800 * internal format is not one of the valid sized internal formats listed in
1803 * Check that INVALID_OPERATION is generated by ClearNamedBufferData if
1804 * any part of the specified range of the buffer object is mapped with
1805 * MapBufferRange or MapBuffer, unless it was mapped with the
1806 * MAP_PERSISTENT_BIT bit set in the MapBufferRange access flags.
1808 * Check that INVALID_VALUE is generated by ClearNamedBufferData if
1809 * format is not a valid format, or type is not a valid type.
1812 * Check that INVALID_OPERATION is generated by ClearNamedBufferSubData
1813 * if buffer is not the name of an existing buffer object.
1815 * Check that INVALID_ENUM is generated by ClearNamedBufferSubData if
1816 * internal format is not one of the valid sized internal formats listed in
1819 * Check that INVALID_VALUE is generated by ClearNamedBufferSubData if
1820 * offset or range are not multiples of the number of basic machine units
1821 * per-element for the internal format specified by internal format. This
1822 * value may be computed by multiplying the number of components for
1823 * internal format from the table by the size of the base type from the
1824 * specification table.
1826 * Check that INVALID_VALUE is generated by ClearNamedBufferSubData if
1827 * offset or size is negative, or if offset+size is greater than the value
1828 * of BUFFER_SIZE for the buffer object.
1830 * Check that INVALID_OPERATION is generated by ClearNamedBufferSubData
1831 * if any part of the specified range of the buffer object is mapped with
1832 * MapBufferRange or MapBuffer, unless it was mapped with the
1833 * MAP_PERSISTENT_BIT bit set in the MapBufferRange access flags.
1835 * Check that INVALID_VALUE is generated by ClearNamedBufferSubData if
1836 * format is not a valid format, or type is not a valid type.
1839 * Check that INVALID_OPERATION is generated by CopyNamedBufferSubData if
1840 * readBuffer or writeBuffer is not the name of an existing buffer object.
1842 * Check that INVALID_VALUE is generated by CopyNamedBufferSubData if any of
1843 * readOffset, writeOffset or size is negative, if readOffset+size is
1844 * greater than the size of the source buffer object (its value of
1845 * BUFFER_SIZE), or if writeOffset+size is greater than the size of the
1846 * destination buffer object.
1848 * Check that INVALID_VALUE is generated by CopyNamedBufferSubData if the
1849 * source and destination are the same buffer object, and the ranges
1850 * [readOffset,readOffset+size) and [writeOffset,writeOffset+size) overlap.
1852 * Check that INVALID_OPERATION is generated by CopyNamedBufferSubData if
1853 * either the source or destination buffer object is mapped with
1854 * MapBufferRange or MapBuffer, unless they were mapped with the
1855 * MAP_PERSISTENT bit set in the MapBufferRange access flags.
1858 * Check that INVALID_OPERATION is generated by MapNamedBuffer if buffer is
1859 * not the name of an existing buffer object.
1861 * Check that INVALID_ENUM is generated by MapNamedBuffer if access is not
1862 * READ_ONLY, WRITE_ONLY, or READ_WRITE.
1864 * Check that INVALID_OPERATION is generated by MapNamedBuffer if the
1865 * buffer object is in a mapped state.
1868 * Check that INVALID_OPERATION is generated by MapNamedBufferRange if
1869 * buffer is not the name of an existing buffer object.
1871 * Check that INVALID_VALUE is generated by MapNamedBufferRange if offset
1872 * or length is negative, if offset+length is greater than the value of
1873 * BUFFER_SIZE for the buffer object, or if access has any bits set other
1874 * than those defined above.
1876 * Check that INVALID_OPERATION is generated by MapNamedBufferRange for any
1877 * of the following conditions:
1879 * - The buffer object is already in a mapped state.
1880 * - Neither MAP_READ_BIT nor MAP_WRITE_BIT is set.
1881 * - MAP_READ_BIT is set and any of MAP_INVALIDATE_RANGE_BIT,
1882 * MAP_INVALIDATE_BUFFER_BIT or MAP_UNSYNCHRONIZED_BIT is set.
1883 * - MAP_FLUSH_EXPLICIT_BIT is set and MAP_WRITE_BIT is not set.
1884 * - Any of MAP_READ_BIT, MAP_WRITE_BIT, MAP_PERSISTENT_BIT, or
1885 * MAP_COHERENT_BIT are set, but the same bit is not included in the
1886 * buffer's storage flags.
1889 * Check that INVALID_OPERATION is generated by UnmapNamedBuffer if buffer
1890 * is not the name of an existing buffer object.
1892 * Check that INVALID_OPERATION is generated by UnmapNamedBuffer if the
1893 * buffer object is not in a mapped state.
1896 * Check that INVALID_OPERATION is generated by FlushMappedNamedBufferRange
1897 * if buffer is not the name of an existing buffer object.
1899 * Check that INVALID_VALUE is generated by FlushMappedNamedBufferRange if
1900 * offset or length is negative, or if offset + length exceeds the size of
1903 * Check that INVALID_OPERATION is generated by FlushMappedNamedBufferRange
1904 * if the buffer object is not mapped, or is mapped without the
1905 * MAP_FLUSH_EXPLICIT_BIT flag.
1908 * Check that INVALID_OPERATION is generated by GetNamedBufferParameter* if
1909 * buffer is not the name of an existing buffer object.
1911 * Check that INVALID_ENUM is generated by GetNamedBufferParameter* if
1912 * pname is not one of the buffer object parameter names: BUFFER_ACCESS,
1913 * BUFFER_ACCESS_FLAGS, BUFFER_IMMUTABLE_STORAGE, BUFFER_MAPPED,
1914 * BUFFER_MAP_LENGTH, BUFFER_MAP_OFFSET, BUFFER_SIZE, BUFFER_STORAGE_FLAGS,
1918 * Check that INVALID_OPERATION is generated by GetNamedBufferPointerv
1919 * if buffer is not the name of an existing buffer object.
1922 * Check that INVALID_OPERATION is generated by GetNamedBufferSubData if
1923 * buffer is not the name of an existing buffer object.
1925 * Check that INVALID_VALUE is generated by GetNamedBufferSubData if offset
1926 * or size is negative, or if offset+size is greater than the value of
1927 * BUFFER_SIZE for the buffer object.
1929 * Check that INVALID_OPERATION is generated by GetNamedBufferSubData if
1930 * the buffer object is mapped with MapBufferRange or MapBuffer, unless it
1931 * was mapped with the MAP_PERSISTENT_BIT bit set in the MapBufferRange
1934 class ErrorsTest : public deqp::TestCase
1937 /* Public member functions */
1938 ErrorsTest(deqp::Context& context);
1940 virtual tcu::TestNode::IterateResult iterate();
1943 /* Private member functions */
1944 ErrorsTest(const ErrorsTest& other);
1945 ErrorsTest& operator=(const ErrorsTest& other);
1947 /* API entry points. */
1948 typedef void(GLW_APIENTRY* PFNGLCLEARNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLenum internalformat,
1949 glw::GLenum format, glw::GLenum type,
1950 const glw::GLvoid* data);
1951 typedef void(GLW_APIENTRY* PFNGLCLEARNAMEDBUFFERSUBDATA)(glw::GLuint buffer, glw::GLenum internalformat,
1952 glw::GLintptr offset, glw::GLsizei size,
1953 glw::GLenum format, glw::GLenum type,
1954 const glw::GLvoid* data);
1955 typedef void(GLW_APIENTRY* PFNGLCOPYNAMEDBUFFERSUBDATA)(glw::GLuint readBuffer, glw::GLuint writeBuffer,
1956 glw::GLintptr readOffset, glw::GLintptr writeOffset,
1957 glw::GLsizeiptr size);
1958 typedef void(GLW_APIENTRY* PFNGLFLUSHMAPPEDNAMEDBUFFERRANGE)(glw::GLuint buffer, glw::GLintptr offset,
1959 glw::GLsizei length);
1960 typedef void(GLW_APIENTRY* PFNGLGETNAMEDBUFFERPARAMETERI64V)(glw::GLuint buffer, glw::GLenum pname,
1961 glw::GLint64* data);
1962 typedef void(GLW_APIENTRY* PFNGLGETNAMEDBUFFERPARAMETERIV)(glw::GLuint buffer, glw::GLenum pname, glw::GLint* data);
1963 typedef void(GLW_APIENTRY* PFNGLGETNAMEDBUFFERPOINTERV)(glw::GLuint buffer, glw::GLenum pname,
1964 glw::GLvoid** params);
1965 typedef void*(GLW_APIENTRY* PFNGLGETNAMEDBUFFERSUBDATA)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei size,
1967 typedef void*(GLW_APIENTRY* PFNGLMAPNAMEDBUFFER)(glw::GLuint buffer, glw::GLenum access);
1968 typedef void*(GLW_APIENTRY* PFNGLMAPNAMEDBUFFERRANGE)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei length,
1969 glw::GLbitfield access);
1970 typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLsizeiptr size, const glw::GLvoid* data,
1972 typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERSTORAGE)(glw::GLuint buffer, glw::GLsizeiptr size,
1973 const glw::GLvoid* data, glw::GLbitfield flags);
1974 typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERSUBDATA)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei size,
1975 const glw::GLvoid* data);
1976 typedef glw::GLboolean(GLW_APIENTRY* PFNGLUNMAPNAMEDBUFFER)(glw::GLuint buffer);
1978 PFNGLCLEARNAMEDBUFFERDATA m_pClearNamedBufferData;
1979 PFNGLCLEARNAMEDBUFFERSUBDATA m_pClearNamedBufferSubData;
1980 PFNGLCOPYNAMEDBUFFERSUBDATA m_pCopyNamedBufferSubData;
1981 PFNGLFLUSHMAPPEDNAMEDBUFFERRANGE m_pFlushMappedNamedBufferRange;
1982 PFNGLGETNAMEDBUFFERPARAMETERI64V m_pGetNamedBufferParameteri64v;
1983 PFNGLGETNAMEDBUFFERPARAMETERIV m_pGetNamedBufferParameteriv;
1984 PFNGLGETNAMEDBUFFERPOINTERV m_pGetNamedBufferPointerv;
1985 PFNGLGETNAMEDBUFFERSUBDATA m_pGetNamedBufferSubData;
1986 PFNGLMAPNAMEDBUFFER m_pMapNamedBuffer;
1987 PFNGLMAPNAMEDBUFFERRANGE m_pMapNamedBufferRange;
1988 PFNGLNAMEDBUFFERDATA m_pNamedBufferData;
1989 PFNGLNAMEDBUFFERSTORAGE m_pNamedBufferStorage;
1990 PFNGLNAMEDBUFFERSUBDATA m_pNamedBufferSubData;
1991 PFNGLUNMAPNAMEDBUFFER m_pUnmapNamedBuffer;
1993 /* Private member functions */
1994 bool TestErrorsOfClearNamedBufferData();
1995 bool TestErrorsOfClearNamedBufferSubData();
1996 bool TestErrorsOfCopyNamedBufferSubData();
1997 bool TestErrorsOfCreateBuffers();
1998 bool TestErrorsOfFlushMappedNamedBufferRange();
1999 bool TestErrorsOfGetNamedBufferParameter();
2000 bool TestErrorsOfGetNamedBufferPointerv();
2001 bool TestErrorsOfGetNamedBufferSubData();
2002 bool TestErrorsOfMapNamedBuffer();
2003 bool TestErrorsOfMapNamedBufferRange();
2004 bool TestErrorsOfNamedBufferData();
2005 bool TestErrorsOfNamedBufferStorage();
2006 bool TestErrorsOfNamedBufferSubData();
2007 bool TestErrorsOfUnmapNamedBuffer();
2009 bool ErrorCheckAndLog(const glw::GLchar* function_name, const glw::GLenum expected_error,
2010 const glw::GLchar* when_shall_be_generated);
2012 /* ErrorsTest class */
2014 /** @class FunctionalTest
2016 * @brief Direct State Access Buffer Objects Functional Test.
2018 * This test verifies basic usage in rendering pipeline of the tested
2020 * - ClearNamedBufferData,
2021 * - ClearNamedBufferSubData,
2022 * - CopyNamedBufferSubData,
2023 * - FlushMappedNamedBufferRange,
2024 * - GetNamedBufferParameteri64v,
2025 * - GetNamedBufferParameteriv,
2026 * - GetNamedBufferPointerv,
2027 * - GetNamedBufferSubData,
2029 * - MapNamedBufferRange,
2030 * - NamedBufferData,
2031 * - NamedBufferStorage,
2032 * - NamedBufferSubData and
2033 * - UnmapNamedBuffer.
2035 * Test follows the steps:
2037 * Prepare program with vertex shader and fragment shader. Fragment shader
2038 * shall be pass-trough. Vertex shader shall have one integer input
2039 * variable. Vertex shader shall output (to transform feedback) square of
2040 * input variable. gl_Position shall be set up to vec4(0.0, 0.0, 0.0, 1.0).
2041 * Build and use the program.
2043 * Create and bind empty vertex array object.
2045 * Prepare one buffer using CreateBuffers and NamedBufferStorage with size
2046 * of 6 integers and passing pointer to data {1, 2, 3, 4, 5, 5} and dynamic
2047 * storage flag set on. Clear (with 0) the first element with
2048 * ClearNamedBufferSubData. Set second data element to 1 using
2049 * NamedBufferSubData. Set third data element to 2 using MapNamedBuffer
2050 * and UnmapNamedBuffer. Bind it to ARRAY_BUFFER binding point. Copy forth
2051 * element into fifth element using CopyNamedBufferSubData. Set fourth data
2052 * element using MapNamedBufferRange and FlushMappedNamedBuffer to 3.
2053 * During mapping check that GetNamedBufferPointerv called with
2054 * BUFFER_MAP_POINTER returns proper pointer. Unmap it using
2055 * UnmapNamedBuffer function. Setup buffer as an input attribute to GLSL
2056 * program. Consequently, the resulting buffer shall be {0, 1, 2, 3, 4, 5}.
2058 * Prepare one buffer using GenBuffers. Bind it to transform feedback.
2059 * Allocate it's storage using NamedBufferData with size of 7 integers and
2060 * passing pointer to data {0, 0, 0, 0, 0, 0, 36}. Set up this buffer as
2061 * transform feedback output.
2063 * Begin transform feedback.
2065 * Draw six indices using points.
2067 * End transform feedback.
2069 * Query array buffer's parameter BUFFER_IMMUTABLE_STORAGE with
2070 * GetNamedBufferParameteriv and compare with previous setup.
2072 * Query transform feedback buffer size with GetNamedBufferParameteri64v
2073 * and compare with previous setup.
2075 * Fetch transform feedback buffer content using GetNamedBufferSubData and
2078 * Check that fetched data is equal to {0, 1, 4, 9, 16, 25, 36}.
2080 * If any check fails, test shall fail.
2082 * If any of the tested functions generates error, test shall fail.
2084 class FunctionalTest : public deqp::TestCase
2087 /* Public member functions */
2088 FunctionalTest(deqp::Context& context);
2090 virtual tcu::TestNode::IterateResult iterate();
2093 /* Private member functions */
2094 FunctionalTest(const FunctionalTest& other);
2095 FunctionalTest& operator=(const FunctionalTest& other);
2097 /* API entry points. */
2098 typedef void(GLW_APIENTRY* PFNGLCLEARNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLenum internalformat,
2099 glw::GLenum format, glw::GLenum type,
2100 const glw::GLvoid* data);
2101 typedef void(GLW_APIENTRY* PFNGLCLEARNAMEDBUFFERSUBDATA)(glw::GLuint buffer, glw::GLenum internalformat,
2102 glw::GLintptr offset, glw::GLsizei size,
2103 glw::GLenum format, glw::GLenum type,
2104 const glw::GLvoid* data);
2105 typedef void(GLW_APIENTRY* PFNGLCOPYNAMEDBUFFERSUBDATA)(glw::GLuint readBuffer, glw::GLuint writeBuffer,
2106 glw::GLintptr readOffset, glw::GLintptr writeOffset,
2107 glw::GLsizeiptr size);
2108 typedef void(GLW_APIENTRY* PFNGLFLUSHMAPPEDNAMEDBUFFERRANGE)(glw::GLuint buffer, glw::GLintptr offset,
2109 glw::GLsizei length);
2110 typedef void(GLW_APIENTRY* PFNGLGETNAMEDBUFFERPARAMETERI64V)(glw::GLuint buffer, glw::GLenum pname,
2111 glw::GLint64* data);
2112 typedef void(GLW_APIENTRY* PFNGLGETNAMEDBUFFERPARAMETERIV)(glw::GLuint buffer, glw::GLenum pname, glw::GLint* data);
2113 typedef void(GLW_APIENTRY* PFNGLGETNAMEDBUFFERPOINTERV)(glw::GLuint buffer, glw::GLenum pname,
2114 glw::GLvoid** params);
2115 typedef void*(GLW_APIENTRY* PFNGLGETNAMEDBUFFERSUBDATA)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei size,
2117 typedef void*(GLW_APIENTRY* PFNGLMAPNAMEDBUFFER)(glw::GLuint buffer, glw::GLenum access);
2118 typedef void*(GLW_APIENTRY* PFNGLMAPNAMEDBUFFERRANGE)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei length,
2119 glw::GLbitfield access);
2120 typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERDATA)(glw::GLuint buffer, glw::GLsizeiptr size, const glw::GLvoid* data,
2122 typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERSTORAGE)(glw::GLuint buffer, glw::GLsizeiptr size,
2123 const glw::GLvoid* data, glw::GLbitfield flags);
2124 typedef void(GLW_APIENTRY* PFNGLNAMEDBUFFERSUBDATA)(glw::GLuint buffer, glw::GLintptr offset, glw::GLsizei size,
2125 const glw::GLvoid* data);
2126 typedef glw::GLboolean(GLW_APIENTRY* PFNGLUNMAPNAMEDBUFFER)(glw::GLuint buffer);
2128 PFNGLCLEARNAMEDBUFFERDATA m_pClearNamedBufferData;
2129 PFNGLCLEARNAMEDBUFFERSUBDATA m_pClearNamedBufferSubData;
2130 PFNGLCOPYNAMEDBUFFERSUBDATA m_pCopyNamedBufferSubData;
2131 PFNGLFLUSHMAPPEDNAMEDBUFFERRANGE m_pFlushMappedNamedBufferRange;
2132 PFNGLGETNAMEDBUFFERPARAMETERI64V m_pGetNamedBufferParameteri64v;
2133 PFNGLGETNAMEDBUFFERPARAMETERIV m_pGetNamedBufferParameteriv;
2134 PFNGLGETNAMEDBUFFERPOINTERV m_pGetNamedBufferPointerv;
2135 PFNGLGETNAMEDBUFFERSUBDATA m_pGetNamedBufferSubData;
2136 PFNGLMAPNAMEDBUFFER m_pMapNamedBuffer;
2137 PFNGLMAPNAMEDBUFFERRANGE m_pMapNamedBufferRange;
2138 PFNGLNAMEDBUFFERDATA m_pNamedBufferData;
2139 PFNGLNAMEDBUFFERSTORAGE m_pNamedBufferStorage;
2140 PFNGLNAMEDBUFFERSUBDATA m_pNamedBufferSubData;
2141 PFNGLUNMAPNAMEDBUFFER m_pUnmapNamedBuffer;
2143 /* Private member variables. */
2146 glw::GLuint m_bo_in;
2147 glw::GLuint m_bo_out;
2148 glw::GLint m_attrib_location;
2150 /* Private static variables. */
2151 static const glw::GLchar s_vertex_shader[];
2152 static const glw::GLchar s_fragment_shader[];
2153 static const glw::GLchar s_vertex_shader_input_name[];
2154 static const glw::GLchar* s_vertex_shader_output_name;
2156 static const glw::GLint s_initial_data_a[];
2157 static const glw::GLint s_initial_data_b[];
2158 static const glw::GLint s_expected_data[];
2160 /* Private member functions */
2161 void BuildProgram();
2162 void PrepareVertexArrayObject();
2163 bool PrepareInputBuffer();
2164 bool PrepareOutputBuffer();
2166 bool CheckArrayBufferImmutableFlag();
2167 bool CheckTransformFeedbackBufferSize();
2168 bool CheckTransformFeedbackResult();
2171 /* FunctionalTest class */
2172 } /* Buffers namespace */
2174 namespace Framebuffers
2176 /** Framebuffer Creation
2178 * Create at least two framebuffer objects using GenFramebuffers function.
2179 * Check them without binding, using IsFramebuffer function. Expect FALSE.
2181 * Create at least two framebuffer objects using CreateFramebuffers
2182 * function. Check them without binding, using IsFramebuffer function.
2187 class CreationTest : public deqp::TestCase
2190 /* Public member functions */
2191 CreationTest(deqp::Context& context);
2193 virtual tcu::TestNode::IterateResult iterate();
2196 /* Private member functions */
2197 CreationTest(const CreationTest& other);
2198 CreationTest& operator=(const CreationTest& other);
2200 /* CreationTest class */
2202 /** Framebuffer Renderbuffer Attachment
2204 * Create renderbuffer using GenRenderbuffers function. Bind it. Prepare
2205 * its storage using RenderbufferStorage. Unbind it.
2207 * Create framebuffer using CreateFramebuffers. Setup renderbuffer storage.
2208 * Attach the renderbuffer to the framebuffer using
2209 * NamedFramebufferRenderbuffer function.
2211 * Bind framebuffer and check its status using CheckFramebufferStatus
2214 * Clear the framebuffer's content with the reference value. Fetch the
2215 * framebuffer's content using ReadPixels and compare it with reference
2218 * Repeat the test for following attachment types:
2219 * - COLOR_ATTACHMENTi for i from 0 to value of MAX_COLOR_ATTACHMENTS
2221 * - DEPTH_ATTACHMENT,
2222 * - STENCIL_ATTACHMENT and
2223 * - DEPTH_STENCIL_ATTACHMENT.
2225 class RenderbufferAttachmentTest : public deqp::TestCase
2228 /* Public member functions */
2229 RenderbufferAttachmentTest(deqp::Context& context);
2231 virtual tcu::TestNode::IterateResult iterate();
2234 /* Private member functions */
2235 RenderbufferAttachmentTest(const RenderbufferAttachmentTest& other);
2236 RenderbufferAttachmentTest& operator=(const RenderbufferAttachmentTest& other);
2238 bool Test(glw::GLenum attachment, glw::GLenum internalformat);
2241 /* Private member variables. */
2245 /* RenderbufferAttachmentTest class */
2247 /** Named Framebuffer Texture Attachment
2249 * Create texture using CreateTexture function. Prepare its storage using
2252 * Create framebuffer using CreateFramebuffers. Attach the texture to
2253 * the framebuffer using NamedFramebufferTexture function. Repeat
2254 * attachment for all texture levels.
2256 * Bind framebuffer and check its status using CheckFramebufferStatus
2259 * Clear the framebuffer's content with the reference value. Fetch the
2260 * framebuffer's content using ReadPixels and compare it with reference
2263 * Repeat the test for following attachment types:
2264 * - COLOR_ATTACHMENTi for i from 0 to value of MAX_COLOR_ATTACHMENTS
2266 * - DEPTH_ATTACHMENT,
2267 * - STENCIL_ATTACHMENT and
2268 * - DEPTH_STENCIL_ATTACHMENT.
2270 * Repeat the test for following texture targets:
2271 * - TEXTURE_RECTANGLE,
2273 * - TEXTURE_2D_MULTISAMPLE,
2274 * - TEXTURE_CUBE_MAP.
2276 * Repeat the test with each possible texture level, that is:
2277 * - 0 for TEXTURE_RECTANGLE and TEXTURE_2D_MULTISAMPLE targets;
2278 * - from zero to value one less than base 2 logarithm of the value of
2279 * MAX_3D_TEXTURE_SIZE for TEXTURE_2D target
2280 * - from zero to value one less than base 2 logarithm of the value of
2281 * MAX_CUBE_MAP_TEXTURE_SIZE for TEXTURE_CUBE_MAP target.
2283 class TextureAttachmentTest : public deqp::TestCase
2286 /* Public member functions */
2287 TextureAttachmentTest(deqp::Context& context);
2289 virtual tcu::TestNode::IterateResult iterate();
2292 /* Private member functions */
2293 TextureAttachmentTest(const TextureAttachmentTest& other);
2294 TextureAttachmentTest& operator=(const TextureAttachmentTest& other);
2296 bool Test(glw::GLenum attachment, bool is_color_attachment, glw::GLenum texture_target, glw::GLenum internalformat,
2297 glw::GLuint levels);
2298 bool SubTestAttachmentError(glw::GLenum attachment, glw::GLenum texture_target, glw::GLuint level,
2299 glw::GLuint levels);
2300 bool SubTestStatus(glw::GLenum attachment, glw::GLenum texture_target, glw::GLuint level, glw::GLuint levels);
2301 bool SubTestContent(glw::GLenum attachment, glw::GLenum texture_target, glw::GLenum internalformat,
2302 glw::GLuint level, glw::GLuint levels);
2303 glw::GLuint MaxTextureLevels(glw::GLenum texture_target);
2307 /* Private member variables. */
2311 /* Static private variables. */
2312 static const glw::GLenum s_targets[];
2313 static const glw::GLuint s_targets_count;
2315 static const glw::GLfloat s_reference_color[4];
2316 static const glw::GLint s_reference_color_integer[4];
2317 static const glw::GLfloat s_reference_depth;
2318 static const glw::GLint s_reference_stencil;
2320 /* TextureAttachmentTest class */
2322 /** Named Framebuffer Texture Layer Attachment
2324 * Create texture using CreateTexture function. Prepare its storage using
2327 * Create framebuffer using CreateFramebuffers. Attach the texture to the
2328 * framebuffer using NamedFramebufferTextureLayer function.
2330 * Bind framebuffer and check its status using CheckFramebufferStatus
2333 * For non multisample target, clean the framebuffer's content with the
2334 * reference value. Fetch one pixel from framebuffer's content using
2335 * ReadPixels and compare it with reference values.
2337 * Repeat the test for following attachment types:
2338 * - COLOR_ATTACHMENTi for i from 0 to value of MAX_COLOR_ATTACHMENTS
2340 * - DEPTH_ATTACHMENT,
2341 * - STENCIL_ATTACHMENT and
2342 * - DEPTH_STENCIL_ATTACHMENT.
2344 * Repeat the test for following texture targets:
2345 * - TEXTURE_2D_MULTISAMPLE_ARRAY,
2346 * - TEXTURE_2D_ARRAY,
2347 * - TEXTURE_CUBE_MAP_ARRAY,
2350 * Repeat the test for texture levels from zero to value one less than base
2351 * 2 logarithm of the value of MAX_3D_TEXTURE_SIZE.
2353 * Repeat with texture which has number of layers:
2356 * - value of MAX_CUBE_MAP_TEXTURE_SIZE for TEXTURE_CUBE_ARRAY or value
2357 * of MAX_3D_TEXTURE_SIZE.
2358 * Test only limited set of the layers of the above textures to reduce time
2359 * complexity of the test.
2361 class TextureLayerAttachmentTest : public deqp::TestCase
2364 /* Public member functions */
2365 TextureLayerAttachmentTest(deqp::Context& context);
2367 virtual tcu::TestNode::IterateResult iterate();
2370 /* Private member functions */
2371 TextureLayerAttachmentTest(const TextureLayerAttachmentTest& other);
2372 TextureLayerAttachmentTest& operator=(const TextureLayerAttachmentTest& other);
2374 bool Test(glw::GLenum attachment, bool is_color_attachment, glw::GLenum texture_target, glw::GLenum internalformat,
2375 glw::GLuint levels, glw::GLint layers);
2376 bool SubTestAttachmentError(glw::GLenum attachment, glw::GLenum texture_target, glw::GLuint level, glw::GLint layer,
2377 glw::GLuint levels, glw::GLint layers);
2378 bool SubTestStatus(glw::GLenum attachment, glw::GLenum texture_target, glw::GLuint level, glw::GLint layer,
2379 glw::GLuint levels, glw::GLint layers);
2380 bool SubTestContent(glw::GLenum attachment, glw::GLenum texture_target, glw::GLenum internalformat,
2381 glw::GLuint level, glw::GLint layer, glw::GLuint levels, glw::GLint layers);
2383 glw::GLuint MaxTextureLevels(glw::GLenum texture_target);
2384 glw::GLuint MaxTextureLayers(glw::GLenum texture_target);
2387 /* Private member variables. */
2391 /* Static private variables. */
2392 static const glw::GLenum s_targets[];
2393 static const glw::GLuint s_targets_count;
2395 static const glw::GLfloat s_reference_color[4];
2396 static const glw::GLint s_reference_color_integer[4];
2397 static const glw::GLfloat s_reference_depth;
2398 static const glw::GLint s_reference_stencil;
2400 /* TextureLayerAttachmentTest class */
2402 /** Named Framebuffer Draw Read Buffer
2404 * Create named framebuffer with maximum number of color attachments (use
2405 * named renderbuffer storage).
2407 * For each color attachment use NamedFramebufferDrawBuffer to set up it as
2408 * a draw buffer. Clear it with unique color.
2410 * For each color attachment use NamedFramebufferReadBuffer to set up it as
2411 * a read buffer. Fetch the pixel data and compare that it contains unique
2412 * color with the attachment was cleared
2414 * Check that NamedFramebufferDrawBuffer and NamedFramebufferReadBuffer
2415 * accept GL_NONE as mode without error.
2417 * Release all objects.
2419 class DrawReadBufferTest : public deqp::TestCase
2422 /* Public member functions */
2423 DrawReadBufferTest(deqp::Context& context);
2425 virtual tcu::TestNode::IterateResult iterate();
2428 /* Private member functions */
2429 DrawReadBufferTest(const DrawReadBufferTest& other);
2430 DrawReadBufferTest& operator=(const DrawReadBufferTest& other);
2432 /* DrawReadBufferTest class */
2434 /** Named Framebuffer Draw Buffers
2436 * Create named framebuffer with maximum number of color attachments (use
2437 * named renderbuffer storage).
2439 * Set up all attachments as a draw buffer using the function
2440 * NamedFramebufferDrawBuffers. Then clear them at once with unique color.
2442 * For each color attachment fetch pixel data and compare that contain
2443 * the same unique color.
2445 * Release all objects.
2447 class DrawBuffersTest : public deqp::TestCase
2450 /* Public member functions */
2451 DrawBuffersTest(deqp::Context& context);
2453 virtual tcu::TestNode::IterateResult iterate();
2456 /* Private member functions */
2457 DrawBuffersTest(const DrawBuffersTest& other);
2458 DrawBuffersTest& operator=(const DrawBuffersTest& other);
2460 /* Private static constants. */
2461 static const glw::GLfloat s_rgba[4];
2463 /* DrawReadBuffersTest class */
2465 /** Invalidate Named Framebuffer Data
2467 * For default framebuffer try to invalidate each of COLOR, DEPTH, and
2468 * STENCIL attachments. Expect no error.
2470 * For default framebuffer try to invalidate all (COLOR, DEPTH, and
2471 * STENCIL) attachments. Expect no error.
2473 * Create named framebuffer with maximum number of color attachments (use
2474 * named renderbuffer storage), depth attachment and stencil attachment.
2476 * Clear all attachments.
2478 * Try to invalidate content of all attachments using
2479 * InvalidateNamedFramebufferData. Expect no error.
2481 * Try to invalidate content of each attachment using
2482 * InvalidateNamedFramebufferData. Expect no error.
2484 * Release all objects.
2486 class InvalidateDataTest : public deqp::TestCase
2489 /* Public member functions */
2490 InvalidateDataTest(deqp::Context& context);
2492 virtual tcu::TestNode::IterateResult iterate();
2495 /* Private member functions */
2496 InvalidateDataTest(const InvalidateDataTest& other);
2497 InvalidateDataTest& operator=(const InvalidateDataTest& other);
2499 bool CheckErrorAndLog(const glw::GLenum attachment);
2500 bool CheckErrorAndLog(const glw::GLenum attachments[], const glw::GLuint count);
2502 /* InvalidateDataTest class */
2504 /** Invalidate Named Framebuffer SubData
2506 * For default framebuffer try to invalidate part of each of COLOR, DEPTH,
2507 * and STENCIL attachments. Expect no error.
2509 * For default framebuffer try to invalidate part of all (COLOR, DEPTH, and
2510 * STENCIL) attachments. Expect no error.
2512 * Create named framebuffer with maximum number of color attachments (use
2513 * named renderbuffer storage), depth attachment and stencil attachment.
2515 * Clear all attachments.
2517 * Try to invalidate content of part of all attachments using
2518 * InvalidateNamedFramebufferData. Expect no error.
2520 * Try to invalidate content of part of each attachment using
2521 * InvalidateNamedFramebufferData. Expect no error.
2523 * Release all objects.
2525 class InvalidateSubDataTest : public deqp::TestCase
2528 /* Public member functions */
2529 InvalidateSubDataTest(deqp::Context& context);
2531 virtual tcu::TestNode::IterateResult iterate();
2534 /* Private member functions */
2535 InvalidateSubDataTest(const InvalidateSubDataTest& other);
2536 InvalidateSubDataTest& operator=(const InvalidateSubDataTest& other);
2538 bool CheckErrorAndLog(const glw::GLenum attachment);
2539 bool CheckErrorAndLog(const glw::GLenum attachments[], const glw::GLuint count);
2541 /* InvalidateSubDataTest class */
2543 /** Clear Named Framebuffer
2545 * Repeat following steps for fixed-point, floating-point, signed integer,
2546 * and unsigned integer color attachments.
2548 * Create named framebuffer with maximum number of color attachments
2549 * (use named renderbuffer storage).
2551 * Clear each of the color attachment with unique color using proper
2552 * ClearNamedFramebuffer* function.
2554 * For each color attachment fetch pixel data and compare that contain
2555 * unique color with which it was cleared.
2557 * Release all objects.
2559 * Next, do following steps:
2561 * Create named framebuffer with depth attachment and stencil
2564 * Clear each of the attachments with unique value using proper
2565 * ClearNamedFramebufferfi function.
2567 * Fetch pixel data of each attachment and compare that contain unique
2568 * value with which it was cleared.
2570 * Release all objects.
2572 class ClearTest : public deqp::TestCase
2575 /* Public member functions */
2576 ClearTest(deqp::Context& context);
2578 virtual tcu::TestNode::IterateResult iterate();
2581 /* Private member functions */
2582 ClearTest(const ClearTest& other);
2583 ClearTest& operator=(const ClearTest& other);
2585 void PrepareFramebuffer(glw::GLenum buffer, glw::GLenum internalformat);
2587 template <typename T>
2588 bool TestClearColor(glw::GLenum buffer, glw::GLenum attachment, T value);
2590 template <typename T>
2591 bool ClearColor(glw::GLenum buffer, glw::GLint drawbuffer, T value);
2593 bool TestClearDepthAndStencil(glw::GLfloat depth, glw::GLint stencil);
2595 template <typename T>
2596 glw::GLenum Format();
2598 template <typename T>
2601 template <typename T>
2602 bool Compare(const T first, const T second);
2606 /* Private member variables. */
2608 glw::GLuint* m_renderbuffers;
2609 glw::GLuint m_renderbuffers_count;
2611 /* ClearTest class */
2613 /** Blit Named Framebuffer
2615 * Create named framebuffer with color, depth and stencil attachments with
2616 * size 2x2 pixels(use named renderbuffer storage).
2618 * Create named framebuffer with color, depth and stencil attachments with
2619 * size 2x3 pixels(use named renderbuffer storage).
2621 * Clear the first framebuffer with red color, 0.5 depth and 1 as a stencil
2624 * Blit one pixel of the first framebuffer to the second framebuffer to the
2625 * pixel at (0, 0) position with NEAREST filter.
2627 * Clear first the framebuffer with green color, 0.25 depth and 2 as a
2630 * Blit one pixel of the first framebuffer to the second framebuffer to the
2631 * pixel at (1, 0) position with LINEAR filter for color attachment, but
2632 * NEAREST filter for depth and stencil attachments.
2634 * Clear the first framebuffer with blue color, 0.125 depth and 3 as a
2637 * Blit the whole first framebuffer to the second framebuffer by shrinking
2638 * it to the single pixel at (2, 0) position.
2640 * Clear the first framebuffer with yellow color, 0.0625 depth and 4 as a
2643 * Blit one pixel of the framebuffer to the second framebuffer by expanding
2644 * it to the three pixel constructing horizontal line at (0, 1) position.
2648 * Check that color attachment of the second framebuffer has following
2651 * yellow, yellow, yellow.
2653 * Check that depth attachment of the second framebuffer has following
2656 * 0.0625, 0.0625, 0.0625.
2658 * Check that stencil attachment of the second framebuffer has following
2663 * Release all objects.
2665 class BlitTest : public deqp::TestCase
2668 /* Public member functions */
2669 BlitTest(deqp::Context& context);
2671 virtual tcu::TestNode::IterateResult iterate();
2674 /* Private member functions */
2675 BlitTest(const BlitTest& other);
2676 BlitTest& operator=(const BlitTest& other);
2678 void PrepareFramebuffers();
2680 void ClearFramebuffer(glw::GLfloat red, glw::GLfloat green, glw::GLfloat blue, glw::GLfloat depth,
2681 glw::GLint stencil);
2682 bool CheckErrorAndLog();
2685 bool CheckStencil();
2688 /* Private member variables. */
2689 glw::GLuint m_fbo_src;
2690 glw::GLuint m_rbo_color_src;
2691 glw::GLuint m_rbo_depth_stencil_src;
2692 glw::GLuint m_fbo_dst;
2693 glw::GLuint m_rbo_color_dst;
2694 glw::GLuint m_rbo_depth_stencil_dst;
2696 /* BlitTest class */
2698 /** Check Named Framebuffer Status
2700 * Do following test cases:
2702 * Incomplete attachment case
2704 * Prepare framebuffer with one incomplete attachment.
2706 * Check the framebuffer status using CheckNamedFramebufferStatus.
2707 * Expect FRAMEBUFFER_INCOMPLETE_ATTACHMENT return value.
2709 * Release all objects.
2711 * Repeat the test case for all possible color, depth and stencil
2714 * Missing attachment case
2716 * Prepare framebuffer without any attachment.
2718 * Check the framebuffer status using CheckNamedFramebufferStatus.
2719 * Expect FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT return value.
2721 * Release all objects.
2723 * Incomplete multisample renderbuffer case
2725 * Prepare framebuffer with two multisampled renderbuffer color
2726 * attachments which have different number of samples.
2728 * Check the framebuffer status using CheckNamedFramebufferStatus.
2729 * Expect FRAMEBUFFER_INCOMPLETE_MULTISAMPLE return value. If the
2730 * check fails return TEST_RESULT_COMPATIBILITY_WARNING.
2732 * Release all objects.
2734 * Incomplete multisample texture case
2736 * Prepare framebuffer with two multisampled texture color
2737 * attachments and one multisampled renderbuffer which all have
2738 * different number of sample locations. One of the textures shall
2739 * have fixed sample locations set, one not.
2741 * Check the framebuffer status using CheckNamedFramebufferStatus.
2742 * Expect FRAMEBUFFER_INCOMPLETE_MULTISAMPLE return value. If the
2743 * check fails return TEST_RESULT_COMPATIBILITY_WARNING.
2745 * Release all objects.
2747 * Incomplete layer targets case
2749 * Prepare framebuffer with one 3D texture and one 2D texture.
2751 * Check the framebuffer status using CheckNamedFramebufferStatus.
2752 * Expect FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS return value. If the
2753 * check fails return TEST_RESULT_COMPATIBILITY_WARNING.
2755 * Release all objects.
2759 * The specification is not clear about framebuffer completeness. The
2760 * OpenGL 4.5 Core Profile Specification in chapter 9.4.2 says:
2762 * "The framebuffer object bound to target is said to be framebuffer
2763 * complete if all the following conditions are true [...]"
2765 * It does not say that framebuffer is incomplete when any of the
2766 * conditions are not met. Due to this wording, except for obvious cases
2767 * (incomplete attachment and missing attachments) other tests are optional
2768 * and may result in QP_TEST_RESULT_COMPATIBILITY_WARNING when fail.
2770 class CheckStatusTest : public deqp::TestCase
2773 /* Public member functions */
2774 CheckStatusTest(deqp::Context& context);
2776 virtual tcu::TestNode::IterateResult iterate();
2779 /* Private member functions */
2780 CheckStatusTest(const CheckStatusTest& other);
2781 CheckStatusTest& operator=(const CheckStatusTest& other);
2783 bool IncompleteAttachmentTestCase();
2784 bool MissingAttachmentTestCase();
2785 bool IncompleteMultisampleRenderbufferTestCase();
2786 bool IncompleteMultisampleTextureTestCase();
2787 bool IncompleteLayerTargetsTestCase();
2789 /* CheckStatusTest class */
2791 /** Get Named Framebuffer Parameters
2793 * Prepare framebuffer with read and write buffers and renderbuffer color
2796 * Do following checks for the created framebuffer:
2798 * Check that GetNamedFramebufferParameteriv called with parameter name
2799 * FRAMEBUFFER_DEFAULT_WIDTH returns the value of
2800 * FRAMEBUFFER_DEFAULT_WIDTH for the framebuffer object.
2802 * Check that GetNamedFramebufferParameteriv called with parameter name
2803 * FRAMEBUFFER_DEFAULT_HEIGHT returns the value of
2804 * FRAMEBUFFER_DEFAULT_HEIGHT for the framebuffer object.
2806 * Check that GetNamedFramebufferParameteriv called with parameter name
2807 * FRAMEBUFFER_DEFAULT_LAYERS returns the value of
2808 * FRAMEBUFFER_DEFAULT_LAYERS for the framebuffer object.
2809 * Check that GetNamedFramebufferParameteriv called with parameter name
2810 * FRAMEBUFFER_DEFAULT_SAMPLES returns the value of
2811 * FRAMEBUFFER_DEFAULT_SAMPLES for the framebuffer object.
2812 * Check that GetNamedFramebufferParameteriv called with parameter name
2813 * FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS returns the boolean value
2814 * of FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS.
2816 * Do following checks for the created and default (if available)
2819 * Check that GetNamedFramebufferParameteriv called with parameter name
2820 * DOUBLEBUFFER returns a boolean value indicating whether double
2821 * buffering is supported for the framebuffer object.
2823 * Check that GetNamedFramebufferParameteriv called with parameter name
2824 * IMPLEMENTATION_COLOR_READ_FORMAT returns a GLenum value indicating
2825 * the preferred pixel data format for the framebuffer object.
2827 * Check that GetNamedFramebufferParameteriv called with parameter name
2828 * IMPLEMENTATION_COLOR_READ_TYPE returns a GLenum value indicating the
2829 * implementation's preferred pixel data type for the framebuffer
2832 * Check that GetNamedFramebufferParameteriv called with parameter name
2833 * SAMPLES returns an integer value indicating the coverage mask size
2834 * for the framebuffer object.
2836 * Check that GetNamedFramebufferParameteriv called with parameter name
2837 * SAMPLE_BUFFERS returns an integer value indicating the number of
2838 * sample buffers associated with the framebuffer object.
2840 * Check that GetNamedFramebufferParameteriv called with parameter name
2841 * STEREO returns a boolean value indicating whether stereo buffers
2842 * (left and right) are supported for the framebuffer object.
2844 * Release all objects.
2846 class GetParametersTest : public deqp::TestCase
2849 /* Public member functions */
2850 GetParametersTest(deqp::Context& context);
2852 virtual tcu::TestNode::IterateResult iterate();
2855 /* Private member functions */
2856 GetParametersTest(const GetParametersTest& other);
2857 GetParametersTest& operator=(const GetParametersTest& other);
2859 void PrepareFramebuffer();
2860 bool TestDefaultFramebuffer();
2861 bool TestCustomFramebuffer();
2864 /* Private member variables. */
2868 /* GetParametersTest class */
2870 /** Get Named Framebuffer Attachment Parameters
2872 * For default framebuffer, for all attachments:
2879 * query FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE using
2880 * GetNamedFramebufferAttachmentParameteriv function. Expect
2881 * FRAMEBUFFER_DEFAULT return value (as queried with non-DSA way).
2883 * For any attachments not equal to GL_NONE do following queries using
2884 * GetNamedFramebufferAttachmentParameteriv function:
2885 * FRAMEBUFFER_ATTACHMENT_RED_SIZE,
2886 * FRAMEBUFFER_ATTACHMENT_GREEN_SIZE,
2887 * FRAMEBUFFER_ATTACHMENT_BLUE_SIZE,
2888 * FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE,
2889 * FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE,
2890 * FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE,
2891 * FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE,
2892 * FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.
2893 * Expect value equal to framebuffers setup (as queried with non-DSA way).
2896 * Create 3 framebuffer objects with renderbuffer color attachment, and
2897 * depth or stencil or depth-stencil attachments.
2899 * For each of framebuffers, for each of following attachments:
2901 * STENCIL_ATTACHMENT,
2902 * DEPTH_STENCIL_ATTACHMENT,
2903 * COLOR_ATTACHMENT0,
2905 * query FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE using
2906 * GetNamedFramebufferAttachmentParameteriv function. Expect the same
2907 * return value as queried with non-DSA way.
2909 * For each of framebuffers, for any attachments not equal to GL_NONE do
2910 * following queries using GetNamedFramebufferAttachmentParameteriv
2912 * FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
2913 * FRAMEBUFFER_ATTACHMENT_RED_SIZE,
2914 * FRAMEBUFFER_ATTACHMENT_GREEN_SIZE,
2915 * FRAMEBUFFER_ATTACHMENT_BLUE_SIZE,
2916 * FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE,
2917 * FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE,
2918 * FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE,
2919 * FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE,
2920 * FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING
2921 * Expect value equal to framebuffers setup (as queried with non-DSA way).
2926 * Create 3 framebuffer objects with texture color attachment, and
2927 * depth or stencil or depth-stencil attachments.
2929 * For each of framebuffers, for each of following attachments:
2931 * STENCIL_ATTACHMENT,
2932 * DEPTH_STENCIL_ATTACHMENT,
2933 * COLOR_ATTACHMENT0,
2935 * query FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE using
2936 * GetNamedFramebufferAttachmentParameteriv function. Expect the same
2937 * return value as queried with non-DSA way.
2939 * For each of framebuffers, for any attachments not equal to GL_NONE do
2940 * following queries using GetNamedFramebufferAttachmentParameteriv
2942 * FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
2943 * FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL,
2944 * FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE,
2945 * FRAMEBUFFER_ATTACHMENT_LAYERED,
2946 * FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER,
2947 * FRAMEBUFFER_ATTACHMENT_RED_SIZE,
2948 * FRAMEBUFFER_ATTACHMENT_GREEN_SIZE,
2949 * FRAMEBUFFER_ATTACHMENT_BLUE_SIZE,
2950 * FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE,
2951 * FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE,
2952 * FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE,
2953 * FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE,
2954 * FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING
2955 * Expect value equal to framebuffers setup (as queried with non-DSA way).
2960 * Additional conditions:
2962 * Do not query DEPTH_STENCIL_ATTACHMENT attachment if the renderbuffer
2963 * or texture is not depth-stencil.
2965 * Do not query FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE pname with
2966 * DEPTH_STENCIL_ATTACHMENT attachment.
2968 class GetAttachmentParametersTest : public deqp::TestCase
2971 /* Public member functions */
2972 GetAttachmentParametersTest(deqp::Context& context);
2974 virtual tcu::TestNode::IterateResult iterate();
2977 /* Private member functions */
2978 GetAttachmentParametersTest(const GetAttachmentParametersTest& other);
2979 GetAttachmentParametersTest& operator=(const GetAttachmentParametersTest& other);
2981 void CreateRenderbufferFramebuffer(bool depth, bool stencil);
2982 void CreateTextureFramebuffer(bool depth, bool stencil);
2983 bool TestDefaultFramebuffer();
2984 bool TestRenderbufferFramebuffer(bool depth_stencil);
2985 bool TestTextureFramebuffer(bool depth_stencil);
2988 /* Private member variables. */
2990 glw::GLuint m_rbo[2];
2991 glw::GLuint m_to[2];
2993 /* GetParametersTest class */
2995 /** Create Named Framebuffers Errors
2997 * Check that INVALID_VALUE is generated by CreateFramebuffers if n is
3000 class CreationErrorsTest : public deqp::TestCase
3003 /* Public member functions */
3004 CreationErrorsTest(deqp::Context& context);
3006 virtual tcu::TestNode::IterateResult iterate();
3009 /* Private member functions */
3010 CreationErrorsTest(const CreationErrorsTest& other);
3011 CreationErrorsTest& operator=(const CreationErrorsTest& other);
3013 /* CreationErrorsTest class */
3015 /** Named Framebuffer Renderbuffer Errors
3017 * Check that INVALID_OPERATION is generated by
3018 * NamedFramebufferRenderbuffer if framebuffer is not the name of an
3019 * existing framebuffer object.
3021 * Check that INVALID_OPERATION is generated by NamedFramebufferRenderbuffer
3022 * if attachment is COLOR_ATTACHMENTm where m is greater than or equal to
3023 * the value of MAX_COLOR_ATTACHMENTS.
3025 * Check that INVALID_ENUM is generated by NamedFramebufferRenderbuffer if
3026 * attachment is not one of the attachments in table 9.2, and attachment is
3027 * not COLOR_ATTACHMENTm where m is greater than or equal to the value of
3028 * MAX_COLOR_ATTACHMENTS.
3030 * Check that INVALID_ENUM is generated by NamedFramebufferRenderbuffer if
3031 * renderbuffer target is not RENDERBUFFER.
3033 * Check that INVALID_OPERATION is generated by
3034 * NamedFramebufferRenderbuffer if renderbuffer target is not zero or the
3035 * name of an existing renderbuffer object of type RENDERBUFFER.
3037 class RenderbufferAttachmentErrorsTest : public deqp::TestCase
3040 /* Public member functions */
3041 RenderbufferAttachmentErrorsTest(deqp::Context& context);
3043 virtual tcu::TestNode::IterateResult iterate();
3046 /* Private member functions */
3047 RenderbufferAttachmentErrorsTest(const RenderbufferAttachmentErrorsTest& other);
3048 RenderbufferAttachmentErrorsTest& operator=(const RenderbufferAttachmentErrorsTest& other);
3050 void PrepareObjects();
3051 bool ExpectError(glw::GLenum expected_error, bool framebuffer, bool attachment, bool color_attachment,
3052 bool renderbuffertarget, bool renderbuffer);
3055 /* Private member variables. */
3056 glw::GLuint m_fbo_valid;
3057 glw::GLuint m_rbo_valid;
3058 glw::GLuint m_fbo_invalid;
3059 glw::GLuint m_rbo_invalid;
3060 glw::GLenum m_color_attachment_invalid;
3061 glw::GLenum m_attachment_invalid;
3062 glw::GLenum m_renderbuffer_target_invalid;
3064 /* RenderbufferAttachmentErrorsTest class */
3066 /** Named Framebuffer Texture Errors
3068 * Check that GL_INVALID_OPERATION is generated by glNamedFramebufferTexture and glNamedFramebufferTextureLayer
3069 * if framebuffer is not the name of an existing framebuffer object.
3071 * Check that INVALID_OPERATION is generated by glNamedFramebufferTexture and glNamedFramebufferTextureLayer
3072 * if attachment is COLOR_ATTACHMENTm where m is greater than or equal to
3073 * the value of MAX_COLOR_ATTACHMENTS.
3075 * Check that INVALID_ENUM is generated by glNamedFramebufferTexture and glNamedFramebufferTextureLayer if
3076 * attachment is not one of the attachments in table 9.2, and attachment is
3077 * not COLOR_ATTACHMENTm where m is greater than or equal to the value of
3078 * MAX_COLOR_ATTACHMENTS.
3080 * Check that INVALID_VALUE is generated by glNamedFramebufferTexture if texture is not zero or the name
3081 * of an existing texture object.
3083 * Check that INVALID_OPERATION is generated by glNamedFramebufferTextureLayer if texture is not zero or
3084 * the name of an existing texture object.
3086 * Check that INVALID_VALUE is generated by glNamedFramebufferTexture and glNamedFramebufferTextureLayer if
3087 * texture is not zero and level is not a supported texture level for
3090 * Check that INVALID_OPERATION is generated by glNamedFramebufferTexture and glNamedFramebufferTextureLayer
3091 * if texture is a buffer texture.
3093 * Check that INVALID_VALUE error is generated by NamedFramebufferTextureLayer if texture is a three-dimensional
3094 * texture, and layer is larger than the value of MAX_3D_TEXTURE_SIZE minus one.
3096 * Check that INVALID_VALUE error is generated by NamedFramebufferTextureLayer if texture is an array texture,
3097 * and layer is larger than the value of MAX_ARRAY_TEXTURE_LAYERS minus one.
3099 * Check that INVALID_VALUE error is generated by NamedFramebufferTextureLayer if texture is a cube map array texture,
3100 * and (layer / 6) is larger than the value of MAX_CUBE_MAP_TEXTURE_SIZE minus one (see section 9.8).
3101 * Check that INVALID_VALUE error is generated by NamedFramebufferTextureLayer if texture is non-zero
3102 * and layer is negative.
3104 * Check that INVALID_OPERATION error is generated by NamedFramebufferTextureLayer if texture is non-zero
3105 * and is not the name of a three-dimensional, two-dimensional multisample array, one- or two-dimensional array,
3106 * or cube map array texture.
3108 class TextureAttachmentErrorsTest : public deqp::TestCase
3111 /* Public member functions */
3112 TextureAttachmentErrorsTest(deqp::Context& context);
3114 virtual tcu::TestNode::IterateResult iterate();
3117 /* Private member functions */
3118 TextureAttachmentErrorsTest(const TextureAttachmentErrorsTest& other);
3119 TextureAttachmentErrorsTest& operator=(const TextureAttachmentErrorsTest& other);
3121 void PrepareObjects();
3122 bool ExpectError(glw::GLenum expected_error, const glw::GLchar* function_name, bool framebuffer, bool attachment,
3123 bool color_attachment, bool texture, bool level, const glw::GLchar* texture_type, bool layer);
3126 /* Private member variables. */
3127 glw::GLuint m_fbo_valid;
3128 glw::GLuint m_to_valid;
3129 glw::GLuint m_to_3d_valid;
3130 glw::GLuint m_to_array_valid;
3131 glw::GLuint m_to_cubearray_valid;
3132 glw::GLuint m_tbo_valid;
3133 glw::GLuint m_fbo_invalid;
3134 glw::GLuint m_to_invalid;
3135 glw::GLuint m_to_layer_invalid; /* it is valid rectangle texture, but invalid for NamedFramebufferTextureLayer */
3136 glw::GLenum m_color_attachment_invalid;
3137 glw::GLenum m_attachment_invalid;
3138 glw::GLint m_level_invalid;
3139 glw::GLint m_max_3d_texture_size;
3140 glw::GLint m_max_3d_texture_depth;
3141 glw::GLint m_max_array_texture_layers;
3142 glw::GLint m_max_cube_map_texture_size;
3144 /* TextureAttachmentErrorsTest class */
3146 /** Named Framebuffer Draw Read Buffers Errors
3148 * Check that INVALID_OPERATION error is generated by
3149 * NamedFramebufferDrawBuffer if framebuffer is not zero or the name of an
3150 * existing framebuffer object.
3152 * Check that INVALID_ENUM is generated by NamedFramebufferDrawBuffer if
3153 * buf is not an accepted value.
3155 * Check that INVALID_OPERATION is generated by NamedFramebufferDrawBuffer
3156 * if the GL is bound to a draw framebuffer object and the ith argument is
3157 * a value other than COLOR_ATTACHMENTi or NONE.
3159 * Check that INVALID_OPERATION error is generated by
3160 * NamedFramebufferDrawBuffers if framebuffer is not zero or the name of an
3161 * existing framebuffer object.
3163 * Check that INVALID_VALUE is generated by NamedFramebufferDrawBuffers if
3166 * Check that INVALID_VALUE is generated by NamedFramebufferDrawBuffers if
3167 * n is greater than MAX_DRAW_BUFFERS.
3169 * Check that INVALID_ENUM is generated by NamedFramebufferDrawBuffers if
3170 * one of the values in bufs is not an accepted value.
3172 * Check that INVALID_OPERATION is generated by NamedFramebufferDrawBuffers
3173 * if a symbolic constant other than GL_NONE appears more than once in
3176 * Check that INVALID_ENUM error is generated by
3177 * NamedFramebufferDrawBuffers if any value in bufs is FRONT, LEFT, RIGHT,
3178 * or FRONT_AND_BACK. This restriction applies to both the default
3179 * framebuffer and framebuffer objects, and exists because these constants
3180 * may themselves refer to multiple buffers, as shown in table 17.4.
3182 * Check that INVALID_OPERATION is generated by NamedFramebufferDrawBuffers
3183 * if any value in bufs is BACK, and n is not one.
3185 * Check that INVALID_OPERATION is generated by NamedFramebufferDrawBuffers
3186 * if the API call refers to a framebuffer object and one or more of the
3187 * values in bufs is anything other than NONE or one of the
3188 * COLOR_ATTACHMENTn tokens.
3190 * Check that INVALID_OPERATION is generated by NamedFramebufferDrawBuffers
3191 * if the API call refers to the default framebuffer and one or more of the
3192 * values in bufs is one of the COLOR_ATTACHMENTn tokens.
3194 * Check that INVALID_OPERATION is generated by NamedFramebufferReadBuffer
3195 * if framebuffer is not zero or the name of an existing framebuffer
3198 * Check that INVALID_ENUM is generated by NamedFramebufferReadBuffer if
3199 * src is not one of the accepted values (tables 17.4 and 17.5 of OpenGL
3200 * 4.5 Core Profile Specification).
3202 * Check that INVALID_OPERATION is generated by NamedFramebufferReadBuffer
3203 * if the default framebuffer is affected and src is a value (other than
3204 * NONE) that does not indicate any of the color buffers allocated to the
3205 * default framebuffer.
3207 * Check that INVALID_OPERATION is generated by NamedFramebufferReadBuffer
3208 * if a framebuffer object is affected, and src is one of the constants
3209 * from table 17.4 (other than NONE, or COLOR_ATTACHMENTm where m is
3210 * greater than or equal to the value of MAX_COLOR_ATTACHMENTS).
3212 class DrawReadBuffersErrorsTest : public deqp::TestCase
3215 /* Public member functions */
3216 DrawReadBuffersErrorsTest(deqp::Context& context);
3218 virtual tcu::TestNode::IterateResult iterate();
3221 /* Private member functions */
3222 DrawReadBuffersErrorsTest(const DrawReadBuffersErrorsTest& other);
3223 DrawReadBuffersErrorsTest operator=(const DrawReadBuffersErrorsTest& other);
3225 void PrepareObjects();
3226 bool ExpectError(glw::GLenum expected_error, const glw::GLchar* function, const glw::GLchar* conditions);
3229 /* Private member variables. */
3230 glw::GLuint m_fbo_valid;
3231 glw::GLuint m_fbo_invalid;
3232 glw::GLenum m_attachment_color;
3233 glw::GLenum m_attachment_back_left;
3234 glw::GLenum m_attachment_right;
3235 glw::GLenum m_attachment_left;
3236 glw::GLenum m_attachment_front;
3237 glw::GLenum m_attachment_front_and_back;
3238 glw::GLenum m_attachment_back;
3239 glw::GLenum m_attachment_invalid;
3240 glw::GLenum m_attachments_invalid[2];
3241 glw::GLenum m_attachments_back_invalid[2];
3242 glw::GLint m_attachments_too_many_count;
3243 glw::GLenum* m_attachments_too_many;
3244 glw::GLint m_max_color_attachments;
3246 /* DrawReadBuffersErrorsTest class */
3248 /** Invalidate Framebuffer Data and SubData Errors
3250 Check that INVALID_OPERATION error is generated by
3251 InvalidateNamedFramebufferData if framebuffer is not zero or the name of
3252 an existing framebuffer object.
3254 Check that INVALID_ENUM error is generated by
3255 InvalidateNamedFramebufferData if a framebuffer object is affected, and
3256 any element of of attachments is not one of the values
3257 {COLOR_ATTACHMENTi, DEPTH_ATTACHMENT, STENCIL_ATTACHMENT,
3258 DEPTH_STENCIL_ATTACHMENT}.
3260 Check that INVALID_OPERATION error is generated by
3261 InvalidateNamedFramebufferData if attachments contains COLOR_ATTACHMENTm
3262 where m is greater than or equal to the value of MAX_COLOR_ATTACHMENTS.
3264 Check that INVALID_ENUM error is generated by
3265 InvalidateNamedFramebufferData if the default framebuffer is affected,
3266 and any elements of attachments are not one of:
3267 - FRONT_LEFT, FRONT_RIGHT, BACK_LEFT, and BACK_RIGHT, identifying that
3269 - COLOR, which is treated as BACK_LEFT for a double-buffered context
3270 and FRONT_LEFT for a single-buffered context,
3271 - DEPTH, identifying the depth buffer,
3272 - STENCIL, identifying the stencil buffer.
3274 Check that INVALID_OPERATION error is generated by
3275 InvalidateNamedSubFramebuffer if framebuffer is not zero or the name of
3276 an existing framebuffer object.
3278 Check that INVALID_VALUE error is generated by
3279 InvalidateNamedSubFramebuffer if numAttachments, width, or height is
3282 Check that INVALID_ENUM error is generated by
3283 InvalidateNamedSubFramebuffer if a framebuffer object is affected, and
3284 any element of attachments is not one of the values {COLOR_ATTACHMENTi,
3285 DEPTH_ATTACHMENT, STENCIL_ATTACHMENT, DEPTH_STENCIL_ATTACHMENT}.
3287 Check that INVALID_OPERATION error is generated by
3288 InvalidateNamedSubFramebuffer if attachments contains COLOR_ATTACHMENTm
3289 where m is greater than or equal to the value of MAX_COLOR_ATTACHMENTS.
3291 Check that INVALID_ENUM error is generated by
3292 InvalidateNamedSubFramebuffer if the default framebuffer is affected,
3293 and any elements of attachments are not one of:
3294 - FRONT_LEFT, FRONT_RIGHT, BACK_LEFT, and BACK_RIGHT, identifying that
3296 - COLOR, which is treated as BACK_LEFT for a double-buffered context
3297 and FRONT_LEFT for a single-buffered context,
3298 - DEPTH, identifying the depth buffer,
3299 - STENCIL, identifying the stencil buffer.
3301 class InvalidateDataAndSubDataErrorsTest : public deqp::TestCase
3304 /* Public member functions */
3305 InvalidateDataAndSubDataErrorsTest(deqp::Context& context);
3307 virtual tcu::TestNode::IterateResult iterate();
3310 /* Private member functions */
3311 InvalidateDataAndSubDataErrorsTest(const InvalidateDataAndSubDataErrorsTest& other);
3312 InvalidateDataAndSubDataErrorsTest operator=(const InvalidateDataAndSubDataErrorsTest& other);
3314 void PrepareObjects();
3315 bool ExpectError(glw::GLenum expected_error, const glw::GLchar* function, const glw::GLchar* conditions);
3318 /* Private member variables. */
3319 glw::GLuint m_fbo_valid;
3321 glw::GLuint m_fbo_invalid;
3322 glw::GLenum m_fbo_attachment_valid;
3323 glw::GLenum m_fbo_attachment_invalid;
3324 glw::GLenum m_color_attachment_invalid;
3325 glw::GLenum m_default_attachment_invalid;
3327 /* InvalidateDataAndSubDataErrorsTest class */
3329 /** Clear Named Framebuffer Errors
3331 * Check that INVALID_OPERATION is generated by ClearNamedFramebuffer* if
3332 * framebuffer is not zero or the name of an existing framebuffer object.
3334 * Check that INVALID_ENUM is generated by ClearNamedFramebufferiv buffer
3335 * is not COLOR or STENCIL.
3337 * Check that INVALID_ENUM is generated by ClearNamedFramebufferuiv buffer
3340 * Check that INVALID_ENUM is generated by ClearNamedFramebufferfv buffer
3341 * is not COLOR or DEPTH.
3343 * Check that INVALID_ENUM is generated by ClearNamedFramebufferfi buffer
3344 * is not DEPTH_STENCIL.
3346 * Check that INVALID_VALUE is generated if buffer is COLOR drawbuffer is
3347 * negative, or greater than the value of MAX_DRAW_BUFFERS minus one.
3349 * Check that INVALID_VALUE is generated if buffer is DEPTH, STENCIL or
3350 * DEPTH_STENCIL and drawbuffer is not zero.
3352 class ClearNamedFramebufferErrorsTest : public deqp::TestCase
3355 /* Public member functions */
3356 ClearNamedFramebufferErrorsTest(deqp::Context& context);
3358 virtual tcu::TestNode::IterateResult iterate();
3361 /* Private member functions */
3362 ClearNamedFramebufferErrorsTest(const ClearNamedFramebufferErrorsTest& other);
3363 ClearNamedFramebufferErrorsTest& operator=(const ClearNamedFramebufferErrorsTest& other);
3365 void PrepareObjects();
3366 bool ExpectError(glw::GLenum expected_error, const glw::GLchar* function, const glw::GLchar* conditions);
3369 /* Private member variables. */
3370 glw::GLuint m_fbo_valid;
3371 glw::GLuint m_rbo_color;
3372 glw::GLuint m_rbo_depth_stencil;
3373 glw::GLuint m_fbo_invalid;
3375 /* ClearNamedFramebufferErrorsTest class */
3377 /** Check Named Framebuffer Status Errors
3379 * Check that INVALID_ENUM is generated by CheckNamedFramebufferStatus if
3380 * target is not DRAW_FRAMEBUFFER, READ_FRAMEBUFFER or FRAMEBUFFER.
3382 * Check that INVALID_OPERATION is generated by CheckNamedFramebufferStatus
3383 * if framebuffer is not zero or the name of an existing framebuffer
3386 class CheckStatusErrorsTest : public deqp::TestCase
3389 /* Public member functions */
3390 CheckStatusErrorsTest(deqp::Context& context);
3392 virtual tcu::TestNode::IterateResult iterate();
3395 /* Private member functions */
3396 CheckStatusErrorsTest(const CheckStatusErrorsTest& other);
3397 CheckStatusErrorsTest& operator=(const CheckStatusErrorsTest& other);
3399 void PrepareObjects();
3400 bool ExpectError(glw::GLenum expected_error, const glw::GLchar* function, const glw::GLchar* conditions);
3403 /* Private member variables. */
3404 glw::GLuint m_fbo_valid;
3405 glw::GLuint m_fbo_invalid;
3406 glw::GLuint m_target_invalid;
3408 /* CheckStatusErrorsTest class */
3410 /** Get Named Framebuffer Parameter Errors
3412 * Check that INVALID_OPERATION is generated by
3413 * GetNamedFramebufferParameteriv if framebuffer is not zero or the name of
3414 * an existing framebuffer object.
3416 * Check that INVALID_ENUM is generated by GetNamedFramebufferParameteriv
3417 * if pname is not one of the accepted parameter names.
3419 * Check that INVALID_OPERATION is generated if a default framebuffer is
3420 * queried, and pname is not one of DOUBLEBUFFER,
3421 * IMPLEMENTATION_COLOR_READ_FORMAT, IMPLEMENTATION_COLOR_READ_TYPE,
3422 * SAMPLES, SAMPLE_BUFFERS or STEREO.
3424 class GetParameterErrorsTest : public deqp::TestCase
3427 /* Public member functions */
3428 GetParameterErrorsTest(deqp::Context& context);
3430 virtual tcu::TestNode::IterateResult iterate();
3433 /* Private member functions */
3434 GetParameterErrorsTest(const GetParameterErrorsTest& other);
3435 GetParameterErrorsTest& operator=(const GetParameterErrorsTest& other);
3437 void PrepareObjects();
3438 bool ExpectError(glw::GLenum expected_error, const glw::GLchar* function, const glw::GLchar* conditions);
3441 /* Private member variables. */
3442 glw::GLuint m_fbo_valid;
3443 glw::GLuint m_fbo_invalid;
3444 glw::GLuint m_parameter_invalid;
3446 /* GetParameterErrorsTest class */
3448 /** Get Named Framebuffer Attachment Parameter Errors
3450 * Check that GL_INVALID_OPERATION is generated by
3451 * GetNamedFramebufferAttachmentParameteriv if framebuffer is not zero or
3452 * the name of an existing framebuffer object.
3454 * Check that INVALID_ENUM is generated by
3455 * GetNamedFramebufferAttachmentParameteriv if pname is not valid for the
3456 * value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, as described above.
3458 * Check that INVALID_ENUM error is generated if a framebuffer object is queried, attachment
3459 * is not one of the attachments in table 9.2 (COLOR_ATTACHMENTi, DEPTH_ATTACHMENT, STENCIL_ATTACHMENT, DEPTH_STENCIL_ATTACHMENT), and attachment is not
3460 * COLOR_ATTACHMENTm where m is greater than or equal to the value of MAX_COLOR_ATTACHMENTS.
3462 * Check that INVALID_OPERATION is generated by
3463 * GetNamedFramebufferAttachmentParameteriv if the value of
3464 * FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is GL_NONE and pname is not
3465 * FRAMEBUFFER_ATTACHMENT_OBJECT_NAME or
3466 * FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE.
3468 * Check that INVALID_OPERATION is generated by
3469 * GetNamedFramebufferAttachmentParameteriv if attachment is
3470 * DEPTH_STENCIL_ATTACHMENT and pname is
3471 * FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.
3473 * Check that an INVALID_ENUM error is generated if the default framebuffer is
3474 * queried and attachment is not one the values specified in table 9.1.
3476 * Check that an INVALID_OPERATION error is generated if a framebuffer object is
3477 * bound to target and attachment is COLOR_ATTACHMENTm where m is greater than or
3478 * equal to the value of MAX_COLOR_ATTACHMENTS.
3480 * Check that an INVALID_ENUM error is generated if a framebuffer object is
3481 * queried, attachment is not one of the attachments in table 9.2, and attachment
3482 * is not COLOR_ATTACHMENTm where m is greater than or equal to the value of
3483 * MAX_COLOR_ATTACHMENTS.
3485 class GetAttachmentParameterErrorsTest : public deqp::TestCase
3488 /* Public member functions */
3489 GetAttachmentParameterErrorsTest(deqp::Context& context);
3491 virtual tcu::TestNode::IterateResult iterate();
3494 /* Private member functions */
3495 GetAttachmentParameterErrorsTest(const GetAttachmentParameterErrorsTest& other);
3496 GetAttachmentParameterErrorsTest& operator=(const GetAttachmentParameterErrorsTest& other);
3498 void PrepareObjects();
3499 bool ExpectError(glw::GLenum expected_error, const glw::GLchar* function, const glw::GLchar* conditions);
3502 /* Private member variables. */
3503 glw::GLuint m_fbo_valid;
3504 glw::GLuint m_rbo_color;
3505 glw::GLuint m_rbo_depth_stencil;
3506 glw::GLuint m_fbo_invalid;
3507 glw::GLuint m_parameter_invalid;
3508 glw::GLenum m_attachment_invalid;
3509 glw::GLenum m_default_attachment_invalid;
3510 glw::GLint m_max_color_attachments;
3512 /* GetAttachmentParameterErrorsTest class */
3514 /** Framebuffer and Renderbuffer Functional
3516 * Create two framebuffer objects using CreateFramebuffers.
3518 * Setup first framebuffer with renderbuffer color, depth and stencil
3519 * attachments. Setup storage size with width and height equal to 8. Set
3520 * them as draw and read buffers. Clean up it, use black color. Check the
3521 * framebuffer status.
3523 * Setup second framebuffer with texture color attachment. Setup storage
3524 * size with width equal to 4 and height equal to 3. Check the framebuffer
3527 * Prepare GLSL program which can draw triangles using orthographic
3528 * projection. Fragment shader
3530 * Clean both framebuffers using ClearNamedFramebuffer* functions.
3532 * Use first framebuffer.
3534 * Draw to stencil a quad with screen positions [-0.5, -0.5], [-0.5, 0.5],
3535 * [0.5, -0.5] and [0.5, 0.5].
3537 * Draw to depth buffer a quad with positions [-1, -1, -1], [-1, 1, -1],
3538 * [1, -1, 0] and [1, 1, 0].
3540 * Turn on depth and stencil tests. Depth test shall pass if incoming depth
3541 * value is LESS than stored. The Stencil test shall pass only for any
3544 * Draw Full screen quad to draw buffer with z = 0.5.
3546 * Blit the color content of the first framebuffer to the second with
3549 * Fetch data. Expect that second framebuffer contain following data
3550 * black, black, black, black,
3551 * black, black, white, black,
3552 * black, black, black, black.
3554 class FunctionalTest : public deqp::TestCase
3557 /* Public member functions */
3558 FunctionalTest(deqp::Context& context);
3560 virtual tcu::TestNode::IterateResult iterate();
3563 /* Private member functions */
3564 FunctionalTest(const FunctionalTest& other);
3565 FunctionalTest& operator=(const FunctionalTest& other);
3567 bool PrepareFirstFramebuffer();
3568 bool PrepareSecondFramebuffer();
3569 bool ClearFramebuffers();
3570 void PrepareProgram();
3571 void PrepareBuffersAndVertexArrays();
3573 bool CheckSecondFramebufferContent();
3576 /* Private member variables. */
3577 glw::GLuint m_fbo_1st;
3578 glw::GLuint m_fbo_2nd;
3579 glw::GLuint m_rbo_color;
3580 glw::GLuint m_rbo_depth_stencil;
3581 glw::GLuint m_to_color;
3583 glw::GLuint m_vao_stencil_pass_quad;
3584 glw::GLuint m_vao_depth_pass_quad;
3585 glw::GLuint m_vao_color_pass_quad;
3586 glw::GLuint m_bo_stencil_pass_quad;
3587 glw::GLuint m_bo_depth_pass_quad;
3588 glw::GLuint m_bo_color_pass_quad;
3590 /* Private static variables. */
3591 static const glw::GLchar s_vertex_shader[];
3592 static const glw::GLchar s_fragment_shader[];
3593 static const glw::GLchar s_attribute[];
3594 static const glw::GLfloat s_stencil_pass_quad[];
3595 static const glw::GLfloat s_depth_pass_quad[];
3596 static const glw::GLfloat s_color_pass_quad[];
3597 static const glw::GLuint s_stencil_pass_quad_size;
3598 static const glw::GLuint s_depth_pass_quad_size;
3599 static const glw::GLuint s_color_pass_quad_size;
3601 /* FunctionalTest class */
3602 } /* Framebuffers namespace */
3604 namespace Renderbuffers
3606 /** Renderbuffer Creation
3608 * Create at least two renderbuffer objects using GenRenderbuffers
3609 * function. Check them without binding, using IsRenderbuffer function.
3612 * Create at least two renderbuffer objects using CreateRenderbuffers
3613 * function. Check them without binding, using IsRenderbuffer function.
3618 class CreationTest : public deqp::TestCase
3621 /* Public member functions */
3622 CreationTest(deqp::Context& context);
3624 virtual tcu::TestNode::IterateResult iterate();
3627 /* Private member functions */
3628 CreationTest(const CreationTest& other);
3629 CreationTest& operator=(const CreationTest& other);
3631 /* CreationTest class */
3633 /** Named Renderbuffer Storage
3635 * Create renderbuffer object. Prepare its storage using
3636 * NamedRenderbufferStorage function.
3638 * Create framebuffer object. Attach renderbuffer to proper attachment
3641 * Clear framebuffer's renderbuffer attachment with reference value. Fetch
3642 * the data from framebuffer's attachment using ReadPixels. Compare the
3643 * fetched values with the reference.
3645 * Release all objects.
3647 * Repeat the test for following internal formats:
3649 * R8, R16, RG8, RG16, RGB565, RGBA4, RGB5_A1, RGBA8, RGB10_A2,
3650 * RGB10_A2UI, RGBA16, SRGB8_ALPHA8, R16F, RG16F, RGBA16F, R32F, RG32F,
3651 * RGBA32F, R11F_G11F_B10F, R8I, R8UI, R16I, R16UI, R32I, R32UI, RG8I,
3652 * RG8UI, RG16I, RG16UI, RG32I, RG32UI, RGBA8I, RGBA8UI, RGBA16I,
3653 * RGBA16UI, RGBA32I, RGBA32UI, DEPTH_COMPONENT16, DEPTH_COMPONENT24,
3654 * DEPTH_COMPONENT32F, DEPTH24_STENCIL8, DEPTH32F_STENCIL8 and
3657 * Repeat the test for following width and height:
3658 * width = 1 and height = 1;
3659 * width = 256 and height = 512;
3660 * width = 1280 and height = 720;
3661 * width = value of MAX_RENDERBUFFER_SIZE and height = 1;
3662 * width = 1 and height = value of MAX_RENDERBUFFER_SIZE.
3664 class StorageTest : public deqp::TestCase
3667 /* Public member functions */
3668 StorageTest(deqp::Context& context);
3670 virtual tcu::TestNode::IterateResult iterate();
3673 /* Private static variables. */
3674 static const struct RenderbufferInternalFormatConfiguration
3676 glw::GLenum internalformat;
3677 const glw::GLchar* internalformat_name;
3678 bool hasRedComponent;
3679 bool hasGreenComponent;
3680 bool hasBlueComponent;
3681 bool hasAlphaComponent;
3682 bool hasDepthComponent;
3683 bool hasStencilComponent;
3684 bool isColorIntegralFormat;
3685 } s_renderbuffer_internalformat_configuration[];
3687 static const glw::GLuint s_renderbuffer_internalformat_configuration_count;
3689 static const glw::GLfloat s_reference_color[4];
3690 static const glw::GLint s_reference_color_integer[4];
3691 static const glw::GLfloat s_reference_depth;
3692 static const glw::GLint s_reference_stencil;
3694 /* Private member functions */
3695 StorageTest(const StorageTest& other);
3696 StorageTest& operator=(const StorageTest& other);
3698 bool PrepareRenderbuffer(StorageTest::RenderbufferInternalFormatConfiguration format, glw::GLuint width,
3699 glw::GLuint height);
3700 void Clear(bool isIntegralFormat);
3701 bool Check(StorageTest::RenderbufferInternalFormatConfiguration format, glw::GLuint width, glw::GLuint height);
3704 /* Private member variables. */
3708 /* StorageTest class */
3710 /** Named Renderbuffer Storage Multisample
3712 * Create two renderbuffer objects. Prepare storage of the first one using
3713 * NamedRenderbufferStorageMultisample function. Prepare storage of the
3714 * second one using NamedRenderbufferStorage function.
3716 * Create two framebuffer objects. Attach multisampled renderbuffer to
3717 * proper attachment points of the first framebuffer. Attach second
3718 * renderbuffer to proper attachment points of the second framebuffer.
3720 * Clear framebuffer's renderbuffer attachment with reference value. Blit
3721 * surface of the first framebuffer (multisampled renderbuffer) to the
3722 * second framebuffer. Fetch the data from the second framebuffer using
3723 * ReadPixels function. Compare the fetched values with the reference.
3725 * Release all objects.
3727 * Repeat the test for following internal formats:
3729 * R8, R16, RG8, RG16, RGB565, RGBA4, RGB5_A1, RGBA8, RGB10_A2,
3730 * RGB10_A2UI, RGBA16, SRGB8_ALPHA8, R16F, RG16F, RGBA16F, R32F, RG32F,
3731 * RGBA32F, R11F_G11F_B10F, R8I, R8UI, R16I, R16UI, R32I, R32UI, RG8I,
3732 * RG8UI, RG16I, RG16UI, RG32I, RG32UI, RGBA8I, RGBA8UI, RGBA16I,
3733 * RGBA16UI, RGBA32I, RGBA32UI, DEPTH_COMPONENT16, DEPTH_COMPONENT24,
3734 * DEPTH_COMPONENT32F, DEPTH24_STENCIL8, DEPTH32F_STENCIL8 and
3737 * Repeat the test for following width and height:
3738 * width = 1 and height = 1;
3739 * width = value of MAX_RENDERBUFFER_SIZE and height = 1;
3740 * width = 1 and height = value of MAX_RENDERBUFFER_SIZE.
3742 * Repeat the test for number of samples in range from 1 to value of
3743 * MAX_INTEGER_SAMPLES for signed and unsigned integer internal formats or
3744 * in range from 1 to value of MAX_SAMPLES for all other internal formats.
3746 class StorageMultisampleTest : public deqp::TestCase
3749 /* Public member functions */
3750 StorageMultisampleTest(deqp::Context& context);
3752 virtual tcu::TestNode::IterateResult iterate();
3755 /* Private static variables. */
3756 static const struct RenderbufferInternalFormatConfiguration
3758 glw::GLenum internalformat;
3759 const glw::GLchar* internalformat_name;
3760 bool hasRedComponent;
3761 bool hasGreenComponent;
3762 bool hasBlueComponent;
3763 bool hasAlphaComponent;
3764 bool hasDepthComponent;
3765 bool hasStencilComponent;
3766 bool isColorIntegralFormat;
3767 } s_renderbuffer_internalformat_configuration[];
3769 static const glw::GLuint s_renderbuffer_internalformat_configuration_count;
3771 static const glw::GLfloat s_reference_color[4];
3772 static const glw::GLint s_reference_color_integer[4];
3773 static const glw::GLfloat s_reference_depth;
3774 static const glw::GLint s_reference_stencil;
3776 /* Private member functions */
3777 StorageMultisampleTest(const StorageMultisampleTest& other);
3778 StorageMultisampleTest& operator=(const StorageMultisampleTest& other);
3780 bool PrepareRenderbuffer(StorageMultisampleTest::RenderbufferInternalFormatConfiguration format, glw::GLuint width,
3781 glw::GLuint height, glw::GLsizei samples);
3782 void Bind(glw::GLenum target, glw::GLuint selector);
3783 void Blit(glw::GLuint width, glw::GLuint height);
3784 void Clear(bool isIntegralFormat);
3785 bool Check(StorageMultisampleTest::RenderbufferInternalFormatConfiguration format, glw::GLuint width,
3786 glw::GLuint height);
3789 /* Private member variables. */
3790 glw::GLuint m_fbo[2];
3791 glw::GLuint m_rbo[2];
3793 /* StorageMultisampleTest class */
3795 /** Get Named Renderbuffer Parameter
3797 * Create named renderbuffer object with varying width = 1,
3798 * height = 2, and varying internalformat.
3800 * For following parameter names:
3801 * - RENDERBUFFER_WIDTH,
3802 * - RENDERBUFFER_HEIGHT,
3803 * - RENDERBUFFER_INTERNAL_FORMAT,
3804 * - RENDERBUFFER_SAMPLES,
3805 * - RENDERBUFFER_RED_SIZE,
3806 * - RENDERBUFFER_GREEN_SIZE,
3807 * - RENDERBUFFER_BLUE_SIZE,
3808 * - RENDERBUFFER_ALPHA_SIZE,
3809 * - RENDERBUFFER_DEPTH_SIZE,
3810 * - RENDERBUFFER_STENCIL_SIZE
3811 * query value using GetNamedRenderbufferParameteriv. Expect no error.
3812 * Compare it with value returned in non-DSA way. Expect equality.
3814 * Repeat test for following internalformats:
3816 * - DEPTH_COMPONENT24,
3818 * - DEPTH24_STENCIL8.
3822 class GetParametersTest : public deqp::TestCase
3825 /* Public member functions */
3826 GetParametersTest(deqp::Context& context);
3828 virtual tcu::TestNode::IterateResult iterate();
3831 /* Private member functions */
3832 GetParametersTest(const GetParametersTest& other);
3833 GetParametersTest& operator=(const GetParametersTest& other);
3835 /* Private member variables. */
3839 /* GetParametersTest class */
3841 /** Create Renderbuffer Errors
3843 * Check that INVALID_VALUE is generated by CreateRenderbuffers if n is
3846 class CreationErrorsTest : public deqp::TestCase
3849 /* Public member functions */
3850 CreationErrorsTest(deqp::Context& context);
3852 virtual tcu::TestNode::IterateResult iterate();
3855 /* Private member functions */
3856 CreationErrorsTest(const CreationErrorsTest& other);
3857 CreationErrorsTest& operator=(const CreationErrorsTest& other);
3859 /* CreationErrorsTest class */
3861 /** Named Renderbuffer Storage Errors
3863 * Check that INVALID_OPERATION is generated by NamedRenderbufferStorage if
3864 * renderbuffer is not the name of an existing renderbuffer object.
3866 * Check that INVALID_VALUE is generated by NamedRenderbufferStorage if
3867 * either of width or height is negative, or greater than the value of
3868 * MAX_RENDERBUFFER_SIZE.
3870 class StorageErrorsTest : public deqp::TestCase
3873 /* Public member functions */
3874 StorageErrorsTest(deqp::Context& context);
3876 virtual tcu::TestNode::IterateResult iterate();
3879 /* Private member functions */
3880 StorageErrorsTest(const StorageErrorsTest& other);
3881 StorageErrorsTest& operator=(const StorageErrorsTest& other);
3883 void PrepareObjects();
3884 bool ExpectError(glw::GLenum expected_error, const glw::GLchar* function, const glw::GLchar* conditions);
3887 /* Private member variables. */
3888 glw::GLuint m_rbo_valid;
3889 glw::GLuint m_rbo_invalid;
3890 glw::GLenum m_internalformat_invalid;
3892 /* StorageErrorsTest class */
3894 /** Named Renderbuffer Storage Multisample Errors
3896 * Check that INVALID_OPERATION is generated by
3897 * NamedRenderbufferStorageMultisample function if renderbuffer is not the
3898 * name of an existing renderbuffer object.
3900 * Check that INVALID_VALUE is generated by
3901 * NamedRenderbufferStorageMultisample if samples is greater than
3904 * Check that INVALID_ENUM is generated by
3905 * NamedRenderbufferStorageMultisample if internalformat is not a
3906 * color-renderable, depth-renderable, or stencil-renderable format.
3908 * Check that INVALID_OPERATION is generated by
3909 * NamedRenderbufferStorageMultisample if internalformat is a signed or
3910 * unsigned integer format and samples is greater than the value of
3911 * MAX_INTEGER_SAMPLES.
3913 * Check that INVALID_VALUE is generated by
3914 * NamedRenderbufferStorageMultisample if either of width or height is
3915 * negative, or greater than the value of GL_MAX_RENDERBUFFER_SIZE.
3917 class StorageMultisampleErrorsTest : public deqp::TestCase
3920 /* Public member functions */
3921 StorageMultisampleErrorsTest(deqp::Context& context);
3923 virtual tcu::TestNode::IterateResult iterate();
3926 /* Private member functions */
3927 StorageMultisampleErrorsTest(const StorageMultisampleErrorsTest& other);
3928 StorageMultisampleErrorsTest& operator=(const StorageMultisampleErrorsTest& other);
3930 void PrepareObjects();
3931 bool ExpectError(glw::GLenum expected_error, const glw::GLchar* function, const glw::GLchar* conditions);
3934 /* Private member variables. */
3935 glw::GLuint m_rbo_valid;
3936 glw::GLuint m_rbo_invalid;
3937 glw::GLenum m_internalformat_invalid;
3938 glw::GLint m_max_samples;
3939 glw::GLint m_max_integer_samples;
3941 /* StorageMultisampleErrorsTest class */
3943 /** Get Named Renderbuffer Parameter Errors
3945 * Check that INVALID_OPERATION is generated by
3946 * GetNamedRenderbufferParameteriv if renderbuffer is not the name of an
3947 * existing renderbuffer object.
3949 * Check that INVALID_ENUM is generated by GetNamedRenderbufferParameteriv
3950 * if parameter name is not one of the accepted parameter names described
3953 class GetParameterErrorsTest : public deqp::TestCase
3956 /* Public member functions */
3957 GetParameterErrorsTest(deqp::Context& context);
3959 virtual tcu::TestNode::IterateResult iterate();
3962 /* Private member functions */
3963 GetParameterErrorsTest(const GetParameterErrorsTest& other);
3964 GetParameterErrorsTest& operator=(const GetParameterErrorsTest& other);
3966 void PrepareObjects();
3967 bool ExpectError(glw::GLenum expected_error, const glw::GLchar* function, const glw::GLchar* conditions);
3970 /* Private member variables. */
3971 glw::GLuint m_rbo_valid;
3972 glw::GLuint m_rbo_invalid;
3973 glw::GLenum m_parameter_invalid;
3975 /* GetParameterErrorsTest class */
3976 } /* Renderbuffers namespace */
3978 namespace VertexArrays
3980 /** Vertex Array Object Creation
3982 * Create at least two vertex array objects using GenVertexArrays function.
3983 * Check them without binding, using IsVertexArray function. Expect FALSE.
3985 * Create at least two vertex array objects using CreateVertexArrays
3986 * function. Check them without binding, using IsVertexArray function.
3991 class CreationTest : public deqp::TestCase
3994 /* Public member functions */
3995 CreationTest(deqp::Context& context);
3997 virtual tcu::TestNode::IterateResult iterate();
4000 /* Private member functions */
4001 CreationTest(const CreationTest& other);
4002 CreationTest& operator=(const CreationTest& other);
4004 /* CreationTest class */
4006 /** Vertex Array Object Enable Disable Attributes
4008 * Prepare vertex shader with (MAX_VERTEX_ATTRIBS / 2) attribute variables.
4009 * Vertex shader shall sum all input attribute variables and pass the sum
4010 * to transform feedback varying. Build program in two versions:
4011 * 1) with attribute variable names bound to even attribute indexes;
4012 * 2) with attribute variable names bound to odd attribute indexes.
4014 * Prepare and bind vertex array object.
4016 * Prepare buffer object with MAX_VERTEX_ATTRIBS of consecutive numbers.
4017 * Bound each of the numbers to separate index. Prepare second object for
4018 * transform feedback result.
4020 * Unbind vertex array object.
4022 * Enable even attribute indexes using EnableVertexArrayAttrib. Expect no
4025 * Bind vertex array object.
4027 * Use first program. Draw single point using transform feedback. Expect
4028 * sum of numbers at even positions in the input (reference) buffer object.
4030 * Unbind vertex array object.
4032 * Disable even attribute indexes using DisableVertexArrayAttrib. Expect no
4035 * Enable odd attribute indexes using EnableVertexArrayAttrib. Expect no
4038 * Bind vertex array object.
4040 * Use second program. Draw single point using transform feedback. Expect
4041 * sum of numbers at odd positions in the input (reference) buffer object.
4043 * Unbind vertex array object.
4045 * Release all objects.
4047 class EnableDisableAttributesTest : public deqp::TestCase
4050 /* Public member functions */
4051 EnableDisableAttributesTest(deqp::Context& context);
4053 virtual tcu::TestNode::IterateResult iterate();
4056 /* Private member functions. */
4057 EnableDisableAttributesTest(const EnableDisableAttributesTest& other);
4058 EnableDisableAttributesTest& operator=(const EnableDisableAttributesTest& other);
4060 glw::GLuint PrepareProgram(const bool bind_even_or_odd);
4061 glw::GLuint BuildProgram(const char* vertex_shader, const bool bind_even_or_odd);
4064 bool DrawAndCheck(bool bind_even_or_odd);
4065 bool TurnOnAttributes(bool enable_even, bool enable_odd);
4068 /* Private member variables. */
4069 glw::GLuint m_po_even;
4070 glw::GLuint m_po_odd;
4073 glw::GLuint m_bo_xfb;
4074 glw::GLint m_max_attributes;
4076 /* Private static constants. */
4077 static const glw::GLchar s_vertex_shader_template[];
4078 static const glw::GLchar s_fragment_shader[];
4080 /* EnableDisableAttributesTest class */
4082 /** Vertex Array Object Element Buffer
4084 * Prepare GLSL program which passes input attribute to transform feedback
4087 * Create and bind vertex array object.
4089 * Prepare buffer object with integer data {2, 1, 0}. Set this buffer as an
4090 * input attribute. Use non-DSA functions.
4092 * Unbind vertex array object.
4094 * Prepare buffer object with integer data {2, 1, 0}. Set this buffer as an
4095 * element buffer using VertexArrayElementBuffer function.
4097 * Bind vertex array object.
4099 * Use the program. Draw three points using transform feedback. Expect
4100 * result equal to {0, 1, 2}.
4102 * Release all objects.
4104 class ElementBufferTest : public deqp::TestCase
4107 /* Public member functions */
4108 ElementBufferTest(deqp::Context& context);
4110 virtual tcu::TestNode::IterateResult iterate();
4113 /* Private member functions. */
4114 ElementBufferTest(const ElementBufferTest& other);
4115 ElementBufferTest& operator=(const ElementBufferTest& other);
4117 void PrepareProgram();
4120 bool DrawAndCheck();
4123 /* Private member variables. */
4126 glw::GLuint m_bo_array;
4127 glw::GLuint m_bo_elements;
4128 glw::GLuint m_bo_xfb;
4130 /* Private static constants. */
4131 static const glw::GLchar s_vertex_shader[];
4132 static const glw::GLchar s_fragment_shader[];
4134 /* ElementBufferTest class */
4136 /** Vertex Array Object Vertex Buffer and Buffers
4138 * Prepare GLSL program which passes sum of three input integer attributes
4139 * to the transform feedback varying.
4141 * Prepare two vertex buffer objects. Setup first buffer with data {0, 1,
4143 * Setup second buffer with data {4, 5}.
4145 * Create vertex array object. Setup three vertex attributes. Set first
4146 * buffer object as an input attribute 0 and 1 in interleaved way using
4147 * VertexArrayVertexBuffer function. Set second buffer object as an input
4148 * attribute 2 using VertexArrayVertexBuffer function.
4150 * Use program. Draw 2 points using transform feedback. Query results.
4151 * Expect two values {0+2+4, 1+3+5}.
4155 * Repeat the test using VertexArrayVertexBuffers function instead of
4156 * VertexArrayVertexBuffer.
4158 class VertexBuffersTest : public deqp::TestCase
4161 /* Public member functions */
4162 VertexBuffersTest(deqp::Context& context);
4164 virtual tcu::TestNode::IterateResult iterate();
4167 /* Private member functions. */
4168 VertexBuffersTest(const VertexBuffersTest& other);
4169 VertexBuffersTest& operator=(const VertexBuffersTest& other);
4171 void PrepareProgram();
4172 bool PrepareVAO(bool use_multiple_buffers_function);
4174 bool DrawAndCheck();
4177 /* Private member variables. */
4180 glw::GLuint m_bo_array_0;
4181 glw::GLuint m_bo_array_1;
4182 glw::GLuint m_bo_xfb;
4184 /* Private static constants. */
4185 static const glw::GLchar s_vertex_shader[];
4186 static const glw::GLchar s_fragment_shader[];
4188 /* VertexBuffersTest class */
4190 /** Vertex Array Object Attribute Format
4192 * Prepare GLSL program which passes sum of two input attributes to the
4193 * transform feedback varying.
4195 * Create vertex array object.
4197 * Prepare vertex buffer object with reference data of two interleaved
4198 * arrays. Setup it as input interleaved attributes.
4200 * Setup two consecutive attributes using VertexArrayAttribFormat function.
4202 * Use program. Draw 2 points using transform feedback. Query results.
4203 * Expect sum of adequate reference values.
4207 * Repeat the test using VertexArrayAttribIFormat VertexArrayAttribLFormat
4208 * function instead of VertexArrayAttribFormat.
4210 * Repeat the test using size 1, 2, 3, and 4 (if possible by type).
4212 * Repeat the test using type BYTE, SHORT, INT, FLOAT, DOUBLE,
4213 * UNSIGNED_BYTE, UNSIGNED_SHORT, UNSIGNED_INT.
4215 * For test with VertexArrayAttribFormat function repeat for normalized and
4216 * not normalized values.
4218 class AttributeFormatTest : public deqp::TestCase
4221 /* Public member functions */
4222 AttributeFormatTest(deqp::Context& context);
4224 virtual tcu::TestNode::IterateResult iterate();
4227 /* Private state enumerations. */
4228 enum AtributeFormatFunctionType
4230 ATTRIBUTE_FORMAT_FUNCTION_FLOAT,
4231 ATTRIBUTE_FORMAT_FUNCTION_DOUBLE,
4232 ATTRIBUTE_FORMAT_FUNCTION_INTEGER,
4233 ATTRIBUTE_FORMAT_FUNCTION_COUNT /* Must be last */
4236 /* Private member functions. */
4237 AttributeFormatTest(const AttributeFormatTest& other);
4238 AttributeFormatTest& operator=(const AttributeFormatTest& other);
4240 template <typename T>
4241 bool compare(T a, T b);
4243 void PrepareProgram(glw::GLint size, AtributeFormatFunctionType function_selector);
4245 template <typename T>
4246 glw::GLdouble NormalizationScaleFactor();
4248 template <typename T>
4249 bool PrepareVAO(glw::GLint size, glw::GLenum type_gl_name, bool normalized,
4250 AtributeFormatFunctionType function_selector);
4254 template <typename T>
4255 bool DrawAndCheck(glw::GLint size, bool normalized);
4258 void CleanProgram();
4261 /* Private member variables. */
4264 glw::GLuint m_bo_array;
4265 glw::GLuint m_bo_xfb;
4267 /* Private static constants. */
4268 static const glw::GLchar* s_vertex_shader_head;
4269 static const glw::GLchar* s_vertex_shader_body;
4270 static const glw::GLchar* s_vertex_shader_declaration[ATTRIBUTE_FORMAT_FUNCTION_COUNT][4 /* sizes count */];
4271 static const glw::GLchar* s_fragment_shader;
4273 /* AttributeFormatTest class */
4275 /** Vertex Array Attribute Binding
4277 * Prepare GLSL program which passes two integer input attributes to the
4278 * two-component transform feedback varying vector. Bind first attribute
4279 * to attribute index 0. Bind second attribute to attribute index 1.
4281 * Create vertex array object.
4283 * Prepare vertex buffer object. Setup the buffer with data {1, 0}.
4284 * Setup two integer attribute pointers in consecutive way.
4286 * Using VertexArrayAttribBinding function, set up binding index 0 to the
4287 * attribute index 1. Using VertexArrayAttribBinding function, set up
4288 * binding index 1 to the attribute index 0.
4290 * Prepare transform feedback buffer object.
4294 class AttributeBindingTest : public deqp::TestCase
4297 /* Public member functions */
4298 AttributeBindingTest(deqp::Context& context);
4300 virtual tcu::TestNode::IterateResult iterate();
4303 /* Private member functions. */
4304 AttributeBindingTest(const AttributeBindingTest& other);
4305 AttributeBindingTest& operator=(const AttributeBindingTest& other);
4307 void PrepareProgram();
4310 bool DrawAndCheck();
4313 /* Private member variables. */
4316 glw::GLuint m_bo_array;
4317 glw::GLuint m_bo_xfb;
4319 /* Private static constants. */
4320 static const glw::GLchar s_vertex_shader[];
4321 static const glw::GLchar s_fragment_shader[];
4323 /* AttributeBindingTest class */
4325 class AttributeBindingDivisorTest : public deqp::TestCase
4328 /* Public member functions */
4329 AttributeBindingDivisorTest(deqp::Context& context);
4331 virtual tcu::TestNode::IterateResult iterate();
4334 /* Private member functions. */
4335 AttributeBindingDivisorTest(const AttributeBindingDivisorTest& other);
4336 AttributeBindingDivisorTest& operator=(const AttributeBindingDivisorTest& other);
4338 void PrepareProgram();
4341 void Draw(glw::GLuint number_of_points, glw::GLuint number_of_instances);
4342 bool SetDivisor(glw::GLuint divisor);
4343 bool CheckXFB(const glw::GLuint count, const glw::GLint expected[], const glw::GLchar* log_message);
4346 /* Private member variables. */
4349 glw::GLuint m_bo_array;
4350 glw::GLuint m_bo_xfb;
4352 /* Private static constants. */
4353 static const glw::GLchar s_vertex_shader[];
4354 static const glw::GLchar s_fragment_shader[];
4356 /* AttributeBindingDivisorTest class */
4360 * Create vertex array object.
4362 * Create buffer object. Set this buffer as an element buffer of the vertex
4365 * Query ELEMENT_ARRAY_BUFFER_BINDING using GetVertexArrayiv. Expect buffer
4368 * Release all objects.
4370 class GetVertexArrayTest : public deqp::TestCase
4373 /* Public member functions */
4374 GetVertexArrayTest(deqp::Context& context);
4376 virtual tcu::TestNode::IterateResult iterate();
4379 /* Private member functions. */
4380 GetVertexArrayTest(const GetVertexArrayTest& other);
4381 GetVertexArrayTest& operator=(const GetVertexArrayTest& other);
4383 /* GetVertexArrayTest class */
4385 /** Get Vertex Array Indexed
4387 * Create vertex array object.
4389 * Enable attribute indexes 0, 1, 2 and 3.
4391 * Create 4 buffer objects. Set these buffer as attribute arrays:
4392 * - attribute 0 with size 1, type BYTE, normalized, stride 0, offset 0,
4393 * relative offset 0, binding divisor to 3;
4394 * - integer attribute 1 with size 2, type SHORT, stride 2, offset 2,
4395 * relative offset 0, binding divisor to 2;
4396 * - attribute 2 with size 3, type FLOAT, not normalized, stride 0,
4397 * offset 8, relative offset 4, binding divisor to 1;
4398 * - attribute 3 with size 4, type UNSIGNED_INT_2_10_10_10_REV, not
4399 * normalized, stride 8, offset 4, relative offset 0,
4400 * binding divisor to 0.
4402 * Query VERTEX_ATTRIB_ARRAY_ENABLED using GetVertexArrayIndexediv. Expect
4403 * TRUE for consecutive indexes 0-3 and FALSE for index 4.
4405 * Query VERTEX_ATTRIB_ARRAY_SIZE using GetVertexArrayIndexediv. Expect
4406 * 1, 2, 3, 4 for consecutive indexes.
4408 * Query VERTEX_ATTRIB_ARRAY_STRIDE using GetVertexArrayIndexediv. Expect
4409 * 0, 2, 0, 8 for consecutive indexes.
4411 * Query VERTEX_ATTRIB_ARRAY_TYPE using GetVertexArrayIndexediv. Expect
4412 * BYTE, SHORT, FLOAT, UNSIGNED_INT_2_10_10_10_REV for consecutive indexes.
4414 * Query VERTEX_ATTRIB_ARRAY_NORMALIZED using GetVertexArrayIndexediv.
4415 * Expect true, false, false, false for consecutive indexes.
4417 * Query VERTEX_ATTRIB_ARRAY_INTEGER using GetVertexArrayIndexediv.
4418 * Expect true, true, false, true for consecutive indexes.
4420 * Query VERTEX_ATTRIB_ARRAY_LONG using GetVertexArrayIndexediv. Expect
4421 * false for consecutive indexes.
4423 * Query VERTEX_ATTRIB_ARRAY_DIVISOR using GetVertexArrayIndexediv. Expect
4424 * 3, 2, 1, 0 for consecutive indexes.
4426 * Query VERTEX_ATTRIB_RELATIVE_OFFSET using GetVertexArrayIndexediv.
4427 * Expect 0, 0, 4, 0 for consecutive indexes.
4429 * Query VERTEX_BINDING_OFFSET using GetVertexArrayIndexed64iv. Expect 0,
4430 * 2, 8, 4 for consecutive indexes.
4432 * Release all objects.
4434 class GetVertexArrayIndexedTest : public deqp::TestCase
4437 /* Public member functions */
4438 GetVertexArrayIndexedTest(deqp::Context& context);
4440 virtual tcu::TestNode::IterateResult iterate();
4443 /* Private member functions. */
4444 GetVertexArrayIndexedTest(const GetVertexArrayIndexedTest& other);
4445 GetVertexArrayIndexedTest& operator=(const GetVertexArrayIndexedTest& other);
4448 bool Check(const glw::GLenum pname, const glw::GLuint index, const glw::GLint expected);
4449 bool Check64(const glw::GLenum pname, const glw::GLuint index, const glw::GLint64 expected);
4451 /* Private member variables. */
4453 glw::GLuint m_bo[4];
4455 /* GetVertexArrayIndexedTest class */
4457 /** Vertex Array Defaults
4459 * Create empty vertex array object using CreateVertexArrays function.
4461 * Check that parameter VERTEX_ATTRIB_ARRAY_ENABLED for all possible
4462 * attributes is equal to value FALSE.
4464 * Check that parameter VERTEX_ATTRIB_ARRAY_SIZE for all possible
4465 * attributes is equal to value 4.
4467 * Check that parameter VERTEX_ATTRIB_ARRAY_STRIDE for all possible
4468 * attributes is equal to value 0.
4470 * Check that parameter VERTEX_ATTRIB_ARRAY_TYPE for all possible
4471 * attributes is equal to value FLOAT.
4473 * Check that parameter VERTEX_ATTRIB_ARRAY_NORMALIZED for all possible
4474 * attributes is equal to value FALSE.
4476 * Check that parameter VERTEX_ATTRIB_ARRAY_INTEGER for all possible
4477 * attributes is equal to value FALSE.
4479 * Check that parameter VERTEX_ATTRIB_ARRAY_LONG for all possible
4480 * attributes is equal to value FALSE.
4482 * Check that parameter VERTEX_ATTRIB_ARRAY_DIVISOR for all possible
4483 * attributes is equal to value 0.
4485 * Check that parameter VERTEX_ATTRIB_RELATIVE_OFFSET for all possible
4486 * attributes is equal to value 0.
4488 * Check that parameter VERTEX_BINDING_OFFSET for all possible attributes
4489 * is equal to value 0.
4491 * Check that parameter ELEMENT_ARRAY_BUFFER_BINDING is equal to value 0.
4493 * Release vertex array object.
4495 class DefaultsTest : public deqp::TestCase
4498 /* Public member functions */
4499 DefaultsTest(deqp::Context& context);
4501 virtual tcu::TestNode::IterateResult iterate();
4504 /* Private member functions. */
4505 DefaultsTest(const DefaultsTest& other);
4506 DefaultsTest& operator=(const DefaultsTest& other);
4509 bool Check(const glw::GLenum pname, const glw::GLint expected);
4510 bool CheckIndexed(const glw::GLenum pname, const glw::GLuint index, const glw::GLint expected);
4511 bool CheckIndexed64(const glw::GLenum pname, const glw::GLuint index, const glw::GLint64 expected);
4513 /* Private member variables. */
4516 /* DefaultsTest class */
4518 /** Vertex Array Object Creation Error
4520 * Check that INVALID_VALUE is generated if n is negative.
4522 class CreationErrorTest : public deqp::TestCase
4525 /* Public member functions */
4526 CreationErrorTest(deqp::Context& context);
4528 virtual tcu::TestNode::IterateResult iterate();
4531 /* Private member functions. */
4532 CreationErrorTest(const CreationErrorTest& other);
4533 CreationErrorTest& operator=(const CreationErrorTest& other);
4535 bool CheckError(const glw::GLenum expected, const glw::GLchar* log_message);
4537 /* CreationErrorTest class */
4539 /** Vertex Array Object Enable Disable Attribute Errors
4541 * Check that INVALID_OPERATION is generated by EnableVertexArrayAttrib and
4542 * DisableVertexArrayAttrib if vaobj is not the name of an existing vertex
4545 * Check that INVALID_VALUE is generated if index is greater than or equal
4546 * to MAX_VERTEX_ATTRIBS.
4548 class EnableDisableAttributeErrorsTest : public deqp::TestCase
4551 /* Public member functions */
4552 EnableDisableAttributeErrorsTest(deqp::Context& context);
4554 virtual tcu::TestNode::IterateResult iterate();
4557 /* Private member functions. */
4558 EnableDisableAttributeErrorsTest(const EnableDisableAttributeErrorsTest& other);
4559 EnableDisableAttributeErrorsTest& operator=(const EnableDisableAttributeErrorsTest& other);
4561 bool CheckError(const glw::GLenum expected, const glw::GLchar* log_message);
4563 /* EnableDisableAttributeErrorsTest class */
4565 /** Vertex Array Object Element Buffer Errors
4567 * Check that INVALID_OPERATION error is generated by VertexArrayElementBuffer if vaobj is not the name
4568 * of an existing vertex array object.
4570 * Check that INVALID_OPERATION error is generated by VertexArrayElementBuffer if buffer is not zero or
4571 * the name of an existing buffer object.
4573 class ElementBufferErrorsTest : public deqp::TestCase
4576 /* Public member functions */
4577 ElementBufferErrorsTest(deqp::Context& context);
4579 virtual tcu::TestNode::IterateResult iterate();
4582 /* Private member functions. */
4583 ElementBufferErrorsTest(const ElementBufferErrorsTest& other);
4584 ElementBufferErrorsTest& operator=(const ElementBufferErrorsTest& other);
4586 bool CheckError(const glw::GLenum expected, const glw::GLchar* log_message);
4588 /* ElementBuffersErrorsTest class */
4590 /** Vertex Array Object Buffer and Buffers Errors
4592 * Check that INVALID_OPERATION is generated by VertexArrayVertexBuffer and
4593 * VertexArrayVertexBuffers if vaobj is not the name of an existing vertex
4596 * Check that INVALID_VALUE is generated by VertexArrayVertexBuffer if
4597 * buffer is not zero or the name of an existing buffer object (as returned
4598 * by GenBuffers or CreateBuffers).
4600 * Check that INVALID_OPERATION is generated by VertexArrayVertexBuffers if
4601 * any value in buffers is not zero or the name of an existing buffer
4604 * Check that INVALID_VALUE is generated by VertexArrayVertexBuffer if
4605 * bindingindex is greater than or equal to the value of
4606 * MAX_VERTEX_ATTRIB_BINDINGS.
4608 * Check that INVALID_OPERATION is generated by VertexArrayVertexBuffers if
4609 * first+count is greater than the value of MAX_VERTEX_ATTRIB_BINDINGS.
4611 * Check that INVALID_VALUE is generated by VertexArrayVertexBuffer if
4612 * offset or stride is less than zero, or if stride is greater than the
4613 * value of MAX_VERTEX_ATTRIB_STRIDE.
4615 * Check that INVALID_VALUE is generated by VertexArrayVertexBuffers if any
4616 * value in offsets or strides is negative, or if a value is stride is
4617 * greater than the value of MAX_VERTEX_ATTRIB_STRIDE.
4619 class VertexBuffersErrorsTest : public deqp::TestCase
4622 /* Public member functions */
4623 VertexBuffersErrorsTest(deqp::Context& context);
4625 virtual tcu::TestNode::IterateResult iterate();
4628 /* Private member functions. */
4629 VertexBuffersErrorsTest(const VertexBuffersErrorsTest& other);
4630 VertexBuffersErrorsTest& operator=(const VertexBuffersErrorsTest& other);
4632 bool CheckError(const glw::GLenum expected, const glw::GLchar* log_message);
4634 /* VertexBuffersErrorsTest class */
4636 /** Vertex Array Object Attribute Format Errors
4638 * Check that INVALID_VALUE is generated by VertexArrayAttrib*Format if
4639 * attribindex is greater than or equal to the value of MAX_VERTEX_ATTRIBS.
4641 * Check that INVALID_VALUE is generated by VertexArrayAttrib*Format if
4642 * size is not one of the accepted values.
4644 * Check that INVALID_VALUE is generated by VertexArrayAttrib*Format if
4645 * relativeoffset is greater than the value of
4646 * MAX_VERTEX_ATTRIB_RELATIVE_OFFSET.
4648 * Check that INVALID_ENUM is generated by VertexArrayAttrib*Format if type
4649 * is not one of the accepted tokens.
4651 * Check that INVALID_ENUM is generated by VertexArrayAttrib{IL}Format if
4652 * type is UNSIGNED_INT_10F_11F_11F_REV.
4654 * Check that INVALID_OPERATION is generated by VertexArrayAttrib*Format if
4655 * vaobj is not the name of an existing vertex array object.
4657 * Check that INVALID_OPERATION is generated by VertexArrayAttribFormat
4658 * under any of the following conditions:
4659 * - size is BGRA and type is not UNSIGNED_BYTE, INT_2_10_10_10_REV or
4660 * UNSIGNED_INT_2_10_10_10_REV,
4661 * - type is INT_2_10_10_10_REV or UNSIGNED_INT_2_10_10_10_REV, and size
4662 * is neither 4 nor BGRA,
4663 * - type is UNSIGNED_INT_10F_11F_11F_REV and size is not 3,
4664 * - size is BGRA and normalized is FALSE.
4666 class AttributeFormatErrorsTest : public deqp::TestCase
4669 /* Public member functions */
4670 AttributeFormatErrorsTest(deqp::Context& context);
4672 virtual tcu::TestNode::IterateResult iterate();
4675 /* Private member functions. */
4676 AttributeFormatErrorsTest(const AttributeFormatErrorsTest& other);
4677 AttributeFormatErrorsTest& operator=(const AttributeFormatErrorsTest& other);
4679 bool CheckError(const glw::GLenum expected, const glw::GLchar* log_message);
4681 /* AttributeFormatErrorsTest class */
4683 /** Vertex Array Attribute Binding Errors
4685 * Check that INVALID_OPERATION is generated by VertexArrayAttribBinding if
4686 * vaobj is not the name of an existing vertex array object.
4688 * Check that INVALID_VALUE is generated by VertexArrayAttribBinding if
4689 * attribindex is greater than or equal to the value of MAX_VERTEX_ATTRIBS.
4691 * Check that INVALID_VALUE is generated by VertexArrayAttribBinding if
4692 * bindingindex is greater than or equal to the value of
4693 * MAX_VERTEX_ATTRIB_BINDINGS.
4695 class AttributeBindingErrorsTest : public deqp::TestCase
4698 /* Public member functions */
4699 AttributeBindingErrorsTest(deqp::Context& context);
4701 virtual tcu::TestNode::IterateResult iterate();
4704 /* Private member functions. */
4705 AttributeBindingErrorsTest(const AttributeBindingErrorsTest& other);
4706 AttributeBindingErrorsTest& operator=(const AttributeBindingErrorsTest& other);
4708 bool CheckError(const glw::GLenum expected, const glw::GLchar* log_message);
4710 /* AttributeBindingErrorsTest class */
4712 /** Vertex Array Binding Divisor Errors
4714 * Check that INVALID_VALUE is generated by VertexArrayBindingDivisor if
4715 * bindingindex is greater than or equal to the value of
4716 * MAX_VERTEX_ATTRIB_BINDINGS.
4718 * Check that INVALID_OPERATION is generated by VertexArrayBindingDivisor
4719 * if vaobj is not the name of an existing vertex array object.
4721 class AttributeBindingDivisorErrorsTest : public deqp::TestCase
4724 /* Public member functions */
4725 AttributeBindingDivisorErrorsTest(deqp::Context& context);
4727 virtual tcu::TestNode::IterateResult iterate();
4730 /* Private member functions. */
4731 AttributeBindingDivisorErrorsTest(const AttributeBindingDivisorErrorsTest& other);
4732 AttributeBindingDivisorErrorsTest& operator=(const AttributeBindingDivisorErrorsTest& other);
4734 bool CheckError(const glw::GLenum expected, const glw::GLchar* log_message);
4736 /* AttributeBindingDivisorErrorsTest class */
4738 /** Get Vertex Array Errors
4740 * Check that INVALID_OPERATION error is generated by GetVertexArrayiv if
4741 * vaobj is not the name of an existing vertex array object.
4743 * Check that INVALID_ENUM error is generated by GetVertexArrayiv if pname
4744 * is not ELEMENT_ARRAY_BUFFER_BINDING.
4746 class GetVertexArrayErrorsTest : public deqp::TestCase
4749 /* Public member functions */
4750 GetVertexArrayErrorsTest(deqp::Context& context);
4752 virtual tcu::TestNode::IterateResult iterate();
4755 /* Private member functions. */
4756 GetVertexArrayErrorsTest(const GetVertexArrayErrorsTest& other);
4757 GetVertexArrayErrorsTest& operator=(const GetVertexArrayErrorsTest& other);
4759 bool CheckError(const glw::GLenum expected, const glw::GLchar* log_message);
4761 /* GetVertexArrayErrorsTest class */
4763 /** Get Vertex Array Indexed Errors
4765 * Check that INVALID_OPERATION error is generated by
4766 * GetVertexArrayIndexediv and GetVertexArrayIndexed64iv if vaobj is not
4767 * the name of an existing vertex array object.
4769 * Check that INVALID_VALUE error is generated by GetVertexArrayIndexediv
4770 * and GetVertexArrayIndexed64iv if index is greater than or equal to the
4771 * value of MAX_VERTEX_ATTRIBS.
4773 * Check that INVALID_ENUM error is generated by GetVertexArrayIndexediv if
4774 * pname is not one of the valid values:
4775 * - VERTEX_ATTRIB_ARRAY_ENABLED,
4776 * - VERTEX_ATTRIB_ARRAY_SIZE,
4777 * - VERTEX_ATTRIB_ARRAY_STRIDE,
4778 * - VERTEX_ATTRIB_ARRAY_TYPE,
4779 * - VERTEX_ATTRIB_ARRAY_NORMALIZED,
4780 * - VERTEX_ATTRIB_ARRAY_INTEGER,
4781 * - VERTEX_ATTRIB_ARRAY_LONG,
4782 * - VERTEX_ATTRIB_ARRAY_DIVISOR,
4783 * - VERTEX_ATTRIB_RELATIVE_OFFSET.
4785 * Check that INVALID_ENUM error is generated by GetVertexArrayIndexed64iv
4786 * if pname is not VERTEX_BINDING_OFFSET.
4788 class GetVertexArrayIndexedErrorsTest : public deqp::TestCase
4791 /* Public member functions */
4792 GetVertexArrayIndexedErrorsTest(deqp::Context& context);
4794 virtual tcu::TestNode::IterateResult iterate();
4797 /* Private member functions. */
4798 GetVertexArrayIndexedErrorsTest(const GetVertexArrayIndexedErrorsTest& other);
4799 GetVertexArrayIndexedErrorsTest& operator=(const GetVertexArrayIndexedErrorsTest& other);
4801 bool CheckError(const glw::GLenum expected, const glw::GLchar* log_message);
4803 /* GetVertexArrayIndexedErrorsTest class */
4807 std::string itoa(glw::GLuint i);
4808 std::string replace(const std::string& src, const std::string& key, const std::string& value);
4809 } /* Vertex Arrays utilities class */
4810 } /* VertexArrays namespace */
4812 /* Direct State Access Textures Tests */
4815 /** @class CreationTest
4817 * @brief Direct State Access Texture Creation test cases.
4819 * Test follows the steps:
4821 * Create at least two texture objects using GenTextures function. Check
4822 * them without binding, using IsTexture function. Expect FALSE.
4824 * Create at least two texture objects using CreateTextures function. Check
4825 * them without binding, using IsTexture function. Expect TRUE. Repeat this
4826 * step for all targets:
4830 * - TEXTURE_1D_ARRAY,
4831 * - TEXTURE_2D_ARRAY,
4832 * - TEXTURE_RECTANGLE,
4833 * - TEXTURE_CUBE_MAP,
4834 * - TEXTURE_CUBE_MAP_ARRAY,
4836 * - TEXTURE_2D_MULTISAMPLE and
4837 * - TEXTURE_2D_MULTISAMPLE_ARRAY.
4841 class CreationTest : public deqp::TestCase
4844 /* Public member functions */
4845 CreationTest(deqp::Context& context);
4847 virtual tcu::TestNode::IterateResult iterate();
4850 /* Private member functions */
4851 CreationTest(const CreationTest& other);
4852 CreationTest& operator=(const CreationTest& other);
4854 /* CreationTest class */
4859 template <typename T, glw::GLint S, bool N>
4860 static glw::GLenum InternalFormat();
4862 template <glw::GLint S, bool N>
4863 static glw::GLenum Format();
4865 template <typename T>
4866 static glw::GLenum Type();
4868 template <typename T, bool N>
4869 static const T* ReferenceData();
4871 static glw::GLuint ReferenceDataCount();
4873 template <typename T>
4874 static glw::GLuint ReferenceDataSize();
4876 template <typename T>
4877 static bool Compare(const T a, const T b);
4880 static const glw::GLuint s_reference_count = 2 /* 1D */ * 3 /* 2D */ * 4 /* 3D */ * 4 /* components */;
4883 /** @class BufferTest
4885 * @brief Direct State Access of texture buffers.
4889 * @tparam N Is normalized.
4891 * Test follows the steps:
4893 * Make test for following DSA functions:
4895 * - TextureBufferRange
4896 * and following texture internal formats:
4931 * Prepare program which draws textured quad 6 x 1 pixels in size. The
4932 * sampled texture shall be buffer texture which linearly store two rows
4935 * Prepare framebuffer 6 x 1 pixels in size.
4937 * Prepare texture object with attached buffer object as a storage using
4938 * TextureBuffer or TextureBufferRange function. When TextureBufferRange is
4939 * being used, test non-zero offset setup. The buffer object shall contain
4940 * unique reference values. Texture filtering shall be set to NEAREST.
4942 * Using prepared GL objects draw a quad. Fetch framebuffer data using
4943 * ReadPixels function. Compare the results with the reference data. Expect
4946 * Release all objects.
4948 template <typename T, glw::GLint S, bool N>
4949 class BufferTest : public deqp::TestCase, Reference
4952 /* Public member functions. */
4953 BufferTest(deqp::Context& context, const char* name);
4955 virtual tcu::TestNode::IterateResult iterate();
4958 /* Private constructors. */
4959 BufferTest(const BufferTest& other);
4960 BufferTest& operator=(const BufferTest& other);
4962 /* Private member functions. */
4963 static glw::GLuint TestReferenceDataCount();
4965 static glw::GLuint TestReferenceDataSize();
4967 static const glw::GLchar* FragmentShaderDeclaration();
4969 bool CreateBufferTexture(bool use_range_version);
4973 bool Test(bool use_range_version);
4975 bool PrepareFramebuffer(const glw::GLenum internal_format);
4976 void PrepareProgram(const glw::GLchar* variable_declaration);
4977 void PrepareVertexArray();
4979 void CleanBufferTexture();
4980 void CleanFramebuffer();
4981 void CleanProgram();
4983 void CleanVertexArray();
4985 /* Private member variables. */
4993 /* Private static constants. */
4994 static const glw::GLuint s_fbo_size_x = 6;
4995 static const glw::GLuint s_fbo_size_y = 1;
4996 static const glw::GLchar* s_vertex_shader;
4997 static const glw::GLchar* s_fragment_shader_head;
4998 static const glw::GLchar* s_fragment_shader_fdecl_lowp;
4999 static const glw::GLchar* s_fragment_shader_idecl_lowp;
5000 static const glw::GLchar* s_fragment_shader_udecl_lowp;
5001 static const glw::GLchar* s_fragment_shader_fdecl_mediump;
5002 static const glw::GLchar* s_fragment_shader_idecl_mediump;
5003 static const glw::GLchar* s_fragment_shader_udecl_mediump;
5004 static const glw::GLchar* s_fragment_shader_fdecl_highp;
5005 static const glw::GLchar* s_fragment_shader_idecl_highp;
5006 static const glw::GLchar* s_fragment_shader_udecl_highp;
5007 static const glw::GLchar* s_fragment_shader_tail;
5010 /** @brief Fragment shader part selector.
5012 * @return Array of characters with source code.
5014 template <typename T, glw::GLint S, bool N>
5015 const glw::GLchar* BufferTest<T, S, N>::FragmentShaderDeclaration()
5017 if (typeid(T) == typeid(glw::GLbyte))
5019 return s_fragment_shader_idecl_lowp;
5022 if (typeid(T) == typeid(glw::GLubyte))
5024 return N ? s_fragment_shader_fdecl_lowp : s_fragment_shader_udecl_lowp;
5027 if (typeid(T) == typeid(glw::GLshort))
5029 return s_fragment_shader_idecl_mediump;
5032 if (typeid(T) == typeid(glw::GLushort))
5034 return N ? s_fragment_shader_fdecl_mediump : s_fragment_shader_udecl_mediump;
5037 if (typeid(T) == typeid(glw::GLint))
5039 return s_fragment_shader_idecl_highp;
5042 if (typeid(T) == typeid(glw::GLuint))
5044 return s_fragment_shader_udecl_highp;
5047 return s_fragment_shader_fdecl_highp;
5050 /* BufferTest class */
5052 /** @class StorageAndSubImageTest
5054 * Make test for following DSA storage functions:
5055 * - TextureStorage1D,
5056 * - TextureStorage2D,
5057 * - TextureStorage3D
5058 * and DSA SubImage functions:
5059 * - TextureSubImage1D,
5060 * - TextureSubImage2D,
5061 * - TextureSubImage3D.
5063 * Test following internal formats:
5098 * Create texture and prepare its storage with the tested function and
5099 * reference data. The texture dimensions shall be 2x3x4 texels in
5100 * corresponding directions (if available).
5102 * Prepare GLSL program with fragment shader which fetches texture and passes
5103 * it to the framebuffer in serialized way.
5105 * Prepare framebuffer 24 x 1 pixels in size.
5107 * Make draw call with prepared texture and program. Fetch framebuffer and
5108 * compare values with the reference data. Expect equality.
5110 * Release all objects.
5112 class StorageAndSubImageTest : public deqp::TestCase, Reference
5115 /* Public member functions. */
5116 StorageAndSubImageTest(deqp::Context& context);
5118 virtual tcu::TestNode::IterateResult iterate();
5121 /* Private constructors. */
5122 StorageAndSubImageTest(const StorageAndSubImageTest& other);
5123 StorageAndSubImageTest& operator=(const StorageAndSubImageTest& other);
5125 /* Private member functions. */
5126 template <glw::GLint S, glw::GLuint D>
5127 static glw::GLuint TestReferenceDataCount();
5129 template <glw::GLuint D>
5130 static glw::GLuint TestReferenceDataWidth();
5132 template <glw::GLuint D>
5133 static glw::GLuint TestReferenceDataHeight();
5135 template <glw::GLuint D>
5136 static glw::GLuint TestReferenceDataDepth();
5138 template <typename T, glw::GLint S, glw::GLuint D>
5139 static glw::GLuint TestReferenceDataSize();
5141 template <typename T, bool N, glw::GLuint D>
5142 static const glw::GLchar* FragmentShaderDeclaration();
5144 template <glw::GLuint D>
5145 static const glw::GLchar* FragmentShaderTail();
5147 template <glw::GLuint D>
5148 static glw::GLenum TextureTarget();
5150 template <glw::GLuint D, bool I>
5151 bool TextureSubImage(glw::GLenum target, glw::GLuint texture, glw::GLint level, glw::GLint internalformat,
5152 glw::GLsizei width, glw::GLsizei height, glw::GLsizei depth, glw::GLenum format,
5153 glw::GLenum type, const glw::GLvoid* data);
5155 template <glw::GLuint D, bool I>
5156 bool TextureStorage(glw::GLenum target, glw::GLuint texture, glw::GLsizei levels, glw::GLenum internalformat,
5157 glw::GLsizei width, glw::GLsizei height, glw::GLsizei depth);
5159 template <typename T, glw::GLint S, bool N, glw::GLuint D, bool I>
5160 bool CreateTexture();
5162 template <typename T, glw::GLint S, bool N, glw::GLuint D>
5165 template <typename T, glw::GLint S, bool N, glw::GLuint D, bool I>
5168 template <typename T, bool N, glw::GLuint D, bool I>
5169 bool LoopTestOverS(bool skip_rgb);
5171 template <typename T, bool N, bool I>
5172 bool LoopTestOverDOverS(bool skip_rgb);
5174 void PrepareFramebuffer(const glw::GLenum internal_format, const glw::GLuint D);
5175 void PrepareProgram(const glw::GLchar* variable_declaration, const glw::GLchar* tail);
5176 void PrepareVertexArray();
5178 void CleanTexture();
5179 void CleanFramebuffer();
5180 void CleanProgram();
5182 void CleanVertexArray();
5184 /* Private member variables. */
5191 /* Private static constants. */
5192 static const glw::GLchar* s_vertex_shader;
5193 static const glw::GLchar* s_fragment_shader_head;
5194 static const glw::GLchar* s_fragment_shader_1D_fdecl_lowp;
5195 static const glw::GLchar* s_fragment_shader_1D_idecl_lowp;
5196 static const glw::GLchar* s_fragment_shader_1D_udecl_lowp;
5197 static const glw::GLchar* s_fragment_shader_1D_fdecl_mediump;
5198 static const glw::GLchar* s_fragment_shader_1D_idecl_mediump;
5199 static const glw::GLchar* s_fragment_shader_1D_udecl_mediump;
5200 static const glw::GLchar* s_fragment_shader_1D_fdecl_highp;
5201 static const glw::GLchar* s_fragment_shader_1D_idecl_highp;
5202 static const glw::GLchar* s_fragment_shader_1D_udecl_highp;
5203 static const glw::GLchar* s_fragment_shader_2D_fdecl_lowp;
5204 static const glw::GLchar* s_fragment_shader_2D_idecl_lowp;
5205 static const glw::GLchar* s_fragment_shader_2D_udecl_lowp;
5206 static const glw::GLchar* s_fragment_shader_2D_fdecl_mediump;
5207 static const glw::GLchar* s_fragment_shader_2D_idecl_mediump;
5208 static const glw::GLchar* s_fragment_shader_2D_udecl_mediump;
5209 static const glw::GLchar* s_fragment_shader_2D_fdecl_highp;
5210 static const glw::GLchar* s_fragment_shader_2D_idecl_highp;
5211 static const glw::GLchar* s_fragment_shader_2D_udecl_highp;
5212 static const glw::GLchar* s_fragment_shader_3D_fdecl_lowp;
5213 static const glw::GLchar* s_fragment_shader_3D_idecl_lowp;
5214 static const glw::GLchar* s_fragment_shader_3D_udecl_lowp;
5215 static const glw::GLchar* s_fragment_shader_3D_fdecl_mediump;
5216 static const glw::GLchar* s_fragment_shader_3D_idecl_mediump;
5217 static const glw::GLchar* s_fragment_shader_3D_udecl_mediump;
5218 static const glw::GLchar* s_fragment_shader_3D_fdecl_highp;
5219 static const glw::GLchar* s_fragment_shader_3D_idecl_highp;
5220 static const glw::GLchar* s_fragment_shader_3D_udecl_highp;
5221 static const glw::GLchar* s_fragment_shader_1D_tail;
5222 static const glw::GLchar* s_fragment_shader_2D_tail;
5223 static const glw::GLchar* s_fragment_shader_3D_tail;
5225 /* StorageAndSubImageTest class */
5227 /** class StorageMultisampleTest
5229 * Make test for following DSA functions:
5230 * - TextureStorage2DMultisample and
5231 * - TextureStorage3DMultisample.
5233 * Test following internal formats:
5268 * Create multisample texture and prepare its storage with the tested
5269 * function. The texture dimensions shall be 2x3x4 texels in corresponding
5270 * directions (if available) and two samples per texel.
5272 * Prepare two framebuffers. The first one with the multisample texture
5273 * as a color attachment with size 2x3 pixels and 4 color attachments
5274 * (layers). The second one with non-multisample renderbuffer storage
5277 * Prepare GLSL program which draws explicitly reference data to
5278 * multisample texture framebuffer.
5280 * Use program to draw the reference data into multisample texture.
5282 * Prepare second GLSL program with fragment shader which passes samples of
5283 * the input texture to the separate framebuffer pixels.
5285 * Use the second program to draw the multisample texture into
5288 * Fetch framebuffer data and compare with the reference values. Expect
5291 * Release all objects.
5293 class StorageMultisampleTest : public deqp::TestCase, Reference
5296 /* Public member functions. */
5297 StorageMultisampleTest(deqp::Context& context);
5299 virtual tcu::TestNode::IterateResult iterate();
5302 /* Private constructors. */
5303 StorageMultisampleTest(const StorageMultisampleTest& other);
5304 StorageMultisampleTest& operator=(const StorageMultisampleTest& other);
5306 /* Private member functions. */
5307 template <glw::GLint S, glw::GLuint D>
5308 static glw::GLuint TestReferenceDataCount();
5310 template <glw::GLuint D>
5311 static glw::GLuint TestReferenceDataWidth();
5313 template <glw::GLuint D>
5314 static glw::GLuint TestReferenceDataHeight();
5316 template <glw::GLuint D>
5317 static glw::GLuint TestReferenceDataDepth();
5319 template <typename T, glw::GLint S, glw::GLuint D>
5320 static glw::GLuint TestReferenceDataSize();
5322 template <typename T, bool N, glw::GLuint D>
5323 static const glw::GLchar* FragmentShaderDeclarationMultisample();
5325 template <typename T, bool N, glw::GLuint D>
5326 static const glw::GLchar* FragmentShaderDeclarationAuxiliary();
5328 template <glw::GLuint D>
5329 static const glw::GLchar* FragmentShaderTail();
5331 template <glw::GLuint D>
5332 static glw::GLenum InputTextureTarget();
5334 template <glw::GLuint D>
5335 void InputTextureImage(const glw::GLenum internal_format, const glw::GLuint width, const glw::GLuint height,
5336 const glw::GLuint depth, const glw::GLenum format, const glw::GLenum type,
5337 const glw::GLvoid* data);
5339 template <typename T, glw::GLint S, bool N, glw::GLuint D>
5340 void CreateInputTexture();
5342 template <typename T, glw::GLint S, bool N, glw::GLuint D>
5345 template <typename T, glw::GLint S, bool N, glw::GLuint D>
5348 template <typename T, bool N, glw::GLuint D>
5349 bool LoopTestOverS(bool skip_rgb);
5351 template <typename T, bool N>
5352 bool LoopTestOverDOverS(bool skip_rgb);
5354 template <glw::GLuint D>
5355 bool PrepareFramebufferMultisample(const glw::GLenum internal_format);
5357 template <glw::GLuint D>
5358 void PrepareFramebufferAuxiliary(const glw::GLenum internal_format);
5360 glw::GLuint PrepareProgram(const glw::GLchar* variable_declaration, const glw::GLchar* tail);
5361 void PrepareVertexArray();
5363 template <glw::GLuint D>
5366 void CleanInputTexture();
5367 void CleanAuxiliaryTexture();
5368 void CleanFramebuffers();
5369 void CleanPrograms();
5371 void CleanVertexArray();
5373 /* Private member variables. */
5374 glw::GLuint m_fbo_ms;
5375 glw::GLuint m_fbo_aux;
5376 glw::GLuint m_to_ms;
5377 glw::GLuint m_po_ms;
5378 glw::GLuint m_po_aux;
5380 glw::GLuint m_to_aux;
5383 /* Private static constants. */
5384 static const glw::GLchar* s_vertex_shader;
5385 static const glw::GLchar* s_fragment_shader_head;
5386 static const glw::GLchar* s_fragment_shader_ms_2D_fdecl_lowp;
5387 static const glw::GLchar* s_fragment_shader_ms_2D_idecl_lowp;
5388 static const glw::GLchar* s_fragment_shader_ms_2D_udecl_lowp;
5389 static const glw::GLchar* s_fragment_shader_ms_2D_fdecl_mediump;
5390 static const glw::GLchar* s_fragment_shader_ms_2D_idecl_mediump;
5391 static const glw::GLchar* s_fragment_shader_ms_2D_udecl_mediump;
5392 static const glw::GLchar* s_fragment_shader_ms_2D_fdecl_highp;
5393 static const glw::GLchar* s_fragment_shader_ms_2D_idecl_highp;
5394 static const glw::GLchar* s_fragment_shader_ms_2D_udecl_highp;
5396 static const glw::GLchar* s_fragment_shader_ms_3D_fdecl_lowp;
5397 static const glw::GLchar* s_fragment_shader_ms_3D_idecl_lowp;
5398 static const glw::GLchar* s_fragment_shader_ms_3D_udecl_lowp;
5399 static const glw::GLchar* s_fragment_shader_ms_3D_fdecl_mediump;
5400 static const glw::GLchar* s_fragment_shader_ms_3D_idecl_mediump;
5401 static const glw::GLchar* s_fragment_shader_ms_3D_udecl_mediump;
5402 static const glw::GLchar* s_fragment_shader_ms_3D_fdecl_highp;
5403 static const glw::GLchar* s_fragment_shader_ms_3D_idecl_highp;
5404 static const glw::GLchar* s_fragment_shader_ms_3D_udecl_highp;
5406 static const glw::GLchar* s_fragment_shader_aux_2D_fdecl_lowp;
5407 static const glw::GLchar* s_fragment_shader_aux_2D_idecl_lowp;
5408 static const glw::GLchar* s_fragment_shader_aux_2D_udecl_lowp;
5409 static const glw::GLchar* s_fragment_shader_aux_2D_fdecl_mediump;
5410 static const glw::GLchar* s_fragment_shader_aux_2D_idecl_mediump;
5411 static const glw::GLchar* s_fragment_shader_aux_2D_udecl_mediump;
5412 static const glw::GLchar* s_fragment_shader_aux_2D_fdecl_highp;
5413 static const glw::GLchar* s_fragment_shader_aux_2D_idecl_highp;
5414 static const glw::GLchar* s_fragment_shader_aux_2D_udecl_highp;
5416 static const glw::GLchar* s_fragment_shader_aux_3D_fdecl_lowp;
5417 static const glw::GLchar* s_fragment_shader_aux_3D_idecl_lowp;
5418 static const glw::GLchar* s_fragment_shader_aux_3D_udecl_lowp;
5419 static const glw::GLchar* s_fragment_shader_aux_3D_fdecl_mediump;
5420 static const glw::GLchar* s_fragment_shader_aux_3D_idecl_mediump;
5421 static const glw::GLchar* s_fragment_shader_aux_3D_udecl_mediump;
5422 static const glw::GLchar* s_fragment_shader_aux_3D_fdecl_highp;
5423 static const glw::GLchar* s_fragment_shader_aux_3D_idecl_highp;
5424 static const glw::GLchar* s_fragment_shader_aux_3D_udecl_highp;
5425 static const glw::GLchar* s_fragment_shader_tail_2D;
5426 static const glw::GLchar* s_fragment_shader_tail_3D;
5428 /* StorageMultisampleTest class */
5430 /** @class CompressedSubImage
5432 * Make test for following DSA functions:
5433 * - CompressedTextureSubImage1D,
5434 * - CompressedTextureSubImage2D,
5435 * - CompressedTextureSubImage3D.
5437 * Make test for following uncompressed internal formats:
5499 * and compressed internal formats:
5500 * - COMPRESSED_RGBA8_ETC2_EAC.
5502 * Create texture and setup its storage and data using tested function with
5505 * Prepare framebuffer with renderbuffer color attachment with floating
5506 * point internal format and with size 2x3 pixels
5508 * Prepare GLSL program with fragment shader which passes input texture to
5511 * Draw a full screen quad with the prepared texture, program and
5512 * framebuffer. Read the framebuffer content. Compare framebuffer's values
5513 * with the reference values. Take normalization and precision into
5514 * account. Expect equality.
5516 * Release all objects.
5518 class CompressedSubImageTest : public deqp::TestCase
5521 /* Public member functions. */
5522 CompressedSubImageTest(deqp::Context& context);
5524 virtual tcu::TestNode::IterateResult iterate();
5527 /* Private constructors. */
5528 CompressedSubImageTest(const CompressedSubImageTest& other);
5529 CompressedSubImageTest& operator=(const CompressedSubImageTest& other);
5531 void CreateTextures(glw::GLenum target);
5533 template <glw::GLuint D>
5534 glw::GLenum TextureTarget();
5536 template <glw::GLuint D>
5537 void TextureImage(glw::GLint internalformat);
5539 template <glw::GLuint D>
5540 void CompressedTexImage(glw::GLint internalformat);
5542 template <glw::GLuint D>
5543 bool CompressedTextureSubImage(glw::GLint internalformat);
5545 template <glw::GLuint D>
5546 void PrepareReferenceData(glw::GLenum internalformat);
5548 template <glw::GLuint D>
5549 void PrepareStorage(glw::GLenum internalformat);
5551 template <glw::GLuint D>
5552 bool CheckData(glw::GLenum internalformat);
5554 std::string DataToString(glw::GLuint count, const glw::GLubyte data[]);
5556 template <glw::GLuint D>
5557 bool Test(glw::GLenum internalformat);
5559 /* Private member variables. */
5561 glw::GLuint m_to_aux;
5562 glw::GLubyte* m_compressed_texture_data;
5563 glw::GLubyte* m_reference;
5564 glw::GLubyte* m_result;
5565 glw::GLuint m_reference_size;
5566 glw::GLuint m_reference_internalformat;
5568 /* Private static constants. */
5569 static const glw::GLubyte s_texture_data[];
5570 static const glw::GLuint s_texture_width;
5571 static const glw::GLuint s_texture_height;
5572 static const glw::GLuint s_texture_depth;
5573 static const glw::GLuint s_block_count;
5574 static const glw::GLuint s_block_2d_size_x;
5575 static const glw::GLuint s_block_2d_size_y;
5576 static const glw::GLuint s_block_3d_size;
5578 /* CompressedSubImageTest class */
5582 * Make test for following DSA functions:
5583 * - CopyTextureSubImage1D,
5584 * - CopyTextureSubImage2D and
5585 * - CopyTextureSubImage3D.
5587 * Prepare two textures 2x3x4 texels in size for corresponding directions
5588 * (if available). Setup the first one with reference data.
5590 * Prepare framebuffer with the first texture attached to the a color
5591 * attachment point. Bind the framebuffer.
5593 * Copy framebuffer content to the texture using tested function. The
5594 * images shall be copied in ranges, two per direction (to test offsets,
5595 * positions and size variables). For 3D textures copy each layer
5596 * substituting the framebuffer attachment.
5598 * After the copy fetch texture data and compare it with the reference
5599 * values. Expect equality.
5601 * Release all objects.
5603 class CopyTest : public deqp::TestCase
5606 /* Public member functions. */
5607 CopyTest(deqp::Context& context);
5609 virtual tcu::TestNode::IterateResult iterate();
5612 /* Private constructors. */
5613 CopyTest(const CopyTest& other);
5614 CopyTest& operator=(const CopyTest& other);
5616 /* Private member functions. */
5617 template <glw::GLuint D>
5618 glw::GLenum TextureTarget();
5620 bool CopyTextureSubImage1DAndCheckErrors(glw::GLuint texture, glw::GLint level, glw::GLint xoffset, glw::GLint x,
5621 glw::GLint y, glw::GLsizei width);
5622 bool CopyTextureSubImage2DAndCheckErrors(glw::GLuint texture, glw::GLint level, glw::GLint xoffset,
5623 glw::GLint yoffset, glw::GLint x, glw::GLint y, glw::GLsizei width,
5624 glw::GLsizei height);
5625 bool CopyTextureSubImage3DAndCheckErrors(glw::GLuint texture, glw::GLint level, glw::GLint xoffset,
5626 glw::GLint yoffset, glw::GLint zoffset, glw::GLint x, glw::GLint y,
5627 glw::GLsizei width, glw::GLsizei height);
5629 template <glw::GLuint D>
5630 void CreateSourceTexture();
5632 template <glw::GLuint D>
5633 void CreateDestinationTexture();
5635 template <glw::GLuint D>
5636 void CreateSourceFramebuffer();
5638 template <glw::GLuint D>
5641 template <glw::GLuint D>
5644 bool CheckData(glw::GLenum target, glw::GLuint size);
5645 std::string DataToString(glw::GLuint count, const glw::GLubyte data[]);
5648 /* Private member variables. */
5650 glw::GLuint m_to_src;
5651 glw::GLuint m_to_dst;
5652 glw::GLubyte* m_result;
5654 /* Private static constants. */
5655 static const glw::GLubyte s_texture_data[];
5656 static const glw::GLuint s_texture_width;
5657 static const glw::GLuint s_texture_height;
5658 static const glw::GLuint s_texture_depth;
5660 /* CopyTest class */
5662 /** @class GetSetParameterTest
5665 * Prepare texture object.
5667 * Prepare the following test case.
5669 * Prepare test case which sets a parameter to the desired value using
5670 * one of the following functions (depending on the parameter type):
5671 * - TextureParameterf,
5672 * - TextureParameterfv,
5673 * - TextureParameteri,
5674 * - TextureParameterIiv,
5675 * - TextureParameterIuiv,
5676 * - TextureParameteriv.
5678 * Read back the texture parameter using one of the DSA-like functions
5679 * - GetTextureParameterfv,
5680 * - GetTextureParameteriv,
5681 * - GetTextureParameterIiv,
5682 * - GetTextureParameterIuiv.
5685 * Run the test case for following parameters and values:
5686 * - parameter DEPTH_STENCIL_TEXTURE_MODE with value DEPTH_COMPONENT;
5687 * - parameter TEXTURE_BASE_LEVEL with value 2;
5688 * - parameter TEXTURE_BORDER_COLOR with value {0.25, 0.5, 0.75, 1.0}
5689 * - parameter TEXTURE_COMPARE_FUNC with value LEQUAL;
5690 * - parameter TEXTURE_COMPARE_MODE with value COMPARE_REF_TO_TEXTURE;
5691 * - parameter TEXTURE_LOD_BIAS with value -2.0 (which is
5692 * minimum required implementation maximum value);
5693 * - parameter TEXTURE_MIN_FILTER with value LINEAR_MIPMAP_NEAREST;
5694 * - parameter TEXTURE_MAG_FILTER with value NEAREST;
5695 * - parameter TEXTURE_MIN_LOD with value -100;
5696 * - parameter TEXTURE_MAX_LOD with value 100;
5697 * - parameter TEXTURE_MAX_LEVEL with value 100;
5698 * - parameter TEXTURE_SWIZZLE_R with value BLUE;
5699 * - parameter TEXTURE_SWIZZLE_G with value ALPHA;
5700 * - parameter TEXTURE_SWIZZLE_B with value RED;
5701 * - parameter TEXTURE_SWIZZLE_A with value GREEN;
5702 * - parameter TEXTURE_SWIZZLE_RGBA with value { ZERO, ONE, ZERO, ONE };
5703 * - parameter TEXTURE_WRAP_S with value MIRROR_CLAMP_TO_EDGE;
5704 * - parameter TEXTURE_WRAP_T with value CLAMP_TO_EDGE;
5705 * - parameter TEXTURE_WRAP_R with value CLAMP_TO_EDGE.
5707 * Release the texture object.
5709 class GetSetParameterTest : public deqp::TestCase
5712 /* Public member functions. */
5713 GetSetParameterTest(deqp::Context& context);
5715 virtual tcu::TestNode::IterateResult iterate();
5718 /* Private constructors. */
5719 GetSetParameterTest(const GetSetParameterTest& other);
5720 GetSetParameterTest& operator=(const GetSetParameterTest& other);
5722 bool CheckErrorAndLog(const glw::GLchar* fname, glw::GLenum pname);
5723 bool CompareAndLog(glw::GLint value_src, glw::GLint value_dst, glw::GLenum pname);
5724 bool CompareAndLog(glw::GLuint value_src, glw::GLuint value_dst, glw::GLenum pname);
5725 bool CompareAndLog(glw::GLfloat value_src, glw::GLfloat value_dst, glw::GLenum pname);
5726 bool CompareAndLog(glw::GLfloat value_src[4], glw::GLfloat value_dst[4], glw::GLenum pname);
5727 bool CompareAndLog(glw::GLint value_src[4], glw::GLint value_dst[4], glw::GLenum pname);
5728 bool CompareAndLog(glw::GLuint value_src[4], glw::GLuint value_dst[4], glw::GLenum pname);
5730 /* GetSetParameterTest class */
5732 /** @class DefaultsTest
5734 * Create texture object with CreateTextures. Do not bind it.
5736 * Using one of the functions
5737 * - GetTextureParameterfv,
5738 * - GetTextureParameteriv,
5739 * - GetTextureParameterIiv,
5740 * - GetTextureParameterIuiv
5741 * check that initial object parameter values are set to the following
5743 * - for parameter DEPTH_STENCIL_TEXTURE_MODE initial value is
5745 * - for parameter TEXTURE_BASE_LEVEL initial value is 0;
5746 * - for parameter TEXTURE_BORDER_COLOR initial value is {0.0, 0.0, 0.0,
5748 * - for parameter TEXTURE_COMPARE_FUNC initial value is LEQUAL;
5749 * - for parameter TEXTURE_COMPARE_MODE initial value is NONE;
5750 * - for parameter TEXTURE_LOD_BIAS initial value is 0.0;
5751 * - for parameter TEXTURE_MIN_FILTER initial value is
5752 * NEAREST_MIPMAP_LINEAR;
5753 * - for parameter TEXTURE_MAG_FILTER initial value is LINEAR;
5754 * - for parameter TEXTURE_MIN_LOD initial value is -1000;
5755 * - for parameter TEXTURE_MAX_LOD initial value is 1000;
5756 * - for parameter TEXTURE_MAX_LEVEL initial value is 1000;
5757 * - for parameter TEXTURE_SWIZZLE_R initial value is RED;
5758 * - for parameter TEXTURE_SWIZZLE_G initial value is GREEN;
5759 * - for parameter TEXTURE_SWIZZLE_B initial value is BLUE;
5760 * - for parameter TEXTURE_SWIZZLE_A initial value is ALPHA;
5761 * - for parameter TEXTURE_WRAP_S initial value is REPEAT;
5762 * - for parameter TEXTURE_WRAP_T initial value is REPEAT;
5763 * - for parameter TEXTURE_WRAP_R initial value is REPEAT.
5765 class DefaultsTest : public deqp::TestCase
5768 /* Public member functions. */
5769 DefaultsTest(deqp::Context& context);
5771 virtual tcu::TestNode::IterateResult iterate();
5774 /* Private constructors. */
5775 DefaultsTest(const DefaultsTest& other);
5776 DefaultsTest& operator=(const DefaultsTest& other);
5778 bool CompareAndLog(glw::GLint value_ref, glw::GLint value_dst, glw::GLenum pname);
5779 bool CompareAndLog(glw::GLuint value_ref, glw::GLuint value_dst, glw::GLenum pname);
5780 bool CompareAndLog(glw::GLfloat value_ref, glw::GLfloat value_dst, glw::GLenum pname);
5781 bool CompareAndLog(glw::GLfloat value_ref[4], glw::GLfloat value_dst[4], glw::GLenum pname);
5782 bool CompareAndLog(glw::GLint value_ref[4], glw::GLint value_dst[4], glw::GLenum pname);
5783 bool CompareAndLog(glw::GLuint value_ref[4], glw::GLuint value_dst[4], glw::GLenum pname);
5785 /* DefaultsTest class */
5787 /** @class GenerateMipmapTest
5789 * Create one dimensional texture. Setup its image data with successive
5790 * numbers {0..255} stored as red color.
5792 * Generate mipmaps for the texture using GenerateTextureMipmap function.
5794 * Download each of the generated mipmap levels. Check that each of the
5795 * mipmaps contains series of not decreasing values.
5797 * Release texture object.
5799 class GenerateMipmapTest : public deqp::TestCase
5802 /* Public member functions. */
5803 GenerateMipmapTest(deqp::Context& context);
5805 virtual tcu::TestNode::IterateResult iterate();
5808 /* Private constructors. */
5809 GenerateMipmapTest(const GenerateMipmapTest& other);
5810 GenerateMipmapTest& operator=(const GenerateMipmapTest& other);
5812 /* Private static constants. */
5813 static const glw::GLubyte s_texture_data[];
5814 static const glw::GLuint s_texture_width;
5815 static const glw::GLuint s_texture_width_log;
5817 /* GenerateMipmapTest class */
5819 /** @class BindUnitTest
5821 * Create four 2D textures, filled with 2x3 texels of reference data in RED
5822 * format and R8 internal format.
5824 * Create framebuffer 2x3 pixels of size with the same internal format as
5825 * textures but RGBA format.
5827 * Bind each texture to the separate unit using BindTextureUnit function.
5829 * Prepare GLSL program which draws full screen quad. A fragment shader of
5830 * the program shall pass each of the four input texture red values into
5831 * separate RGBA channel of the output framebuffer.
5833 * Make a draw call with prepared objects.
5835 * Fetch framebuffer data. Expect interleaved reference data.
5837 * Release all objects.
5839 class BindUnitTest : public deqp::TestCase
5842 /* Public member functions. */
5843 BindUnitTest(deqp::Context& context);
5845 virtual tcu::TestNode::IterateResult iterate();
5848 /* Private constructors. */
5849 BindUnitTest(const BindUnitTest& other);
5850 BindUnitTest& operator=(const BindUnitTest& other);
5852 void CreateProgram();
5853 void CreateTextures();
5854 void CreateFrambuffer();
5855 void CreateVertexArray();
5859 std::string DataToString(glw::GLuint count, const glw::GLubyte data[]);
5861 /* Private member variables. */
5863 glw::GLuint m_to[4];
5867 glw::GLubyte* m_result;
5869 /* Private static constants. */
5870 static const glw::GLubyte s_texture_data_r[];
5871 static const glw::GLubyte s_texture_data_g[];
5872 static const glw::GLubyte s_texture_data_b[];
5873 static const glw::GLubyte s_texture_data_a[];
5874 static const glw::GLubyte s_texture_data_rgba[];
5875 static const glw::GLuint s_texture_width;
5876 static const glw::GLuint s_texture_height;
5877 static const glw::GLuint s_texture_count_rgba;
5878 static const glw::GLchar* s_vertex_shader;
5879 static const glw::GLchar* s_fragment_shader;
5880 static const glw::GLchar* s_fragment_shader_samplers[4];
5882 /* GenerateMipmapTest class */
5884 /** @class GetImageTest
5886 * Make test for following DSA functions:
5887 * - GetTextureImage,
5888 * - GetCompressedTextureImage.
5890 * Create two 2D textures, one with compressed reference image, one with
5891 * uncompressed reference image.
5893 * Fetch textures with corresponding test functions. Compare fetched values
5894 * with the reference data. Expect equality.
5898 class GetImageTest : public deqp::TestCase
5901 /* Public member functions. */
5902 GetImageTest(deqp::Context& context);
5904 virtual tcu::TestNode::IterateResult iterate();
5907 /* Private constructors. */
5908 GetImageTest(const GetImageTest& other);
5909 GetImageTest& operator=(const GetImageTest& other);
5911 std::string DataToString(glw::GLuint count, const glw::GLubyte data[]);
5913 /* Private static constants. */
5914 static const glw::GLubyte s_texture_data[];
5915 static const glw::GLubyte s_texture_data_compressed[];
5916 static const glw::GLuint s_texture_width;
5917 static const glw::GLuint s_texture_height;
5918 static const glw::GLuint s_texture_size;
5919 static const glw::GLuint s_texture_size_compressed;
5920 static const glw::GLuint s_texture_count;
5921 static const glw::GLuint s_texture_count_compressed;
5923 /* GetImageTest class */
5925 /** @class GetLevelParameterTest
5927 * Make test for following DSA functions:
5928 * - GetTextureLevelParameterfv,
5929 * - GetTextureLevelParameteriv.
5931 * Create 3D texture with two levels of detail.
5933 * Fetch following parameters with test functions:
5937 * - TEXTURE_INTERNAL_FORMAT,
5938 * - TEXTURE_RED_TYPE,
5939 * - TEXTURE_GREEN_TYPE,
5940 * - TEXTURE_BLUE_TYPE,
5941 * - TEXTURE_ALPHA_TYPE,
5942 * - TEXTURE_DEPTH_TYPE,
5943 * - TEXTURE_RED_SIZE,
5944 * - TEXTURE_GREEN_SIZE,
5945 * - TEXTURE_BLUE_SIZE,
5946 * - TEXTURE_ALPHA_SIZE,
5947 * - TEXTURE_DEPTH_SIZE and
5948 * - TEXTURE_COMPRESSED
5949 * and compare values with expected set.
5953 class GetLevelParameterTest : public deqp::TestCase
5956 /* Public member functions. */
5957 GetLevelParameterTest(deqp::Context& context);
5959 virtual tcu::TestNode::IterateResult iterate();
5962 /* Private constructors. */
5963 GetLevelParameterTest(const GetLevelParameterTest& other);
5964 GetLevelParameterTest& operator=(const GetLevelParameterTest& other);
5966 /* Private static constants. */
5967 static const glw::GLubyte s_texture_data[];
5968 static const glw::GLuint s_texture_width;
5969 static const glw::GLuint s_texture_height;
5970 static const glw::GLuint s_texture_depth;
5972 /* GetLevelParameterTest class */
5974 /** @class ErrorsUtilities
5976 * This class contain utility methods for all negative tests.
5978 class ErrorsUtilities
5981 bool CheckErrorAndLog(deqp::Context& context, glw::GLuint expected_error, const glw::GLchar* function_name,
5982 const glw::GLchar* log);
5984 /* ErrorsUtilities */
5986 /** @class CreationErrorsTest
5988 * Check that INVALID_ENUM is generated if target is not one of the
5991 * Check that INVALID_VALUE is generated if n is negative.
5993 class CreationErrorsTest : public deqp::TestCase, ErrorsUtilities
5996 /* Public member functions. */
5997 CreationErrorsTest(deqp::Context& context);
5999 virtual tcu::TestNode::IterateResult iterate();
6002 /* Private constructors. */
6003 CreationErrorsTest(const CreationErrorsTest& other);
6004 CreationErrorsTest& operator=(const CreationErrorsTest& other);
6006 glw::GLenum NotATarget();
6008 /* CreationErrorsTest class */
6010 /** @class BufferErrorsTest
6012 * Check that INVALID_OPERATION is generated by glTextureBuffer if texture
6013 * is not the name of an existing texture object.
6015 * Check that INVALID_ENUM is generated by glTextureBuffer if the effective
6016 * target of texture is not TEXTURE_BUFFER.
6018 * Check that INVALID_ENUM is generated if internalformat is not one of the
6019 * sized internal formats described above.
6021 * Check that INVALID_OPERATION is generated if buffer is not zero and is
6022 * not the name of an existing buffer object.
6024 class BufferErrorsTest : public deqp::TestCase, ErrorsUtilities
6027 /* Public member functions. */
6028 BufferErrorsTest(deqp::Context& context);
6030 virtual tcu::TestNode::IterateResult iterate();
6033 /* Private constructors. */
6034 BufferErrorsTest(const BufferErrorsTest& other);
6035 BufferErrorsTest& operator=(const BufferErrorsTest& other);
6037 /* BufferErrorsTest class */
6039 /** @class BufferRangeErrorsTest
6041 * Check that INVALID_OPERATION is generated by TextureBufferRange if
6042 * texture is not the name of an existing texture object.
6044 * Check that INVALID_ENUM is generated by TextureBufferRange if the
6045 * effective target of texture is not TEXTURE_BUFFER.
6047 * Check that INVALID_ENUM is generated by TextureBufferRange if
6048 * internalformat is not one of the sized internal formats described above.
6050 * Check that INVALID_OPERATION is generated by TextureBufferRange if
6051 * buffer is not zero and is not the name of an existing buffer object.
6053 * Check that INVALID_VALUE is generated by TextureBufferRange if offset
6054 * is negative, if size is less than or equal to zero, or if offset + size
6055 * is greater than the value of BUFFER_SIZE for buffer.
6057 * Check that INVALID_VALUE is generated by TextureBufferRange if offset is
6058 * not an integer multiple of the value of TEXTURE_BUFFER_OFFSET_ALIGNMENT.
6060 class BufferRangeErrorsTest : public deqp::TestCase, ErrorsUtilities
6063 /* Public member functions. */
6064 BufferRangeErrorsTest(deqp::Context& context);
6066 virtual tcu::TestNode::IterateResult iterate();
6069 /* Private constructors. */
6070 BufferRangeErrorsTest(const BufferRangeErrorsTest& other);
6071 BufferRangeErrorsTest& operator=(const BufferRangeErrorsTest& other);
6073 /* BufferErrorsTest class */
6075 /** @class StorageErrorsTest
6077 * Check that INVALID_OPERATION is generated by TextureStorage1D if texture
6078 * is not the name of an existing texture object.
6080 * Check that INVALID_ENUM is generated by TextureStorage1D if
6081 * internalformat is not a valid sized internal format.
6083 * Check that INVALID_ENUM is generated by TextureStorage1D if target or
6084 * the effective target of texture is not one of the accepted targets
6087 * Check that INVALID_VALUE is generated by TextureStorage1D if width or
6088 * levels are less than 1.
6090 * Check that INVALID_OPERATION is generated by TextureStorage1D if levels
6091 * is greater than log2(width)+1.
6094 * Check that INVALID_OPERATION is generated by TextureStorage2D if
6095 * texture is not the name of an existing texture object.
6097 * Check that INVALID_ENUM is generated by TextureStorage2D if
6098 * internalformat is not a valid sized internal format.
6100 * Check that INVALID_ENUM is generated by TextureStorage2D if target or
6101 * the effective target of texture is not one of the accepted targets
6104 * Check that INVALID_VALUE is generated by TextureStorage2D if width,
6105 * height or levels are less than 1.
6107 * Check that INVALID_OPERATION is generated by TextureStorage2D if target
6108 * is TEXTURE_1D_ARRAY or PROXY_TEXTURE_1D_ARRAY and levels is greater than
6111 * Check that INVALID_OPERATION is generated by TextureStorage2D if target
6112 * is not TEXTURE_1D_ARRAY or PROXY_TEXTURE_1D_ARRAY and levels is greater
6113 * than log2(max(width, height))+1.
6116 * Check that INVALID_OPERATION is generated by TextureStorage2DMultisample
6117 * if texture is not the name of an existing texture object.
6119 * Check that INVALID_ENUM is generated by TextureStorage2DMultisample if
6120 * internalformat is not a valid color-renderable, depth-renderable or
6121 * stencil-renderable format.
6123 * Check that INVALID_ENUM is generated by TextureStorage2DMultisample if
6124 * target or the effective target of texture is not one of the accepted
6125 * targets described above.
6127 * Check that INVALID_VALUE is generated by TextureStorage2DMultisample if
6128 * width or height are less than 1 or greater than the value of
6132 * Check that INVALID_VALUE is generated by TextureStorage2DMultisample if
6133 * samples is greater than the value of MAX_SAMPLES.
6135 * Check that INVALID_OPERATION is generated by TextureStorage2DMultisample
6136 * if the value of TEXTURE_IMMUTABLE_FORMAT for the texture bound to target
6140 * Check that INVALID_OPERATION is generated by TextureStorage3D if texture
6141 * is not the name of an existing texture object.
6143 * Check that INVALID_ENUM is generated by TextureStorage3D if
6144 * internalformat is not a valid sized internal format.
6146 * Check that INVALID_ENUM is generated by TextureStorage3D if target or
6147 * the effective target of texture is not one of the accepted targets
6150 * Check that INVALID_VALUE is generated by TextureStorage3D if width,
6151 * height, depth or levels are less than 1.
6153 * Check that INVALID_OPERATION is generated by TextureStorage3D if target
6154 * is TEXTURE_3D or PROXY_TEXTURE_3D and levels is greater than
6155 * log2(max(width, height, depth))+1.
6157 * Check that INVALID_OPERATION is generated by TextureStorage3D if target
6158 * is TEXTURE_2D_ARRAY, PROXY_TEXTURE_2D_ARRAY, TEXURE_CUBE_ARRAY,
6159 * or PROXY_TEXTURE_CUBE_MAP_ARRAY and levels is greater than
6160 * log2(max(width, height))+1.
6163 * Check that INVALID_OPERATION is generated by TextureStorage3DMultisample
6164 * if texture is not the name of an existing texture object.
6166 * Check that INVALID_ENUM is generated by TextureStorage3DMultisample if
6167 * internalformat is not a valid color-renderable, depth-renderable or
6168 * stencil-renderable format.
6170 * Check that INVALID_ENUM is generated by TextureStorage3DMultisample if
6171 * target or the effective target of texture is not one of the accepted
6172 * targets described above.
6174 * Check that INVALID_VALUE is generated by TextureStorage3DMultisample if
6175 * width or height are less than 1 or greater than the value of
6178 * Check that INVALID_VALUE is generated by TextureStorage3DMultisample if
6179 * depth is less than 1 or greater than the value of
6180 * MAX_ARRAY_TEXTURE_LAYERS.
6182 * Check that INVALID_VALUE is generated by TextureStorage3DMultisample if
6183 * samples is greater than the value of MAX_SAMPLES.
6185 * Check that INVALID_OPERATION is generated by TextureStorage3DMultisample
6186 * if the value of TEXTURE_IMMUTABLE_FORMAT for the texture bound to
6187 * target is not FALSE.
6189 class StorageErrorsTest : public deqp::TestCase, ErrorsUtilities
6192 /* Public member functions. */
6193 StorageErrorsTest(deqp::Context& context);
6195 virtual tcu::TestNode::IterateResult iterate();
6198 /* Private constructors. */
6199 StorageErrorsTest(const StorageErrorsTest& other);
6200 StorageErrorsTest& operator=(const StorageErrorsTest& other);
6202 glw::GLuint m_to_1D;
6203 glw::GLuint m_to_1D_array;
6204 glw::GLuint m_to_2D;
6205 glw::GLuint m_to_2D_array;
6206 glw::GLuint m_to_3D;
6207 glw::GLuint m_to_2D_ms;
6208 glw::GLuint m_to_2D_ms_immutable;
6209 glw::GLuint m_to_3D_ms;
6210 glw::GLuint m_to_3D_ms_immutable;
6211 glw::GLuint m_to_invalid;
6212 glw::GLuint m_internalformat_invalid;
6213 glw::GLint m_max_texture_size;
6214 glw::GLint m_max_samples;
6215 glw::GLint m_max_array_texture_layers;
6221 bool Test2DMultisample();
6222 bool Test3DMultisample();
6225 /* StorageErrorsTest class */
6227 /** @class SubImageErrorsTest
6229 * Check that INVALID_OPERATION is generated by TextureSubImage1D if
6230 * texture is not the name of an existing texture object.
6232 * Check that INVALID_ENUM is generated by TextureSubImage1D if format is
6233 * not an accepted format constant.
6235 * Check that INVALID_ENUM is generated by TextureSubImage1D if type is not
6238 * Check that INVALID_VALUE is generated by TextureSubImage1D if level is
6241 * Check that INVALID_VALUE may be generated by TextureSubImage1D if level
6242 * is greater than log2 max, where max is the returned value of
6245 * Check that INVALID_VALUE is generated by TextureSubImage1D if
6246 * xoffset<�b, or if (xoffset+width)>(w�b), where w is the TEXTURE_WIDTH,
6247 * and b is the width of the TEXTURE_BORDER of the texture image being
6248 * modified. Note that w includes twice the border width.
6249 * Check that INVALID_VALUE is generated by TextureSubImage1D if width is
6252 * Check that INVALID_OPERATION is generated by TextureSubImage1D if type
6253 * is one of UNSIGNED_BYTE_3_3_2, UNSIGNED_BYTE_2_3_3_REV,
6254 * UNSIGNED_SHORT_5_6_5, or UNSIGNED_SHORT_5_6_5_REV and format is not RGB.
6256 * Check that INVALID_OPERATION is generated by TextureSubImage1D if type
6257 * is one of UNSIGNED_SHORT_4_4_4_4, UNSIGNED_SHORT_4_4_4_4_REV,
6258 * UNSIGNED_SHORT_5_5_5_1, UNSIGNED_SHORT_1_5_5_5_REV,
6259 * UNSIGNED_INT_8_8_8_8, UNSIGNED_INT_8_8_8_8_REV, UNSIGNED_INT_10_10_10_2,
6260 * or UNSIGNED_INT_2_10_10_10_REV and format is neither RGBA nor BGRA.
6262 * Check that INVALID_OPERATION is generated by TextureSubImage1D if a
6263 * non-zero buffer object name is bound to the PIXEL_UNPACK_BUFFER target
6264 * and the buffer object's data store is currently mapped.
6266 * Check that INVALID_OPERATION is generated by TextureSubImage1D if a
6267 * non-zero buffer object name is bound to the PIXEL_UNPACK_BUFFER target
6268 * and the data would be unpacked from the buffer object such that the
6269 * memory reads required would exceed the data store size.
6271 * Check that INVALID_OPERATION is generated by TextureSubImage1D if a
6272 * non-zero buffer object name is bound to the PIXEL_UNPACK_BUFFER target
6273 * and pixels is not evenly divisible into the number of bytes needed to
6274 * store in memory a datum indicated by type.
6277 * Check that INVALID_OPERATION is generated by TextureSubImage2D if
6278 * texture is not the name of an existing texture object.
6280 * Check that INVALID_ENUM is generated by TextureSubImage2D if format is
6281 * not an accepted format constant.
6283 * Check that INVALID_ENUM is generated if type is not a type constant.
6285 * Check that INVALID_VALUE is generated by TextureSubImage2D if level is
6288 * Check that INVALID_VALUE may be generated by TextureSubImage2D if level
6289 * is greater than log2 max, where max is the returned value of
6291 * Check that INVALID_VALUE is generated by TextureSubImage2D if
6292 * xoffset<�b, (xoffset+width)>(w�b), yoffset<�b, or
6293 * (yoffset+height)>(h�b), where w is the TEXTURE_WIDTH, h is the
6294 * TEXTURE_HEIGHT, and b is the border width of the texture image being
6295 * modified. Note that w and h include twice the border width.
6296 * Check that INVALID_VALUE is generated by TextureSubImage2D if width or
6297 * height is less than 0.
6299 * Check that INVALID_OPERATION is generated by TextureSubImage2D if type
6300 * is one of UNSIGNED_BYTE_3_3_2, UNSIGNED_BYTE_2_3_3_REV,
6301 * UNSIGNED_SHORT_5_6_5, or UNSIGNED_SHORT_5_6_5_REV and format is not RGB.
6303 * Check that INVALID_OPERATION is generated by TextureSubImage2D if type
6304 * is one of UNSIGNED_SHORT_4_4_4_4, UNSIGNED_SHORT_4_4_4_4_REV,
6305 * UNSIGNED_SHORT_5_5_5_1, UNSIGNED_SHORT_1_5_5_5_REV, UNSIGNED_INT_8_8_8_8,
6306 * UNSIGNED_INT_8_8_8_8_REV, UNSIGNED_INT_10_10_10_2, or
6307 * UNSIGNED_INT_2_10_10_10_REV and format is neither RGBA
6310 * Check that INVALID_OPERATION is generated by TextureSubImage2D if a
6311 * non-zero buffer object name is bound to the PIXEL_UNPACK_BUFFER target
6312 * and the buffer object's data store is currently mapped.
6314 * Check that INVALID_OPERATION is generated by TextureSubImage2D if a
6315 * non-zero buffer object name is bound to the PIXEL_UNPACK_BUFFER target
6316 * and the data would be unpacked from the buffer object such that the
6317 * memory reads required would exceed the data store size.
6319 * Check that INVALID_OPERATION is generated by TextureSubImage2D if a
6320 * non-zero buffer object name is bound to the PIXEL_UNPACK_BUFFER target
6321 * and pixels is not evenly divisible into the number of bytes needed to
6322 * store in memory a datum indicated by type.
6325 * Check that INVALID_OPERATION is generated by TextureSubImage3D if
6326 * texture is not the name of an existing texture object.
6328 * Check that INVALID_ENUM is generated by TextureSubImage3D if format is
6329 * not an accepted format constant.
6331 * Check that INVALID_ENUM is generated by TextureSubImage3D if type is
6332 * not a type constant.
6334 * Check that INVALID_VALUE is generated by TextureSubImage3D if level
6337 * Check that INVALID_VALUE may be generated by TextureSubImage3D if level
6338 * is greater than log2 max, where max is the returned value of
6341 * Check that INVALID_VALUE is generated by TextureSubImage3D if
6342 * xoffset<�b, (xoffset+width)>(w�b), yoffset<�b, or
6343 * (yoffset+height)>(h�b), or zoffset<�b, or (zoffset+depth)>(d�b), where w
6344 * is the TEXTURE_WIDTH, h is the TEXTURE_HEIGHT, d is the TEXTURE_DEPTH
6345 * and b is the border width of the texture image being modified. Note
6346 * that w, h, and d include twice the border width.
6348 * Check that INVALID_VALUE is generated by TextureSubImage3D if width,
6349 * height, or depth is less than 0.
6351 * Check that INVALID_OPERATION is generated by TextureSubImage3D if type
6352 * is one of UNSIGNED_BYTE_3_3_2, UNSIGNED_BYTE_2_3_3_REV,
6353 * UNSIGNED_SHORT_5_6_5, or UNSIGNED_SHORT_5_6_5_REV and format is not RGB.
6355 * Check that INVALID_OPERATION is generated by TextureSubImage3D if type
6356 * is one of UNSIGNED_SHORT_4_4_4_4, UNSIGNED_SHORT_4_4_4_4_REV,
6357 * UNSIGNED_SHORT_5_5_5_1, UNSIGNED_SHORT_1_5_5_5_REV,
6358 * UNSIGNED_INT_8_8_8_8, UNSIGNED_INT_8_8_8_8_REV, UNSIGNED_INT_10_10_10_2,
6359 * or UNSIGNED_INT_2_10_10_10_REV and format is neither RGBA nor BGRA.
6361 * Check that INVALID_OPERATION is generated by TextureSubImage3D if a
6362 * non-zero buffer object name is bound to the PIXEL_UNPACK_BUFFER target
6363 * and the buffer object's data store is currently mapped.
6365 * Check that INVALID_OPERATION is generated by TextureSubImage3D if a
6366 * non-zero buffer object name is bound to the PIXEL_UNPACK_BUFFER target
6367 * and the data would be unpacked from the buffer object such that the
6368 * memory reads required would exceed the data store size.
6370 * Check that INVALID_OPERATION is generated by TextureSubImage3D if a
6371 * non-zero buffer object name is bound to the PIXEL_UNPACK_BUFFER target
6372 * and pixels is not evenly divisible into the number of bytes needed to
6373 * store in memory a datum indicated by type.
6376 * Check that INVALID_ENUM is generated by CompressedTextureSubImage1D if
6377 * internalformat is not one of the generic compressed internal formats:
6378 * COMPRESSED_RED, COMPRESSED_RG, COMPRESSED_RGB, COMPRESSED_RGBA.
6379 * COMPRESSED_SRGB, or COMPRESSED_SRGB_ALPHA.
6381 * Check that INVALID_VALUE is generated by CompressedTextureSubImage1D if
6382 * imageSize is not consistent with the format, dimensions, and contents of
6383 * the specified compressed image data.
6385 * Check that INVALID_OPERATION is generated by CompressedTextureSubImage1D
6386 * if parameter combinations are not supported by the specific compressed
6387 * internal format as specified in the specific texture compression
6390 * Check that INVALID_OPERATION is generated by CompressedTextureSubImage1D
6391 * if a non-zero buffer object name is bound to the PIXEL_UNPACK_BUFFER
6392 * target and the buffer object's data store is currently mapped.
6394 * Check that INVALID_OPERATION is generated by CompressedTextureSubImage1D
6395 * if a non-zero buffer object name is bound to the PIXEL_UNPACK_BUFFER
6396 * target and the data would be unpacked from the buffer object such that
6397 * the memory reads required would exceed the data store size.
6399 * Check that INVALID_OPERATION is generated by CompressedTextureSubImage1D
6400 * function if texture is not the name of an existing texture object.
6403 * Check that INVALID_OPERATION is generated by CompressedTextureSubImage2D
6404 * if texture is not the name of an existing texture object.
6406 * Check that INVALID_ENUM is generated by CompressedTextureSubImage2D if
6407 * internalformat is of the generic compressed internal formats:
6408 * COMPRESSED_RED, COMPRESSED_RG, COMPRESSED_RGB, COMPRESSED_RGBA.
6409 * COMPRESSED_SRGB, or COMPRESSED_SRGB_ALPHA.
6411 * Check that INVALID_OPERATION is generated by CompressedTextureSubImage2D
6412 * if format does not match the internal format of the texture image being
6413 * modified, since these commands do not provide for image format
6416 * Check that INVALID_VALUE is generated by CompressedTextureSubImage2D if
6417 * imageSize is not consistent with the format, dimensions, and contents of
6418 * the specified compressed image data.
6420 * Check that INVALID_OPERATION is generated by CompressedTextureSubImage2D
6421 * if a non-zero buffer object name is bound to the PIXEL_UNPACK_BUFFER
6422 * target and the buffer object's data store is currently mapped.
6424 * Check that INVALID_OPERATION is generated by CompressedTextureSubImage2D
6425 * if a non-zero buffer object name is bound to the PIXEL_UNPACK_BUFFER
6426 * target and the data would be unpacked from the buffer object such that
6427 * the memory reads required would exceed the data store size.
6429 * Check that INVALID_OPERATION is generated by CompressedTextureSubImage2D
6430 * if the effective target is TEXTURE_RECTANGLE.
6433 * Check that INVALID_OPERATION is generated by CompressedTextureSubImage3D
6434 * if texture is not the name of an existing texture object.
6436 * Check that INVALID_ENUM is generated by CompressedTextureSubImage3D if
6437 * internalformat is one of the generic compressed internal formats:
6438 * COMPRESSED_RED, COMPRESSED_RG, COMPRESSED_RGB, COMPRESSED_RGBA.
6439 * COMPRESSED_SRGB, or COMPRESSED_SRGB_ALPHA.
6441 * Check that INVALID_OPERATION is generated by CompressedTextureSubImage3D
6442 * if format does not match the internal format of the texture image being
6443 * modified, since these commands do not provide for image format
6446 * Check that INVALID_VALUE is generated by CompressedTextureSubImage3D if
6447 * imageSize is not consistent with the format, dimensions, and contents of
6448 * the specified compressed image data.
6450 * Check that INVALID_OPERATION is generated by CompressedTextureSubImage3D
6451 * if a non-zero buffer object name is bound to the PIXEL_UNPACK_BUFFER
6452 * target and the buffer object's data store is currently mapped.
6454 * Check that INVALID_OPERATION is generated by CompressedTextureSubImage3D
6455 * if a non-zero buffer object name is bound to the PIXEL_UNPACK_BUFFER
6456 * target and the data would be unpacked from the buffer object such that
6457 * the memory reads required would exceed the data store size.
6459 class SubImageErrorsTest : public deqp::TestCase, ErrorsUtilities
6462 /* Public member functions. */
6463 SubImageErrorsTest(deqp::Context& context);
6465 virtual tcu::TestNode::IterateResult iterate();
6468 /* Private constructors. */
6469 SubImageErrorsTest(const SubImageErrorsTest& other);
6470 SubImageErrorsTest& operator=(const SubImageErrorsTest& other);
6472 glw::GLuint m_to_1D_empty;
6473 glw::GLuint m_to_2D_empty;
6474 glw::GLuint m_to_3D_empty;
6475 glw::GLuint m_to_1D;
6476 glw::GLuint m_to_2D;
6477 glw::GLuint m_to_3D;
6478 glw::GLuint m_to_1D_compressed;
6479 glw::GLuint m_to_2D_compressed;
6480 glw::GLuint m_to_3D_compressed;
6481 glw::GLuint m_to_rectangle_compressed;
6482 glw::GLuint m_to_invalid;
6484 glw::GLuint m_format_invalid;
6485 glw::GLuint m_type_invalid;
6486 glw::GLint m_max_texture_size;
6487 glw::GLubyte* m_reference_compressed_1D;
6488 glw::GLubyte* m_reference_compressed_2D;
6489 glw::GLubyte* m_reference_compressed_3D;
6490 glw::GLubyte* m_reference_compressed_rectangle;
6491 glw::GLint m_reference_compressed_1D_size;
6492 glw::GLint m_reference_compressed_2D_size;
6493 glw::GLint m_reference_compressed_3D_size;
6494 glw::GLint m_reference_compressed_rectangle_size;
6495 glw::GLint m_reference_compressed_1D_format;
6496 glw::GLint m_reference_compressed_2D_format;
6497 glw::GLint m_reference_compressed_3D_format;
6498 glw::GLint m_reference_compressed_rectangle_format;
6499 glw::GLint m_not_matching_compressed_1D_format;
6500 glw::GLint m_not_matching_compressed_1D_size;
6501 glw::GLint m_not_matching_compressed_2D_format;
6502 glw::GLint m_not_matching_compressed_2D_size;
6503 glw::GLint m_not_matching_compressed_3D_format;
6504 glw::GLint m_not_matching_compressed_3D_size;
6510 bool Test1DCompressed();
6511 bool Test2DCompressed();
6512 bool Test3DCompressed();
6515 static const glw::GLushort s_reference[];
6516 static const glw::GLuint s_reference_width;
6517 static const glw::GLuint s_reference_height;
6518 static const glw::GLuint s_reference_depth;
6519 static const glw::GLuint s_reference_size;
6520 static const glw::GLenum s_reference_internalformat;
6521 static const glw::GLenum s_reference_internalformat_compressed;
6522 static const glw::GLenum s_reference_format;
6523 static const glw::GLenum s_reference_type;
6525 /* SubImageErrorsTest class */
6527 /** @class CopyErrorsTest
6529 * Check that INVALID_FRAMEBUFFER_OPERATION is generated by
6530 * CopyTextureSubImage1D if the object bound to READ_FRAMEBUFFER_BINDING is
6531 * not framebuffer complete.
6533 * Check that INVALID_OPERATION is generated by CopyTextureSubImage1D if
6534 * texture is not the name of an existing texture object, or if the
6535 * effective target of texture is not TEXTURE_1D.
6537 * Check that INVALID_VALUE is generated by CopyTextureSubImage1D if level
6540 * Check that INVALID_VALUE is generated by CopyTextureSubImage1D if
6541 * xoffset<0, or (xoffset+width)>w, where w is the TEXTURE_WIDTH of the
6542 * texture image being modified.
6544 * Check that INVALID_OPERATION is generated by CopyTextureSubImage1D if
6545 * the read buffer is NONE, or the value of READ_FRAMEBUFFER_BINDING is
6546 * non-zero, and: the read buffer selects an attachment that has no image
6547 * attached, or the effective value of SAMPLE_BUFFERS for the read
6548 * framebuffer is one.
6551 * Check that INVALID_FRAMEBUFFER_OPERATION is generated by
6552 * CopyTextureSubImage2D if the object bound to READ_FRAMEBUFFER_BINDING is
6553 * not framebuffer complete.
6555 * Check that INVALID_OPERATION is generated by CopyTextureSubImage2D if
6556 * texture is not the name of an existing texture object.
6558 * Check that INVALID_OPERATION is generated by CopyTextureSubImage2D if
6559 * the effective target of texture does not correspond to one of the
6560 * texture targets supported by the function.
6562 * Check that INVALID_VALUE is generated by CopyTextureSubImage2D if level
6565 * Check that INVALID_VALUE is generated by CopyTextureSubImage2D if
6566 * xoffset<0, (xoffset+width)>w, yoffset<0, or (yoffset+height)>0, where w
6567 * is the TEXTURE_WIDTH, h is the TEXTURE_HEIGHT and of the texture image
6570 * Check that INVALID_OPERATION is generated by CopyTextureSubImage2D if:
6571 * the read buffer is NONE, or the value of READ_FRAMEBUFFER_BINDING is
6572 * non-zero, and: the read buffer selects an attachment that has no image
6573 * attached, or the effective value of SAMPLE_BUFFERS for the read
6574 * framebuffer is one.
6577 * Check that INVALID_OPERATION is generated by CopyTextureSubImage3D if
6578 * the effective target is not TEXTURE_3D, TEXTURE_2D_ARRAY,
6579 * TEXTURE_CUBE_MAP_ARRAY or TEXTURE_CUBE_MAP.
6581 * Check that INVALID_FRAMEBUFFER_OPERATION is generated by
6582 * CopyTextureSubImage3D if the object bound to READ_FRAMEBUFFER_BINDING is
6583 * not framebuffer complete.
6585 * Check that INVALID_OPERATION is generated by CopyTextureSubImage3D if
6586 * texture is not the name of an existing texture object.
6588 * Check that INVALID_VALUE is generated by CopyTextureSubImage3D if level
6591 * Check that INVALID_VALUE is generated by CopyTextureSubImage3D if
6592 * xoffset<0, (xoffset+width)>w, yoffset<0, (yoffset+height)>h, zoffset<0,
6593 * or (zoffset+1)>d, where w is the TEXTURE_WIDTH, h is the TEXTURE_HEIGHT,
6594 * d is the TEXTURE_DEPTH and of the texture image being modified. Note
6595 * that w, h, and d include twice the border width.
6597 * Check that INVALID_OPERATION is generated by CopyTextureSubImage3D if:
6598 * the read buffer is NONE, or the value of READ_FRAMEBUFFER_BINDING is
6599 * non-zero, and: the read buffer selects an attachment that has no image
6600 * attached, or the effective value of SAMPLE_BUFFERS for the read
6601 * framebuffer is one.
6603 class CopyErrorsTest : public deqp::TestCase, ErrorsUtilities
6606 /* Public member functions. */
6607 CopyErrorsTest(deqp::Context& context);
6609 virtual tcu::TestNode::IterateResult iterate();
6612 /* Private constructors. */
6613 CopyErrorsTest(const CopyErrorsTest& other);
6614 CopyErrorsTest& operator=(const CopyErrorsTest& other);
6617 glw::GLuint m_fbo_ms;
6618 glw::GLuint m_fbo_incomplete;
6619 glw::GLuint m_to_src;
6620 glw::GLuint m_to_src_ms;
6621 glw::GLuint m_to_1D_dst;
6622 glw::GLuint m_to_2D_dst;
6623 glw::GLuint m_to_3D_dst;
6624 glw::GLuint m_to_invalid;
6632 static const glw::GLuint s_width;
6633 static const glw::GLuint s_height;
6634 static const glw::GLuint s_depth;
6635 static const glw::GLuint s_internalformat;
6637 /* CopyErrorsTest class */
6639 /** @class ParameterSetupErrorsTest
6641 * Check that INVALID_ENUM is generated by TextureParameter* if pname is
6642 * not one of the accepted defined values.
6644 * Check that INVALID_ENUM is generated by TextureParameter* if params
6645 * should have a defined constant value (based on the value of pname) and
6648 * Check that INVALID_ENUM is generated if TextureParameter{if} is called
6649 * for a non-scalar parameter (pname TEXTURE_BORDER_COLOR or
6650 * TEXTURE_SWIZZLE_RGBA).
6652 * Check that INVALID_ENUM is generated by TextureParameter* if the
6653 * effective target is either TEXTURE_2D_MULTISAMPLE or
6654 * TEXTURE_2D_MULTISAMPLE_ARRAY, and pname is any of the sampler states.
6656 * Check that INVALID_ENUM is generated by TextureParameter* if the
6657 * effective target is TEXTURE_RECTANGLE and either of pnames
6658 * TEXTURE_WRAP_S or TEXTURE_WRAP_T is set to either MIRROR_CLAMP_TO_EDGE,
6659 * MIRRORED_REPEAT or REPEAT.
6661 * Check that INVALID_ENUM is generated by TextureParameter* if the
6662 * effective target is TEXTURE_RECTANGLE and pname TEXTURE_MIN_FILTER is
6663 * set to a value other than NEAREST or LINEAR (no mipmap filtering is
6666 * Check that INVALID_OPERATION is generated by TextureParameter* if the
6667 * effective target is either TEXTURE_2D_MULTISAMPLE or
6668 * TEXTURE_2D_MULTISAMPLE_ARRAY, and pname TEXTURE_BASE_LEVEL is set to a
6669 * value other than zero.
6671 * Check that INVALID_OPERATION is generated by TextureParameter* if
6672 * texture is not the name of an existing texture object.
6674 * Check that INVALID_OPERATION is generated by TextureParameter* if the
6675 * effective target is TEXTURE_RECTANGLE and pname TEXTURE_BASE_LEVEL is
6676 * set to any value other than zero.
6678 * Check that INVALID_VALUE is generated by TextureParameter* if pname is
6679 * TEXTURE_BASE_LEVEL or TEXTURE_MAX_LEVEL, and param or params is
6682 class ParameterSetupErrorsTest : public deqp::TestCase, ErrorsUtilities
6685 /* Public member functions. */
6686 ParameterSetupErrorsTest(deqp::Context& context);
6688 virtual tcu::TestNode::IterateResult iterate();
6691 /* Private constructors. */
6692 ParameterSetupErrorsTest(const ParameterSetupErrorsTest& other);
6693 ParameterSetupErrorsTest& operator=(const ParameterSetupErrorsTest& other);
6695 glw::GLuint m_to_2D;
6696 glw::GLuint m_to_2D_ms;
6697 glw::GLuint m_to_rectangle;
6698 glw::GLuint m_to_invalid;
6699 glw::GLenum m_pname_invalid;
6700 glw::GLenum m_depth_stencil_mode_invalid;
6711 static const glw::GLuint s_width;
6712 static const glw::GLuint s_height;
6713 static const glw::GLuint s_depth;
6714 static const glw::GLuint s_internalformat;
6716 /* ParameterSetupErrorsTest class */
6718 /** @class GenerateMipmapErrorsTest
6720 * Check that INVALID_OPERATION is generated by GenerateTextureMipmap if
6721 * texture is not the name of an existing texture object.
6723 * Check that INVALID_OPERATION is generated by GenerateTextureMipmap if
6724 * target is TEXTURE_CUBE_MAP or TEXTURE_CUBE_MAP_ARRAY, and the specified
6725 * texture object is not cube complete or cube array complete,
6728 class GenerateMipmapErrorsTest : public deqp::TestCase, ErrorsUtilities
6731 /* Public member functions. */
6732 GenerateMipmapErrorsTest(deqp::Context& context);
6734 virtual tcu::TestNode::IterateResult iterate();
6737 /* Private constructors. */
6738 GenerateMipmapErrorsTest(const GenerateMipmapErrorsTest& other);
6739 GenerateMipmapErrorsTest& operator=(const GenerateMipmapErrorsTest& other);
6741 static const glw::GLubyte s_reference_data[];
6742 static const glw::GLuint s_reference_width;
6743 static const glw::GLuint s_reference_height;
6744 static const glw::GLenum s_reference_internalformat;
6745 static const glw::GLenum s_reference_format;
6746 static const glw::GLenum s_reference_type;
6748 /* GenerateMipmapErrorsTest class */
6750 /** @class BindUnitErrorsTest
6752 * Check that INVALID_OPERATION error is generated if texture is not zero
6753 * or the name of an existing texture object.
6755 class BindUnitErrorsTest : public deqp::TestCase, ErrorsUtilities
6758 /* Public member functions. */
6759 BindUnitErrorsTest(deqp::Context& context);
6761 virtual tcu::TestNode::IterateResult iterate();
6764 /* Private constructors. */
6765 BindUnitErrorsTest(const BindUnitErrorsTest& other);
6766 BindUnitErrorsTest& operator=(const BindUnitErrorsTest& other);
6768 /* BindUnitErrorsTest class */
6770 /** @class ImageQueryErrorsTest
6772 * Check that INVALID_OPERATION is generated by GetTextureImage if texture
6773 * is not the name of an existing texture object.
6775 * Check that INVALID_ENUM is generated by GetTextureImage functions if
6776 * resulting texture target is not an accepted value TEXTURE_1D,
6777 * TEXTURE_2D, TEXTURE_3D, TEXTURE_1D_ARRAY, TEXTURE_2D_ARRAY,
6778 * TEXTURE_CUBE_MAP_ARRAY, TEXTURE_RECTANGLE, and TEXTURE_CUBE_MAP.
6780 * Check that INVALID_OPERATION error is generated by GetTextureImage if
6781 * the effective target is TEXTURE_CUBE_MAP or TEXTURE_CUBE_MAP_ARRAY, and
6782 * the texture object is not cube complete or cube array complete,
6785 * Check that GL_INVALID_VALUE is generated if level is less than 0 or
6786 * larger than the maximum allowable level.
6788 * Check that INVALID_VALUE error is generated if level is non-zero and the
6789 * effective target is TEXTURE_RECTANGLE.
6791 * Check that INVALID_OPERATION error is generated if any of the following
6792 * mismatches between format and the internal format of the texture image
6794 * - format is a color format (one of the formats in table 8.3 whose
6795 * target is the color buffer) and the base internal format of the
6796 * texture image is not a color format.
6797 * - format is DEPTH_COMPONENT and the base internal format is not
6798 * DEPTH_COMPONENT or DEPTH_STENCIL
6799 * - format is DEPTH_STENCIL and the base internal format is not
6801 * - format is STENCIL_INDEX and the base internal format is not
6802 * STENCIL_INDEX or DEPTH_STENCIL
6803 * - format is one of the integer formats in table 8.3 and the internal
6804 * format of the texture image is not integer, or format is not one of
6805 * the integer formats in table 8.3 and the internal format is integer.
6807 * Check that INVALID_OPERATION error is generated if a pixel pack buffer
6808 * object is bound and packing the texture image into the buffer’s memory
6809 * would exceed the size of the buffer.
6811 * Check that INVALID_OPERATION error is generated if a pixel pack buffer
6812 * object is bound and pixels is not evenly divisible by the number of
6813 * basic machine units needed to store in memory the GL data type
6814 * corresponding to type (see table 8.2).
6816 * Check that INVALID_OPERATION error is generated by GetTextureImage if
6817 * the buffer size required to store the requested data is greater than
6821 * Check that INVALID_OPERATION is generated by GetCompressedTextureImage
6822 * if texture is not the name of an existing texture object.
6824 * Check that INVALID_VALUE is generated by GetCompressedTextureImage if
6825 * level is less than zero or greater than the maximum number of LODs
6826 * permitted by the implementation.
6828 * Check that INVALID_OPERATION is generated if GetCompressedTextureImage
6829 * is used to retrieve a texture that is in an uncompressed internal
6832 * Check that INVALID_OPERATION is generated by GetCompressedTextureImage
6833 * if a non-zero buffer object name is bound to the PIXEL_PACK_BUFFER
6834 * target, the buffer storage was not initialized with BufferStorage using
6835 * MAP_PERSISTENT_BIT flag, and the buffer object's data store is currently
6838 * Check that INVALID_OPERATION is generated by GetCompressedTextureImage
6839 * if a non-zero buffer object name is bound to the PIXEL_PACK_BUFFER
6840 * target and the data would be packed to the buffer object such that the
6841 * memory writes required would exceed the data store size.
6843 class ImageQueryErrorsTest : public deqp::TestCase, ErrorsUtilities
6846 /* Public member functions. */
6847 ImageQueryErrorsTest(deqp::Context& context);
6849 virtual tcu::TestNode::IterateResult iterate();
6852 /* Private constructors. */
6853 ImageQueryErrorsTest(const ImageQueryErrorsTest& other);
6854 ImageQueryErrorsTest& operator=(const ImageQueryErrorsTest& other);
6856 static const glw::GLuint s_reference_data[];
6857 static const glw::GLuint s_reference_width;
6858 static const glw::GLuint s_reference_height;
6859 static const glw::GLuint s_reference_size;
6860 static const glw::GLenum s_reference_internalformat;
6861 static const glw::GLenum s_reference_internalformat_int;
6862 static const glw::GLenum s_reference_internalformat_compressed;
6863 static const glw::GLenum s_reference_format;
6864 static const glw::GLenum s_reference_type;
6866 /* ImageQueryErrorsTest class */
6868 /** @class LevelParameterErrorsTest
6870 * Check that INVALID_OPERATION is generated by GetTextureLevelParameterfv
6871 * and GetTextureLevelParameteriv functions if texture is not the name of
6872 * an existing texture object.
6874 * Check that INVALID_VALUE is generated by GetTextureLevelParameter* if
6875 * level is less than 0.
6877 * Check that INVALID_VALUE may be generated if level is greater than
6878 * log2 max, where max is the returned value of MAX_TEXTURE_SIZE.
6880 * Check that INVALID_OPERATION is generated by GetTextureLevelParameter*
6881 * if TEXTURE_COMPRESSED_IMAGE_SIZE is queried on texture images with an
6882 * uncompressed internal format or on proxy targets.
6884 * Check that INVALID_ENUM error is generated by GetTextureLevelParameter*
6885 * if pname is not one of supported constants.
6887 class LevelParameterErrorsTest : public deqp::TestCase, ErrorsUtilities
6890 /* Public member functions. */
6891 LevelParameterErrorsTest(deqp::Context& context);
6893 virtual tcu::TestNode::IterateResult iterate();
6896 /* Private constructors. */
6897 LevelParameterErrorsTest(const LevelParameterErrorsTest& other);
6898 LevelParameterErrorsTest& operator=(const LevelParameterErrorsTest& other);
6900 /* LevelParameterErrorsTest class */
6903 * Check that INVALID_ENUM is generated by glGetTextureParameter* if pname
6904 * is not an accepted value.
6906 * Check that INVALID_OPERATION is generated by glGetTextureParameter* if
6907 * texture is not the name of an existing texture object.
6909 * Check that INVALID_ENUM error is generated if the effective target is
6910 * not one of the supported texture targets (eg. TEXTURE_BUFFER).
6912 class ParameterErrorsTest : public deqp::TestCase, ErrorsUtilities
6915 /* Public member functions. */
6916 ParameterErrorsTest(deqp::Context& context);
6918 virtual tcu::TestNode::IterateResult iterate();
6921 /* Private constructors. */
6922 ParameterErrorsTest(const ParameterErrorsTest& other);
6923 ParameterErrorsTest& operator=(const ParameterErrorsTest& other);
6925 /* ParameterErrorsTest class */
6926 } /* Textures namespace */
6927 } /* DirectStateAccess namespace */
6928 } /* gl4cts namespace */
6930 #endif // _GL4CDIRECTSTATEACCESSTESTS_HPP