1 #ifndef _TCUTEXCOMPAREVERIFIER_HPP
2 #define _TCUTEXCOMPAREVERIFIER_HPP
3 /*-------------------------------------------------------------------------
4 * drawElements Quality Program Tester Core
5 * ----------------------------------------
7 * Copyright 2014 The Android Open Source Project
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
23 * \brief Texture compare (shadow) result verifier.
24 *//*--------------------------------------------------------------------*/
26 #include "tcuDefs.hpp"
27 #include "tcuTexture.hpp"
28 #include "tcuTexLookupVerifier.hpp"
33 /*--------------------------------------------------------------------*//*!
34 * \brief Texture compare (shadow) lookup precision parameters.
35 * \see LookupPrecision
36 *//*--------------------------------------------------------------------*/
37 struct TexComparePrecision
39 IVec3 coordBits; //!< Bits per coordinate component before any transformations. Assumed to be floating-point.
40 IVec3 uvwBits; //!< Bits per component in final per-level UV(W) coordinates. Assumed to be fixed-point.
41 int pcfBits; //!< Number of accurate bits in PCF. This is additional error taken into account when doing filtering. Assumed to be fixed-point.
42 int referenceBits; //!< Number of accurate bits in compare reference value. Assumed to be fixed-point.
43 int resultBits; //!< Number of accurate bits in result value. Assumed to be fixed-point.
45 TexComparePrecision (void)
53 } DE_WARN_UNUSED_TYPE;
55 bool isTexCompareResultValid (const Texture2DView& texture, const Sampler& sampler, const TexComparePrecision& prec, const Vec2& coord, const Vec2& lodBounds, const float cmpReference, const float result);
56 bool isTexCompareResultValid (const TextureCubeView& texture, const Sampler& sampler, const TexComparePrecision& prec, const Vec3& coord, const Vec2& lodBounds, const float cmpReference, const float result);
57 bool isTexCompareResultValid (const Texture2DArrayView& texture, const Sampler& sampler, const TexComparePrecision& prec, const Vec3& coord, const Vec2& lodBounds, const float cmpReference, const float result);
59 bool isGatherOffsetsCompareResultValid (const Texture2DView& texture, const Sampler& sampler, const TexComparePrecision& prec, const Vec2& coord, const IVec2 (&offsets)[4], float cmpReference, const Vec4& result);
60 bool isGatherOffsetsCompareResultValid (const Texture2DArrayView& texture, const Sampler& sampler, const TexComparePrecision& prec, const Vec3& coord, const IVec2 (&offsets)[4], float cmpReference, const Vec4& result);
61 // \note For cube textures, gather is only defined without offset.
62 bool isGatherCompareResultValid (const TextureCubeView& texture, const Sampler& sampler, const TexComparePrecision& prec, const Vec3& coord, float cmpReference, const Vec4& result);
66 #endif // _TCUTEXCOMPAREVERIFIER_HPP