• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _ESEXTCFRAGMENTSHADINGRATEBASIC_HPP
2 #define _ESEXTCFRAGMENTSHADINGRATEBASIC_HPP
3 /*-------------------------------------------------------------------------
4  * OpenGL Conformance Test Suite
5  * -----------------------------
6  *
7  * Copyright (c) 2022-2022 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 
23 /*!
24  * \file
25  * \brief
26  */ /*-------------------------------------------------------------------*/
27 
28 /*!
29  * \file  esextcesextcFragmentShadingRateBasic.hpp
30  * \brief FragmentShadingRateEXT basic render test
31  */ /*-------------------------------------------------------------------*/
32 
33 #include "../esextcTestCaseBase.hpp"
34 #include "gluShaderUtil.hpp"
35 #include "tcuDefs.hpp"
36 
37 #include <vector>
38 
39 namespace glu
40 {
41 class ShaderProgram;
42 }
43 
44 namespace glcts
45 {
46 class FragmentShadingRateBasic : public TestCaseBase
47 {
48 	struct TestcaseParam
49 	{
50 		deUint32 seed	= 0;
51 		deUint32 width	= 0;
52 		deUint32 height = 0;
53 	};
54 
55 public:
56 	FragmentShadingRateBasic(Context& context, const ExtParameters& extParams, const char* name,
57 							 const char* description);
58 
~FragmentShadingRateBasic()59 	~FragmentShadingRateBasic() override
60 	{
61 	}
62 
63 	void		  init(void) override;
64 	void		  deinit(void) override;
65 	IterateResult iterate(void) override;
66 
67 private:
68 	std::string genVS() const;
69 	std::string genFS() const;
70 	glw::GLenum translateDrawIDToShadingRate(deUint32 drawID) const;
71 
72 	void		   setupTest(void);
73 	glw::GLboolean verifyError(const glw::GLenum expected_error, const char* description) const;
74 
75 private:
76 	TestcaseParam			 m_tcParam;
77 	glu::ShaderProgram*		 m_program;
78 	glw::GLuint				 m_to_id;
79 	glw::GLuint				 m_fbo_id;
80 	glw::GLuint				 m_vbo_id;
81 	std::vector<glw::GLenum> m_availableShadingRates;
82 };
83 
84 } // namespace glcts
85 
86 #endif // _ESEXTCFRAGMENTSHADINGRATEBASIC_HPP
87