1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 3.0 Module
3 * -------------------------------------------------
5 * Copyright 2014 The Android Open Source Project
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 * \brief Sampler State Query tests.
22 *//*--------------------------------------------------------------------*/
24 #include "es3fSamplerStateQueryTests.hpp"
25 #include "glsStateQueryUtil.hpp"
26 #include "glsTextureStateQueryTests.hpp"
28 #include "gluRenderContext.hpp"
29 #include "glwEnums.hpp"
31 using namespace deqp::gls::StateQueryUtil;
41 static const char* getVerifierSuffix (QueryType type)
45 case QUERY_SAMPLER_PARAM_INTEGER: return "_getsamplerparameteri";
46 case QUERY_SAMPLER_PARAM_FLOAT: return "_getsamplerparameterf";
53 #define FOR_EACH_VERIFIER(VERIFIERS, CODE_BLOCK) \
54 for (int _verifierNdx = 0; _verifierNdx < DE_LENGTH_OF_ARRAY(VERIFIERS); _verifierNdx++) \
56 QueryType verifier = VERIFIERS[_verifierNdx]; \
60 SamplerStateQueryTests::SamplerStateQueryTests (Context& context)
61 : TestCaseGroup(context, "sampler", "Sampler State Query tests")
64 void SamplerStateQueryTests::init (void)
66 using namespace gls::TextureStateQueryTests;
68 static const QueryType verifiers[] =
70 QUERY_SAMPLER_PARAM_INTEGER,
71 QUERY_SAMPLER_PARAM_FLOAT
80 { "sampler_texture_wrap_s", "TEXTURE_WRAP_S", TESTER_TEXTURE_WRAP_S },
81 { "sampler_texture_wrap_t", "TEXTURE_WRAP_T", TESTER_TEXTURE_WRAP_T },
82 { "sampler_texture_wrap_r", "TEXTURE_WRAP_R", TESTER_TEXTURE_WRAP_R },
83 { "sampler_texture_mag_filter", "TEXTURE_MAG_FILTER", TESTER_TEXTURE_MAG_FILTER },
84 { "sampler_texture_min_filter", "TEXTURE_MIN_FILTER", TESTER_TEXTURE_MIN_FILTER },
85 { "sampler_texture_min_lod", "TEXTURE_MIN_LOD", TESTER_TEXTURE_MIN_LOD },
86 { "sampler_texture_max_lod", "TEXTURE_MAX_LOD", TESTER_TEXTURE_MAX_LOD },
87 { "sampler_texture_compare_mode", "TEXTURE_COMPARE_MODE", TESTER_TEXTURE_COMPARE_MODE },
88 { "sampler_texture_compare_func", "TEXTURE_COMPARE_FUNC", TESTER_TEXTURE_COMPARE_FUNC },
91 for (int stateNdx = 0; stateNdx < DE_LENGTH_OF_ARRAY(states); ++stateNdx)
93 FOR_EACH_VERIFIER(verifiers, addChild(createSamplerParamTest(m_testCtx,
94 m_context.getRenderContext(),
95 std::string() + states[stateNdx].name + getVerifierSuffix(verifier),
96 states[stateNdx].desc,
98 states[stateNdx].tester)));