xref: /aosp_15_r20/external/deqp/external/openglcts/modules/common/glcTextureFilterAnisotropicTests.hpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1 #ifndef _GLCTEXTUREFILTERANISOTROPICTESTS_HPP
2 #define _GLCTEXTUREFILTERANISOTROPICTESTS_HPP
3 /*-------------------------------------------------------------------------
4  * OpenGL Conformance Test Suite
5  * -----------------------------
6  *
7  * Copyright (c) 2017 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  glcTextureFilterAnisotropicTests.hpp
29  * \brief Conformance tests for the GL_EXT_texture_filter_anisotropic functionality.
30  */ /*-------------------------------------------------------------------*/
31 #include "glcTestCase.hpp"
32 #include "glwDefs.hpp"
33 #include "tcuDefs.hpp"
34 
35 using namespace glw;
36 using namespace glu;
37 
38 namespace glcts
39 {
40 
41 class TextureFilterAnisotropicQueriesTestCase : public deqp::TestCase
42 {
43 public:
44     /* Public methods */
45     TextureFilterAnisotropicQueriesTestCase(deqp::Context &context);
46 
47     void deinit();
48     void init();
49     tcu::TestNode::IterateResult iterate();
50 
51 private:
52     /* Private methods */
53     bool verifyTexParameters(const glw::Functions &gl);
54     bool verifyGet(const glw::Functions &gl);
55 
56     /* Private members */
57 };
58 
59 class TextureFilterAnisotropicDrawingTestCase : public deqp::TestCase
60 {
61 public:
62     /* Public methods */
63     TextureFilterAnisotropicDrawingTestCase(deqp::Context &context);
64 
65     void deinit();
66     void init();
67     tcu::TestNode::IterateResult iterate();
68 
69 private:
70     /* Private methods */
71     void generateTexture(const glw::Functions &gl, GLenum target);
72     void fillTexture(const glw::Functions &gl, GLenum target, GLenum internalFormat);
73     bool drawTexture(const glw::Functions &gl, GLenum target, GLfloat anisoDegree);
74     GLuint verifyScene(const glw::Functions &gl);
75     void releaseTexture(const glw::Functions &gl);
76 
77     void generateTokens(GLenum target, std::string &refTexCoordType, std::string &refSamplerType);
78 
79     /* Private members */
80     const char *m_vertex;
81     const char *m_fragment;
82 
83     std::vector<GLenum> m_supportedTargets;
84     std::vector<GLenum> m_supportedInternalFormats;
85 
86     GLuint m_texture;
87 };
88 
89 /** Test group which encapsulates all conformance tests */
90 class TextureFilterAnisotropicTests : public deqp::TestCaseGroup
91 {
92 public:
93     /* Public methods */
94     TextureFilterAnisotropicTests(deqp::Context &context);
95 
96     void init();
97 
98 private:
99     TextureFilterAnisotropicTests(const TextureFilterAnisotropicTests &other);
100     TextureFilterAnisotropicTests &operator=(const TextureFilterAnisotropicTests &other);
101 };
102 
103 } // namespace glcts
104 
105 #endif // _GLCTEXTUREFILTERANISOTROPICTESTS_HPP
106