• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _GLCTEXTURELODBIASTESTS_HPP
2 #define _GLCTEXTURELODBIASTESTS_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  glcTextureLodBiasTests.hpp
29  * \brief Conformance tests for texture lod bias feature functionality.
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 TextureLodBiasAllTestCase : public deqp::TestCase
47 {
48 public:
49     /* Public methods */
50     TextureLodBiasAllTestCase(deqp::Context &context);
51 
52     void deinit();
53     void init();
54     tcu::TestNode::IterateResult iterate();
55 
56 private:
57     /* Private methods */
58     void createRenderingResources();
59     bool drawQuad(glw::GLuint, bool, float, float, float, float, float);
60     void releaseRenderingResources();
61     void setBuffers(const glu::ShaderProgram &program);
62     void releaseBuffers();
63 
64     /* Private members */
65     static const glw::GLchar *m_vert_shader_sampler_vert;
66     static const glw::GLchar *m_frag_shader_sampler_vert;
67 
68     static const glw::GLchar *m_vert_shader_sampler_frag;
69     static const glw::GLchar *m_frag_shader_sampler_frag;
70 
71     std::map<std::string, std::string> specializationMap;
72 
73     glw::GLuint m_texture;
74     glw::GLuint m_target;
75     glw::GLuint m_fbo;
76 
77     glw::GLuint m_vao;
78     glw::GLuint m_vbo;
79 
80     bool m_isContextES;
81     bool m_testSupported;
82     bool m_vertexLookupSupported;
83 
84     int m_maxErrorTolerance;
85 };
86 
87 /** Test group which encapsulates all conformance tests */
88 class TextureLodBiasTests : public deqp::TestCaseGroup
89 {
90 public:
91     /* Public methods */
92     TextureLodBiasTests(deqp::Context &context);
93 
94     void init();
95 
96 private:
97     TextureLodBiasTests(const TextureLodBiasTests &other);
98     TextureLodBiasTests &operator=(const TextureLodBiasTests &other);
99 };
100 
101 } // namespace glcts
102 
103 #endif // _GLCTEXTURELODBIASTESTS_HPP
104