1 #ifndef _ESEXTCTEXTUREBUFFERERRORS_HPP
2 #define _ESEXTCTEXTUREBUFFERERRORS_HPP
3 /*-------------------------------------------------------------------------
4  * OpenGL Conformance Test Suite
5  * -----------------------------
6  *
7  * Copyright (c) 2014-2016 The Khronos Group Inc.
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */ /*!
22  * \file
23  * \brief
24  */ /*-------------------------------------------------------------------*/
25 
26 /*!
27  * \file  esextcTextureBufferErrors.hpp
28  * \brief TexBufferEXT and TexBufferRangeEXT errors (Test 7)
29  */ /*-------------------------------------------------------------------*/
30 
31 #include "../esextcTestCaseBase.hpp"
32 #include "gluShaderUtil.hpp"
33 #include "tcuDefs.hpp"
34 
35 #include <vector>
36 
37 namespace glcts
38 {
39 
40 /*    Implementation of (Test 7) from CTS_EXT_texture_buffer. Description follows:
41  *
42  *    Test whether functions TexBufferEXT and TexBufferRangeEXT generate errors
43  *    as specified in the extension specification.
44  *
45  *    Category: API.
46  *              Dependency with OES_texture_storage_multisample_2d_array
47  *
48  *    Check if for all targets apart from TEXTURE_BUFFER_EXT functions
49  *    TexBufferEXT and TexBufferRangeEXT report INVALID_ENUM error.
50  *
51  *    Check if for GL_DEPTH_COMPONENT32F internal format functions
52  *    TexBufferEXT and TexBufferRangeEXT report INVALID_ENUM error.
53  *
54  *    Check if for buffer id not previously returned by genBuffers and
55  *    not equal to zero functions TexBufferEXT and TexBufferRangeEXT report
56  *    INVALID_OPERATION error.
57  *
58  *    Check if for offset parameter that is negative, size parameter that is less
59  *    than or equal to zero or offset + size that is greater than the value of
60  *    GL_BUFFER_SIZE for the buffer object bound to TEXTURE_BUFFER_EXT target
61  *    function TexBufferRangeEXT reports INVALID_VALUE error.
62  *
63  *    Check if in case of offset parameter not being an integer multiple of
64  *    value(TEXTURE_BUFFER_OFFSET_ALIGNMENT_EXT) function TexBufferRangeEXT
65  *    reports INVALID_VALUE error.
66  */
67 class TextureBufferErrors : public TestCaseBase
68 {
69 public:
70 	/* Public methods */
71 	TextureBufferErrors(Context& context, const ExtParameters& extParams, const char* name, const char* description);
72 
~TextureBufferErrors()73 	virtual ~TextureBufferErrors()
74 	{
75 	}
76 
77 	virtual void		  deinit(void);
78 	virtual IterateResult iterate(void);
79 
80 private:
81 	/* Private methods */
82 	void		   initTest(void);
83 	glw::GLboolean verifyError(const glw::GLenum expected_error, const char* description);
84 
85 	typedef std::vector<glw::GLenum> TargetsVector;
86 
87 	/* Private variables */
88 	glw::GLuint   m_bo_id;			 /* Buffer  Object */
89 	glw::GLuint   m_tex_id;			 /* Texture Buffer Object Texture ID */
90 	TargetsVector m_texture_targets; /* Texture Targets */
91 
92 	/* Private static constants */
93 	static const glw::GLint m_bo_size; /* Buffer object size */
94 };
95 
96 } // namespace glcts
97 
98 #endif // _ESEXTCTEXTUREBUFFERERRORS_HPP
99