1 #ifndef _ESEXTCTEXTUREBORDERCLAMPSAMPLERPARAMETERIERROR_HPP 2 #define _ESEXTCTEXTUREBORDERCLAMPSAMPLERPARAMETERIERROR_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 esextcTextureBorderClampSamplerParameterIError.hpp 28 * \brief Verifies glGetSamplerParameterI*() and glSamplerParameterI*() 29 * entry-points generate errors for non-generated sampler objects 30 * as per extension specification. (Test 4) 31 */ /*-------------------------------------------------------------------*/ 32 33 #include "esextcTextureBorderClampBase.hpp" 34 35 namespace glcts 36 { 37 38 /** Implementation of Test 4 from CTS_EXT_texture_border_clamp. Description follows 39 * 40 * Verify glGetSamplerParameterIivEXT(), glGetSamplerParameterIuivEXT(), 41 * glSamplerParameterIivEXT() and glSamplerParameterIuivEXT() generate 42 * GL_INVALID_OPERATION error if called for a non-generated sampler object. 43 * 44 * Category: Negative tests. 45 * Priority: Must-have. 46 */ 47 class TextureBorderClampSamplerParameterIErrorTest : public TextureBorderClampBase 48 { 49 public: 50 /* Public methods */ 51 TextureBorderClampSamplerParameterIErrorTest(Context& context, const ExtParameters& extParams, const char* name, 52 const char* description); 53 ~TextureBorderClampSamplerParameterIErrorTest()54 virtual ~TextureBorderClampSamplerParameterIErrorTest() 55 { 56 } 57 58 virtual IterateResult iterate(void); 59 virtual void deinit(void); 60 61 private: 62 /* Private type definitions */ 63 struct PnameParams 64 { 65 /* Constructor */ PnameParamsglcts::TextureBorderClampSamplerParameterIErrorTest::PnameParams66 PnameParams() : pname(0) 67 { 68 params[0] = 0; 69 params[1] = 0; 70 params[2] = 0; 71 params[3] = 0; 72 } 73 74 /* Constructor. 75 * 76 * @param paramname parameter name 77 * @param param0 parameter value nr. 0 78 * @param param1 parameter value nr. 1 79 * @param param2 parameter value nr. 2 80 * @param param3 parameter value nr. 3 81 */ PnameParamsglcts::TextureBorderClampSamplerParameterIErrorTest::PnameParams82 PnameParams(glw::GLenum paramname, glw::GLint param0, glw::GLint param1 = 0, glw::GLint param2 = 0, 83 glw::GLint param3 = 0) 84 : pname(paramname) 85 { 86 params[0] = param0; 87 params[1] = param1; 88 params[2] = param2; 89 params[3] = param3; 90 } 91 92 glw::GLenum pname; 93 glw::GLint params[4]; 94 }; 95 96 /* Private methods */ 97 void initTest(void); 98 99 void VerifyGLGetCallsForAllPNames(glw::GLuint sampler_id, glw::GLenum expected_error); 100 101 void VerifyGLGetSamplerParameterIiv(glw::GLuint sampler_id, glw::GLenum pname, glw::GLenum expected_error); 102 103 void VerifyGLGetSamplerParameterIuiv(glw::GLuint sampler_id, glw::GLenum pname, glw::GLenum expected_error); 104 105 void VerifyGLSamplerCallsForAllPNames(glw::GLuint sampler_id, glw::GLenum expected_error); 106 107 void VerifyGLSamplerParameterIiv(glw::GLuint sampler_id, glw::GLenum pname, glw::GLint* params, 108 glw::GLenum expected_error); 109 110 void VerifyGLSamplerParameterIuiv(glw::GLuint sampler_id, glw::GLenum pname, glw::GLuint* params, 111 glw::GLenum expected_error); 112 113 /* Private variables */ 114 glw::GLuint m_sampler_id; 115 glw::GLboolean m_test_passed; 116 117 std::vector<PnameParams> m_pnames_list; 118 119 /* Private static constants */ 120 static const glw::GLuint m_buffer_size; 121 static const glw::GLuint m_texture_unit_index; 122 }; 123 124 } // namespace glcts 125 126 #endif // _ESEXTCTEXTUREBORDERCLAMPSAMPLERPARAMETERIERROR_HPP 127