xref: /aosp_15_r20/external/deqp/modules/gles31/functional/es31fTextureStateQueryTests.cpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1*35238bceSAndroid Build Coastguard Worker /*-------------------------------------------------------------------------
2*35238bceSAndroid Build Coastguard Worker  * drawElements Quality Program OpenGL ES 3.1 Module
3*35238bceSAndroid Build Coastguard Worker  * -------------------------------------------------
4*35238bceSAndroid Build Coastguard Worker  *
5*35238bceSAndroid Build Coastguard Worker  * Copyright 2015 The Android Open Source Project
6*35238bceSAndroid Build Coastguard Worker  *
7*35238bceSAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
8*35238bceSAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
9*35238bceSAndroid Build Coastguard Worker  * You may obtain a copy of the License at
10*35238bceSAndroid Build Coastguard Worker  *
11*35238bceSAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
12*35238bceSAndroid Build Coastguard Worker  *
13*35238bceSAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
14*35238bceSAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
15*35238bceSAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16*35238bceSAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
17*35238bceSAndroid Build Coastguard Worker  * limitations under the License.
18*35238bceSAndroid Build Coastguard Worker  *
19*35238bceSAndroid Build Coastguard Worker  *//*!
20*35238bceSAndroid Build Coastguard Worker  * \file
21*35238bceSAndroid Build Coastguard Worker  * \brief Texture Param State Query tests.
22*35238bceSAndroid Build Coastguard Worker  *//*--------------------------------------------------------------------*/
23*35238bceSAndroid Build Coastguard Worker 
24*35238bceSAndroid Build Coastguard Worker #include "es31fTextureStateQueryTests.hpp"
25*35238bceSAndroid Build Coastguard Worker #include "glsTextureStateQueryTests.hpp"
26*35238bceSAndroid Build Coastguard Worker #include "glsStateQueryUtil.hpp"
27*35238bceSAndroid Build Coastguard Worker #include "glwEnums.hpp"
28*35238bceSAndroid Build Coastguard Worker 
29*35238bceSAndroid Build Coastguard Worker namespace deqp
30*35238bceSAndroid Build Coastguard Worker {
31*35238bceSAndroid Build Coastguard Worker namespace gles31
32*35238bceSAndroid Build Coastguard Worker {
33*35238bceSAndroid Build Coastguard Worker namespace Functional
34*35238bceSAndroid Build Coastguard Worker {
35*35238bceSAndroid Build Coastguard Worker 
36*35238bceSAndroid Build Coastguard Worker using namespace gls::StateQueryUtil;
37*35238bceSAndroid Build Coastguard Worker using namespace gls::TextureStateQueryTests;
38*35238bceSAndroid Build Coastguard Worker 
getVerifierSuffix(QueryType type)39*35238bceSAndroid Build Coastguard Worker static const char *getVerifierSuffix(QueryType type)
40*35238bceSAndroid Build Coastguard Worker {
41*35238bceSAndroid Build Coastguard Worker     switch (type)
42*35238bceSAndroid Build Coastguard Worker     {
43*35238bceSAndroid Build Coastguard Worker     case QUERY_TEXTURE_PARAM_FLOAT:
44*35238bceSAndroid Build Coastguard Worker     case QUERY_TEXTURE_PARAM_FLOAT_VEC4:
45*35238bceSAndroid Build Coastguard Worker         return "_float";
46*35238bceSAndroid Build Coastguard Worker 
47*35238bceSAndroid Build Coastguard Worker     case QUERY_TEXTURE_PARAM_INTEGER:
48*35238bceSAndroid Build Coastguard Worker     case QUERY_TEXTURE_PARAM_INTEGER_VEC4:
49*35238bceSAndroid Build Coastguard Worker         return "_integer";
50*35238bceSAndroid Build Coastguard Worker 
51*35238bceSAndroid Build Coastguard Worker     case QUERY_TEXTURE_PARAM_PURE_INTEGER:
52*35238bceSAndroid Build Coastguard Worker     case QUERY_TEXTURE_PARAM_PURE_INTEGER_VEC4:
53*35238bceSAndroid Build Coastguard Worker         return "_pure_int";
54*35238bceSAndroid Build Coastguard Worker 
55*35238bceSAndroid Build Coastguard Worker     case QUERY_TEXTURE_PARAM_PURE_UNSIGNED_INTEGER:
56*35238bceSAndroid Build Coastguard Worker     case QUERY_TEXTURE_PARAM_PURE_UNSIGNED_INTEGER_VEC4:
57*35238bceSAndroid Build Coastguard Worker         return "_pure_uint";
58*35238bceSAndroid Build Coastguard Worker 
59*35238bceSAndroid Build Coastguard Worker     default:
60*35238bceSAndroid Build Coastguard Worker         DE_ASSERT(false);
61*35238bceSAndroid Build Coastguard Worker         return DE_NULL;
62*35238bceSAndroid Build Coastguard Worker     }
63*35238bceSAndroid Build Coastguard Worker }
64*35238bceSAndroid Build Coastguard Worker 
isIsVectorQuery(TesterType tester)65*35238bceSAndroid Build Coastguard Worker static bool isIsVectorQuery(TesterType tester)
66*35238bceSAndroid Build Coastguard Worker {
67*35238bceSAndroid Build Coastguard Worker     return tester == TESTER_TEXTURE_BORDER_COLOR;
68*35238bceSAndroid Build Coastguard Worker }
69*35238bceSAndroid Build Coastguard Worker 
isExtendedParamQuery(TesterType tester)70*35238bceSAndroid Build Coastguard Worker static bool isExtendedParamQuery(TesterType tester)
71*35238bceSAndroid Build Coastguard Worker {
72*35238bceSAndroid Build Coastguard Worker     return tester == TESTER_TEXTURE_WRAP_S_CLAMP_TO_BORDER || tester == TESTER_TEXTURE_WRAP_T_CLAMP_TO_BORDER ||
73*35238bceSAndroid Build Coastguard Worker            tester == TESTER_TEXTURE_WRAP_R_CLAMP_TO_BORDER;
74*35238bceSAndroid Build Coastguard Worker }
75*35238bceSAndroid Build Coastguard Worker 
TextureStateQueryTests(Context & context)76*35238bceSAndroid Build Coastguard Worker TextureStateQueryTests::TextureStateQueryTests(Context &context)
77*35238bceSAndroid Build Coastguard Worker     : TestCaseGroup(context, "texture", "Texture State Query tests")
78*35238bceSAndroid Build Coastguard Worker {
79*35238bceSAndroid Build Coastguard Worker }
80*35238bceSAndroid Build Coastguard Worker 
~TextureStateQueryTests(void)81*35238bceSAndroid Build Coastguard Worker TextureStateQueryTests::~TextureStateQueryTests(void)
82*35238bceSAndroid Build Coastguard Worker {
83*35238bceSAndroid Build Coastguard Worker }
84*35238bceSAndroid Build Coastguard Worker 
init(void)85*35238bceSAndroid Build Coastguard Worker void TextureStateQueryTests::init(void)
86*35238bceSAndroid Build Coastguard Worker {
87*35238bceSAndroid Build Coastguard Worker     static const QueryType scalarVerifiers[] = {
88*35238bceSAndroid Build Coastguard Worker         QUERY_TEXTURE_PARAM_INTEGER,
89*35238bceSAndroid Build Coastguard Worker         QUERY_TEXTURE_PARAM_FLOAT,
90*35238bceSAndroid Build Coastguard Worker         QUERY_TEXTURE_PARAM_PURE_INTEGER,
91*35238bceSAndroid Build Coastguard Worker         QUERY_TEXTURE_PARAM_PURE_UNSIGNED_INTEGER,
92*35238bceSAndroid Build Coastguard Worker     };
93*35238bceSAndroid Build Coastguard Worker     static const QueryType nonPureVerifiers[] = {
94*35238bceSAndroid Build Coastguard Worker         QUERY_TEXTURE_PARAM_INTEGER,
95*35238bceSAndroid Build Coastguard Worker         QUERY_TEXTURE_PARAM_FLOAT,
96*35238bceSAndroid Build Coastguard Worker     };
97*35238bceSAndroid Build Coastguard Worker     static const QueryType vec4Verifiers[] = {
98*35238bceSAndroid Build Coastguard Worker         QUERY_TEXTURE_PARAM_INTEGER_VEC4,
99*35238bceSAndroid Build Coastguard Worker         QUERY_TEXTURE_PARAM_FLOAT_VEC4,
100*35238bceSAndroid Build Coastguard Worker         QUERY_TEXTURE_PARAM_PURE_INTEGER_VEC4,
101*35238bceSAndroid Build Coastguard Worker         QUERY_TEXTURE_PARAM_PURE_UNSIGNED_INTEGER_VEC4,
102*35238bceSAndroid Build Coastguard Worker     };
103*35238bceSAndroid Build Coastguard Worker 
104*35238bceSAndroid Build Coastguard Worker #define FOR_EACH_VERIFIER(VERIFIERS, X)                                                   \
105*35238bceSAndroid Build Coastguard Worker     for (int verifierNdx = 0; verifierNdx < DE_LENGTH_OF_ARRAY(VERIFIERS); ++verifierNdx) \
106*35238bceSAndroid Build Coastguard Worker     {                                                                                     \
107*35238bceSAndroid Build Coastguard Worker         const char *verifierSuffix = getVerifierSuffix((VERIFIERS)[verifierNdx]);         \
108*35238bceSAndroid Build Coastguard Worker         const QueryType verifier   = (VERIFIERS)[verifierNdx];                            \
109*35238bceSAndroid Build Coastguard Worker         targetGroup->addChild(X);                                                         \
110*35238bceSAndroid Build Coastguard Worker     }
111*35238bceSAndroid Build Coastguard Worker 
112*35238bceSAndroid Build Coastguard Worker     static const struct
113*35238bceSAndroid Build Coastguard Worker     {
114*35238bceSAndroid Build Coastguard Worker         const char *name;
115*35238bceSAndroid Build Coastguard Worker         glw::GLenum target;
116*35238bceSAndroid Build Coastguard Worker         bool newInGLES31;
117*35238bceSAndroid Build Coastguard Worker     } textureTargets[] = {
118*35238bceSAndroid Build Coastguard Worker         {
119*35238bceSAndroid Build Coastguard Worker             "texture_2d",
120*35238bceSAndroid Build Coastguard Worker             GL_TEXTURE_2D,
121*35238bceSAndroid Build Coastguard Worker             false,
122*35238bceSAndroid Build Coastguard Worker         },
123*35238bceSAndroid Build Coastguard Worker         {
124*35238bceSAndroid Build Coastguard Worker             "texture_3d",
125*35238bceSAndroid Build Coastguard Worker             GL_TEXTURE_3D,
126*35238bceSAndroid Build Coastguard Worker             false,
127*35238bceSAndroid Build Coastguard Worker         },
128*35238bceSAndroid Build Coastguard Worker         {
129*35238bceSAndroid Build Coastguard Worker             "texture_2d_array",
130*35238bceSAndroid Build Coastguard Worker             GL_TEXTURE_2D_ARRAY,
131*35238bceSAndroid Build Coastguard Worker             false,
132*35238bceSAndroid Build Coastguard Worker         },
133*35238bceSAndroid Build Coastguard Worker         {
134*35238bceSAndroid Build Coastguard Worker             "texture_cube_map",
135*35238bceSAndroid Build Coastguard Worker             GL_TEXTURE_CUBE_MAP,
136*35238bceSAndroid Build Coastguard Worker             false,
137*35238bceSAndroid Build Coastguard Worker         },
138*35238bceSAndroid Build Coastguard Worker         {
139*35238bceSAndroid Build Coastguard Worker             "texture_2d_multisample",
140*35238bceSAndroid Build Coastguard Worker             GL_TEXTURE_2D_MULTISAMPLE,
141*35238bceSAndroid Build Coastguard Worker             true,
142*35238bceSAndroid Build Coastguard Worker         },
143*35238bceSAndroid Build Coastguard Worker         {
144*35238bceSAndroid Build Coastguard Worker             "texture_2d_multisample_array",
145*35238bceSAndroid Build Coastguard Worker             GL_TEXTURE_2D_MULTISAMPLE_ARRAY,
146*35238bceSAndroid Build Coastguard Worker             true,
147*35238bceSAndroid Build Coastguard Worker         }, // GL_OES_texture_storage_multisample_2d_array
148*35238bceSAndroid Build Coastguard Worker         {
149*35238bceSAndroid Build Coastguard Worker             "texture_buffer",
150*35238bceSAndroid Build Coastguard Worker             GL_TEXTURE_BUFFER,
151*35238bceSAndroid Build Coastguard Worker             true,
152*35238bceSAndroid Build Coastguard Worker         }, // GL_EXT_texture_buffer
153*35238bceSAndroid Build Coastguard Worker         {
154*35238bceSAndroid Build Coastguard Worker             "texture_cube_array",
155*35238bceSAndroid Build Coastguard Worker             GL_TEXTURE_CUBE_MAP_ARRAY,
156*35238bceSAndroid Build Coastguard Worker             true,
157*35238bceSAndroid Build Coastguard Worker         }, // GL_EXT_texture_cube_map_array
158*35238bceSAndroid Build Coastguard Worker     };
159*35238bceSAndroid Build Coastguard Worker     static const struct
160*35238bceSAndroid Build Coastguard Worker     {
161*35238bceSAndroid Build Coastguard Worker         const char *name;
162*35238bceSAndroid Build Coastguard Worker         const char *desc;
163*35238bceSAndroid Build Coastguard Worker         TesterType tester;
164*35238bceSAndroid Build Coastguard Worker         bool newInGLES31;
165*35238bceSAndroid Build Coastguard Worker     } states[] = {
166*35238bceSAndroid Build Coastguard Worker         {"texture_swizzle_r", "TEXTURE_SWIZZLE_R", TESTER_TEXTURE_SWIZZLE_R, false},
167*35238bceSAndroid Build Coastguard Worker         {"texture_swizzle_g", "TEXTURE_SWIZZLE_G", TESTER_TEXTURE_SWIZZLE_G, false},
168*35238bceSAndroid Build Coastguard Worker         {"texture_swizzle_b", "TEXTURE_SWIZZLE_B", TESTER_TEXTURE_SWIZZLE_B, false},
169*35238bceSAndroid Build Coastguard Worker         {"texture_swizzle_a", "TEXTURE_SWIZZLE_A", TESTER_TEXTURE_SWIZZLE_A, false},
170*35238bceSAndroid Build Coastguard Worker         {"texture_wrap_s", "TEXTURE_WRAP_S", TESTER_TEXTURE_WRAP_S, false},
171*35238bceSAndroid Build Coastguard Worker         {"texture_wrap_t", "TEXTURE_WRAP_T", TESTER_TEXTURE_WRAP_T, false},
172*35238bceSAndroid Build Coastguard Worker         {"texture_wrap_r", "TEXTURE_WRAP_R", TESTER_TEXTURE_WRAP_R, false},
173*35238bceSAndroid Build Coastguard Worker         {"texture_mag_filter", "TEXTURE_MAG_FILTER", TESTER_TEXTURE_MAG_FILTER, false},
174*35238bceSAndroid Build Coastguard Worker         {"texture_min_filter", "TEXTURE_MIN_FILTER", TESTER_TEXTURE_MIN_FILTER, false},
175*35238bceSAndroid Build Coastguard Worker         {"texture_min_lod", "TEXTURE_MIN_LOD", TESTER_TEXTURE_MIN_LOD, false},
176*35238bceSAndroid Build Coastguard Worker         {"texture_max_lod", "TEXTURE_MAX_LOD", TESTER_TEXTURE_MAX_LOD, false},
177*35238bceSAndroid Build Coastguard Worker         {"texture_base_level", "TEXTURE_BASE_LEVEL", TESTER_TEXTURE_BASE_LEVEL, false},
178*35238bceSAndroid Build Coastguard Worker         {"texture_max_level", "TEXTURE_MAX_LEVEL", TESTER_TEXTURE_MAX_LEVEL, false},
179*35238bceSAndroid Build Coastguard Worker         {"texture_compare_mode", "TEXTURE_COMPARE_MODE", TESTER_TEXTURE_COMPARE_MODE, false},
180*35238bceSAndroid Build Coastguard Worker         {"texture_compare_func", "TEXTURE_COMPARE_FUNC", TESTER_TEXTURE_COMPARE_FUNC, false},
181*35238bceSAndroid Build Coastguard Worker         {"texture_immutable_levels", "TEXTURE_IMMUTABLE_LEVELS", TESTER_TEXTURE_IMMUTABLE_LEVELS, false},
182*35238bceSAndroid Build Coastguard Worker         {"texture_immutable_format", "TEXTURE_IMMUTABLE_FORMAT", TESTER_TEXTURE_IMMUTABLE_FORMAT, false},
183*35238bceSAndroid Build Coastguard Worker         {"depth_stencil_mode", "DEPTH_STENCIL_TEXTURE_MODE", TESTER_DEPTH_STENCIL_TEXTURE_MODE, true},
184*35238bceSAndroid Build Coastguard Worker         {"texture_srgb_decode", "TEXTURE_SRGB_DECODE_EXT", TESTER_TEXTURE_SRGB_DECODE_EXT, true},
185*35238bceSAndroid Build Coastguard Worker         {"texture_border_color", "TEXTURE_BORDER_COLOR", TESTER_TEXTURE_BORDER_COLOR, true},
186*35238bceSAndroid Build Coastguard Worker         {"texture_wrap_s_clamp_to_border", "TEXTURE_WRAP_S_CLAMP_TO_BORDER", TESTER_TEXTURE_WRAP_S_CLAMP_TO_BORDER,
187*35238bceSAndroid Build Coastguard Worker          true},
188*35238bceSAndroid Build Coastguard Worker         {"texture_wrap_t_clamp_to_border", "TEXTURE_WRAP_T_CLAMP_TO_BORDER", TESTER_TEXTURE_WRAP_T_CLAMP_TO_BORDER,
189*35238bceSAndroid Build Coastguard Worker          true},
190*35238bceSAndroid Build Coastguard Worker         {"texture_wrap_r_clamp_to_border", "TEXTURE_WRAP_R_CLAMP_TO_BORDER", TESTER_TEXTURE_WRAP_R_CLAMP_TO_BORDER,
191*35238bceSAndroid Build Coastguard Worker          true},
192*35238bceSAndroid Build Coastguard Worker     };
193*35238bceSAndroid Build Coastguard Worker     static const struct
194*35238bceSAndroid Build Coastguard Worker     {
195*35238bceSAndroid Build Coastguard Worker         const char *name;
196*35238bceSAndroid Build Coastguard Worker         const char *desc;
197*35238bceSAndroid Build Coastguard Worker         QueryType verifier;
198*35238bceSAndroid Build Coastguard Worker     } pureSetters[] = {
199*35238bceSAndroid Build Coastguard Worker         {"set_pure_int", "Set state with pure int", QUERY_TEXTURE_PARAM_PURE_INTEGER},
200*35238bceSAndroid Build Coastguard Worker         {"set_pure_uint", "Set state with pure unsigned int", QUERY_TEXTURE_PARAM_PURE_UNSIGNED_INTEGER},
201*35238bceSAndroid Build Coastguard Worker     };
202*35238bceSAndroid Build Coastguard Worker     static const struct
203*35238bceSAndroid Build Coastguard Worker     {
204*35238bceSAndroid Build Coastguard Worker         const char *name;
205*35238bceSAndroid Build Coastguard Worker         const char *desc;
206*35238bceSAndroid Build Coastguard Worker         TesterType intTester;
207*35238bceSAndroid Build Coastguard Worker         TesterType uintTester;
208*35238bceSAndroid Build Coastguard Worker     } pureStates[] = {
209*35238bceSAndroid Build Coastguard Worker         {"texture_swizzle_r", "TEXTURE_SWIZZLE_R", TESTER_TEXTURE_SWIZZLE_R_SET_PURE_INT,
210*35238bceSAndroid Build Coastguard Worker          TESTER_TEXTURE_SWIZZLE_R_SET_PURE_UINT},
211*35238bceSAndroid Build Coastguard Worker         {"texture_swizzle_g", "TEXTURE_SWIZZLE_G", TESTER_TEXTURE_SWIZZLE_G_SET_PURE_INT,
212*35238bceSAndroid Build Coastguard Worker          TESTER_TEXTURE_SWIZZLE_G_SET_PURE_UINT},
213*35238bceSAndroid Build Coastguard Worker         {"texture_swizzle_b", "TEXTURE_SWIZZLE_B", TESTER_TEXTURE_SWIZZLE_B_SET_PURE_INT,
214*35238bceSAndroid Build Coastguard Worker          TESTER_TEXTURE_SWIZZLE_B_SET_PURE_UINT},
215*35238bceSAndroid Build Coastguard Worker         {"texture_swizzle_a", "TEXTURE_SWIZZLE_A", TESTER_TEXTURE_SWIZZLE_A_SET_PURE_INT,
216*35238bceSAndroid Build Coastguard Worker          TESTER_TEXTURE_SWIZZLE_A_SET_PURE_UINT},
217*35238bceSAndroid Build Coastguard Worker         {"texture_wrap_s", "TEXTURE_WRAP_S", TESTER_TEXTURE_WRAP_S_SET_PURE_INT, TESTER_TEXTURE_WRAP_S_SET_PURE_UINT},
218*35238bceSAndroid Build Coastguard Worker         {"texture_wrap_t", "TEXTURE_WRAP_T", TESTER_TEXTURE_WRAP_T_SET_PURE_INT, TESTER_TEXTURE_WRAP_T_SET_PURE_UINT},
219*35238bceSAndroid Build Coastguard Worker         {"texture_wrap_r", "TEXTURE_WRAP_R", TESTER_TEXTURE_WRAP_R_SET_PURE_INT, TESTER_TEXTURE_WRAP_R_SET_PURE_UINT},
220*35238bceSAndroid Build Coastguard Worker         {"texture_mag_filter", "TEXTURE_MAG_FILTER", TESTER_TEXTURE_MAG_FILTER_SET_PURE_INT,
221*35238bceSAndroid Build Coastguard Worker          TESTER_TEXTURE_MAG_FILTER_SET_PURE_UINT},
222*35238bceSAndroid Build Coastguard Worker         {"texture_min_filter", "TEXTURE_MIN_FILTER", TESTER_TEXTURE_MIN_FILTER_SET_PURE_INT,
223*35238bceSAndroid Build Coastguard Worker          TESTER_TEXTURE_MIN_FILTER_SET_PURE_UINT},
224*35238bceSAndroid Build Coastguard Worker         {"texture_min_lod", "TEXTURE_MIN_LOD", TESTER_TEXTURE_MIN_LOD_SET_PURE_INT,
225*35238bceSAndroid Build Coastguard Worker          TESTER_TEXTURE_MIN_LOD_SET_PURE_UINT},
226*35238bceSAndroid Build Coastguard Worker         {"texture_max_lod", "TEXTURE_MAX_LOD", TESTER_TEXTURE_MAX_LOD_SET_PURE_INT,
227*35238bceSAndroid Build Coastguard Worker          TESTER_TEXTURE_MAX_LOD_SET_PURE_UINT},
228*35238bceSAndroid Build Coastguard Worker         {"texture_base_level", "TEXTURE_BASE_LEVEL", TESTER_TEXTURE_BASE_LEVEL_SET_PURE_INT,
229*35238bceSAndroid Build Coastguard Worker          TESTER_TEXTURE_BASE_LEVEL_SET_PURE_UINT},
230*35238bceSAndroid Build Coastguard Worker         {"texture_max_level", "TEXTURE_MAX_LEVEL", TESTER_TEXTURE_MAX_LEVEL_SET_PURE_INT,
231*35238bceSAndroid Build Coastguard Worker          TESTER_TEXTURE_MAX_LEVEL_SET_PURE_UINT},
232*35238bceSAndroid Build Coastguard Worker         {"texture_compare_mode", "TEXTURE_COMPARE_MODE", TESTER_TEXTURE_COMPARE_MODE_SET_PURE_INT,
233*35238bceSAndroid Build Coastguard Worker          TESTER_TEXTURE_COMPARE_MODE_SET_PURE_UINT},
234*35238bceSAndroid Build Coastguard Worker         {"texture_compare_func", "TEXTURE_COMPARE_FUNC", TESTER_TEXTURE_COMPARE_FUNC_SET_PURE_INT,
235*35238bceSAndroid Build Coastguard Worker          TESTER_TEXTURE_COMPARE_FUNC_SET_PURE_UINT},
236*35238bceSAndroid Build Coastguard Worker         // \note texture_immutable_levels is not settable
237*35238bceSAndroid Build Coastguard Worker         // \note texture_immutable_format is not settable
238*35238bceSAndroid Build Coastguard Worker         {"depth_stencil_mode", "DEPTH_STENCIL_TEXTURE_MODE", TESTER_DEPTH_STENCIL_TEXTURE_MODE_SET_PURE_INT,
239*35238bceSAndroid Build Coastguard Worker          TESTER_DEPTH_STENCIL_TEXTURE_MODE_SET_PURE_UINT},
240*35238bceSAndroid Build Coastguard Worker         {"texture_srgb_decode", "TEXTURE_SRGB_DECODE_EXT", TESTER_TEXTURE_SRGB_DECODE_EXT_SET_PURE_INT,
241*35238bceSAndroid Build Coastguard Worker          TESTER_TEXTURE_SRGB_DECODE_EXT_SET_PURE_UINT},
242*35238bceSAndroid Build Coastguard Worker         // \note texture_border_color is already checked
243*35238bceSAndroid Build Coastguard Worker         // \note texture_wrap_*_clamp_to_border brings no additional coverage
244*35238bceSAndroid Build Coastguard Worker     };
245*35238bceSAndroid Build Coastguard Worker 
246*35238bceSAndroid Build Coastguard Worker     for (int targetNdx = 0; targetNdx < DE_LENGTH_OF_ARRAY(textureTargets); ++targetNdx)
247*35238bceSAndroid Build Coastguard Worker     {
248*35238bceSAndroid Build Coastguard Worker         tcu::TestCaseGroup *const targetGroup =
249*35238bceSAndroid Build Coastguard Worker             new tcu::TestCaseGroup(m_testCtx, textureTargets[targetNdx].name, textureTargets[targetNdx].name);
250*35238bceSAndroid Build Coastguard Worker         addChild(targetGroup);
251*35238bceSAndroid Build Coastguard Worker 
252*35238bceSAndroid Build Coastguard Worker         if (textureTargets[targetNdx].newInGLES31)
253*35238bceSAndroid Build Coastguard Worker         {
254*35238bceSAndroid Build Coastguard Worker             targetGroup->addChild(createIsTextureTest(m_testCtx, m_context.getRenderContext(), "is_texture",
255*35238bceSAndroid Build Coastguard Worker                                                       "IsTexture", textureTargets[targetNdx].target));
256*35238bceSAndroid Build Coastguard Worker         }
257*35238bceSAndroid Build Coastguard Worker 
258*35238bceSAndroid Build Coastguard Worker         for (int stateNdx = 0; stateNdx < DE_LENGTH_OF_ARRAY(states); ++stateNdx)
259*35238bceSAndroid Build Coastguard Worker         {
260*35238bceSAndroid Build Coastguard Worker             if (!isLegalTesterForTarget(textureTargets[targetNdx].target, states[stateNdx].tester))
261*35238bceSAndroid Build Coastguard Worker                 continue;
262*35238bceSAndroid Build Coastguard Worker 
263*35238bceSAndroid Build Coastguard Worker             // for old targets, check only new states
264*35238bceSAndroid Build Coastguard Worker             if (!textureTargets[targetNdx].newInGLES31 && !states[stateNdx].newInGLES31)
265*35238bceSAndroid Build Coastguard Worker                 continue;
266*35238bceSAndroid Build Coastguard Worker 
267*35238bceSAndroid Build Coastguard Worker             if (isExtendedParamQuery(states[stateNdx].tester))
268*35238bceSAndroid Build Coastguard Worker             {
269*35238bceSAndroid Build Coastguard Worker                 // no need to cover for all getters if the only thing new is the param name
270*35238bceSAndroid Build Coastguard Worker                 FOR_EACH_VERIFIER(nonPureVerifiers,
271*35238bceSAndroid Build Coastguard Worker                                   createTexParamTest(m_testCtx, m_context.getRenderContext(),
272*35238bceSAndroid Build Coastguard Worker                                                      std::string() + states[stateNdx].name + verifierSuffix,
273*35238bceSAndroid Build Coastguard Worker                                                      states[stateNdx].desc, verifier, textureTargets[targetNdx].target,
274*35238bceSAndroid Build Coastguard Worker                                                      states[stateNdx].tester))
275*35238bceSAndroid Build Coastguard Worker             }
276*35238bceSAndroid Build Coastguard Worker             else if (isIsVectorQuery(states[stateNdx].tester))
277*35238bceSAndroid Build Coastguard Worker             {
278*35238bceSAndroid Build Coastguard Worker                 FOR_EACH_VERIFIER(vec4Verifiers,
279*35238bceSAndroid Build Coastguard Worker                                   createTexParamTest(m_testCtx, m_context.getRenderContext(),
280*35238bceSAndroid Build Coastguard Worker                                                      std::string() + states[stateNdx].name + verifierSuffix,
281*35238bceSAndroid Build Coastguard Worker                                                      states[stateNdx].desc, verifier, textureTargets[targetNdx].target,
282*35238bceSAndroid Build Coastguard Worker                                                      states[stateNdx].tester))
283*35238bceSAndroid Build Coastguard Worker             }
284*35238bceSAndroid Build Coastguard Worker             else
285*35238bceSAndroid Build Coastguard Worker             {
286*35238bceSAndroid Build Coastguard Worker                 FOR_EACH_VERIFIER(scalarVerifiers,
287*35238bceSAndroid Build Coastguard Worker                                   createTexParamTest(m_testCtx, m_context.getRenderContext(),
288*35238bceSAndroid Build Coastguard Worker                                                      std::string() + states[stateNdx].name + verifierSuffix,
289*35238bceSAndroid Build Coastguard Worker                                                      states[stateNdx].desc, verifier, textureTargets[targetNdx].target,
290*35238bceSAndroid Build Coastguard Worker                                                      states[stateNdx].tester))
291*35238bceSAndroid Build Coastguard Worker             }
292*35238bceSAndroid Build Coastguard Worker         }
293*35238bceSAndroid Build Coastguard Worker     }
294*35238bceSAndroid Build Coastguard Worker 
295*35238bceSAndroid Build Coastguard Worker #undef FOR_EACH_VERIFIER
296*35238bceSAndroid Build Coastguard Worker 
297*35238bceSAndroid Build Coastguard Worker     // set_pure_uint
298*35238bceSAndroid Build Coastguard Worker     // set_pure_int
299*35238bceSAndroid Build Coastguard Worker     for (int setterNdx = 0; setterNdx < DE_LENGTH_OF_ARRAY(pureSetters); ++setterNdx)
300*35238bceSAndroid Build Coastguard Worker     {
301*35238bceSAndroid Build Coastguard Worker         tcu::TestCaseGroup *const targetGroup =
302*35238bceSAndroid Build Coastguard Worker             new tcu::TestCaseGroup(m_testCtx, pureSetters[setterNdx].name, pureSetters[setterNdx].desc);
303*35238bceSAndroid Build Coastguard Worker         addChild(targetGroup);
304*35238bceSAndroid Build Coastguard Worker 
305*35238bceSAndroid Build Coastguard Worker         for (int stateNdx = 0; stateNdx < DE_LENGTH_OF_ARRAY(pureStates); ++stateNdx)
306*35238bceSAndroid Build Coastguard Worker         {
307*35238bceSAndroid Build Coastguard Worker             const TesterType tester = (pureSetters[setterNdx].verifier == QUERY_TEXTURE_PARAM_PURE_INTEGER) ?
308*35238bceSAndroid Build Coastguard Worker                                           (pureStates[stateNdx].intTester) :
309*35238bceSAndroid Build Coastguard Worker                                       (pureSetters[setterNdx].verifier == QUERY_TEXTURE_PARAM_PURE_UNSIGNED_INTEGER) ?
310*35238bceSAndroid Build Coastguard Worker                                           (pureStates[stateNdx].uintTester) :
311*35238bceSAndroid Build Coastguard Worker                                           (TESTER_LAST);
312*35238bceSAndroid Build Coastguard Worker             // need 3d texture to test R wrap
313*35238bceSAndroid Build Coastguard Worker             const glw::GLenum target = (pureStates[stateNdx].intTester == TESTER_TEXTURE_WRAP_R_SET_PURE_INT) ?
314*35238bceSAndroid Build Coastguard Worker                                            (GL_TEXTURE_3D) :
315*35238bceSAndroid Build Coastguard Worker                                            (GL_TEXTURE_2D);
316*35238bceSAndroid Build Coastguard Worker 
317*35238bceSAndroid Build Coastguard Worker             targetGroup->addChild(
318*35238bceSAndroid Build Coastguard Worker                 createTexParamTest(m_testCtx, m_context.getRenderContext(), std::string() + pureStates[stateNdx].name,
319*35238bceSAndroid Build Coastguard Worker                                    pureStates[stateNdx].desc, pureSetters[setterNdx].verifier, target, tester));
320*35238bceSAndroid Build Coastguard Worker         }
321*35238bceSAndroid Build Coastguard Worker     }
322*35238bceSAndroid Build Coastguard Worker }
323*35238bceSAndroid Build Coastguard Worker 
324*35238bceSAndroid Build Coastguard Worker } // namespace Functional
325*35238bceSAndroid Build Coastguard Worker } // namespace gles31
326*35238bceSAndroid Build Coastguard Worker } // namespace deqp
327