master
ブランチ master
ShaderPlayground / deps / glm / glm / gtc / ulp.hpp
1.7 KB、63行 生 Blame 履歴
1/// @ref gtc_ulp
2/// @file glm/gtc/ulp.hpp
3///
4/// @see core (dependence)
5///
6/// @defgroup gtc_ulp GLM_GTC_ulp
7/// @ingroup gtc
8///
9/// Include <glm/gtc/ulp.hpp> to use the features of this extension.
10///
11/// Allow the measurement of the accuracy of a function against a reference
12/// implementation. This extension works on floating-point data and provide results
13/// in ULP.
14
15#pragma once
16
17// Dependencies
18#include "../gtc/constants.hpp"
19#include "../ext/vector_relational.hpp"
20
21#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
22# pragma message("GLM: GLM_GTC_ulp extension included")
23#endif
24
25namespace glm
26{
27 /// @addtogroup gtc_ulp
28 /// @{
29
30 /// Return the next ULP value(s) after the input value(s).
31 /// @see gtc_ulp
32 template<typename genType>
33 GLM_FUNC_DECL genType next_float(genType const& x);
34
35 /// Return the previous ULP value(s) before the input value(s).
36 /// @see gtc_ulp
37 template<typename genType>
38 GLM_FUNC_DECL genType prev_float(genType const& x);
39
40 /// Return the value(s) ULP distance after the input value(s).
41 /// @see gtc_ulp
42 template<typename genType>
43 GLM_FUNC_DECL genType next_float(genType const& x, uint const& Distance);
44
45 /// Return the value(s) ULP distance before the input value(s).
46 /// @see gtc_ulp
47 template<typename genType>
48 GLM_FUNC_DECL genType prev_float(genType const& x, uint const& Distance);
49
50 /// Return the distance in the number of ULP between 2 scalars.
51 /// @see gtc_ulp
52 template<typename T>
53 GLM_FUNC_DECL uint float_distance(T const& x, T const& y);
54
55 /// Return the distance in the number of ULP between 2 vectors.
56 /// @see gtc_ulp
57 template<typename T, qualifier Q>
58 GLM_FUNC_DECL vec<2, uint, Q> float_distance(vec<2, T, Q> const& x, vec<2, T, Q> const& y);
59
60 /// @}
61}// namespace glm
62
63#include "ulp.inl"