1 #ifndef _GLCTEXTURELODBASICTESTS_HPP 2 #define _GLCTEXTURELODBASICTESTS_HPP 3 /*------------------------------------------------------------------------- 4 * OpenGL Conformance Test Suite 5 * ----------------------------- 6 * 7 * Copyright (c) 2024 The Khronos Group Inc. 8 * 9 * Licensed under the Apache License, Version 2.0 (the "License"); 10 * you may not use this file except in compliance with the License. 11 * You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, software 16 * distributed under the License is distributed on an "AS IS" BASIS, 17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 * See the License for the specific language governing permissions and 19 * limitations under the License. 20 * 21 */ /*! 22 * \file 23 * \brief 24 */ /*-------------------------------------------------------------------*/ 25 26 /** 27 */ /*! 28 * \file glcTextureLodBasicTests.hpp 29 * \brief Conformance tests for basic texture lod operations. 30 */ /*-------------------------------------------------------------------*/ 31 32 #include "glcTestCase.hpp" 33 #include "glwDefs.hpp" 34 #include "tcuDefs.hpp" 35 36 #include <map> 37 38 namespace glu 39 { 40 class ShaderProgram; 41 } 42 43 namespace glcts 44 { 45 46 /** class to handle LOD selection test, former sgis_texture_lod_basic_lod_selection */ 47 class TextureLodSelectionTestCase : public deqp::TestCase 48 { 49 public: 50 /* Public methods */ 51 TextureLodSelectionTestCase(deqp::Context &context); 52 53 void deinit(); 54 void init(); 55 tcu::TestNode::IterateResult iterate(); 56 57 private: 58 /* Private methods */ 59 void createLodTexture(const glw::GLenum target); 60 void releaseTexture(); 61 void setBuffers(const glu::ShaderProgram &program); 62 void releaseBuffers(); 63 64 void createSolidTexture(const glw::GLenum, const int, const int, const glw::GLubyte *const); 65 bool drawAndVerify(const glw::GLint, const float, const int, const int, const int, const float, const float, 66 const float, const glw::GLenum, const glw::GLenum, const bool); 67 bool doComparison(const int size, const float *const expectedcolor); 68 69 /* Private members */ 70 static const glw::GLchar *m_shader_basic_vert; 71 static const glw::GLchar *m_shader_basic_1d_frag; 72 static const glw::GLchar *m_shader_basic_2d_frag; 73 74 std::map<std::string, std::string> specializationMap; 75 76 glw::GLuint m_texture; 77 glw::GLuint m_vao; 78 glw::GLuint m_vbo; 79 80 bool m_isContextES; 81 }; 82 83 /** Test group which encapsulates all conformance tests */ 84 class TextureLodBasicTests : public deqp::TestCaseGroup 85 { 86 public: 87 /* Public methods */ 88 TextureLodBasicTests(deqp::Context &context); 89 90 void init(); 91 92 private: 93 TextureLodBasicTests(const TextureLodBasicTests &other); 94 TextureLodBasicTests &operator=(const TextureLodBasicTests &other); 95 }; 96 97 } // namespace glcts 98 99 #endif // _GLCTEXTURELODBASICTESTS_HPP 100