9#ifndef _HLSL_HLSL_INTRINSICS_H_
10#define _HLSL_HLSL_INTRINSICS_H_
24template <
typename T,
int N>
25constexpr vector<float, N>
asfloat(vector<T, N>
V) {
29template <
typename T>
constexpr float asfloat(T F) {
41template <
typename T,
int N>
constexpr vector<int, N>
asint(vector<T, N>
V) {
45template <
typename T>
constexpr int asint(T F) {
57#ifdef __HLSL_ENABLE_16_BIT
59template <
typename T,
int N>
61constexpr __detail::enable_if_t<__detail::is_same<int16_t, T>::value ||
62 __detail::is_same<uint16_t, T>::value ||
63 __detail::is_same<half, T>::value,
64 vector<int16_t, N>> asint16(vector<T, N>
V) {
71 __detail::is_same<uint16_t, T>::value ||
73 int16_t> asint16(T F) {
86template <
typename T,
int N>
constexpr vector<uint, N>
asuint(vector<T, N>
V) {
120#ifdef __HLSL_ENABLE_16_BIT
122template <
typename T,
int N>
125 __detail::is_same<uint16_t, T>::value ||
127 vector<uint16_t, N>> asuint16(vector<T, N>
V) {
133constexpr __detail::enable_if_t<__detail::is_same<int16_t, T>::value ||
134 __detail::is_same<uint16_t, T>::value ||
135 __detail::is_same<half, T>::value,
136 uint16_t> asuint16(T F) {
168 __detail::HLSL_FIXED_VECTOR<half, N> Y) {
234const inline __detail::enable_if_t<__detail::is_arithmetic<T>::
Value &&
235 __detail::is_same<half, T>::value,
250 __detail::HLSL_FIXED_VECTOR<half, L> N,
251 __detail::HLSL_FIXED_VECTOR<half, L> I,
252 __detail::HLSL_FIXED_VECTOR<half, L> Ng) {
278const inline __detail::enable_if_t<__detail::is_arithmetic<T>::
Value &&
279 __detail::is_same<half, T>::value,
295 __detail::HLSL_FIXED_VECTOR<half, N> Y) {
320const inline __detail::enable_if_t<__detail::is_arithmetic<T>::
Value &&
321 __detail::is_same<half, T>::value,
337 __detail::HLSL_FIXED_VECTOR<half, N> Exp) {
360const inline __detail::enable_if_t<__detail::is_arithmetic<T>::
Value &&
361 __detail::is_same<half, T>::value,
400const inline
half4 lit(half NDotL, half NDotH, half M) {
404const inline float4 lit(
float NDotL,
float NDotH,
float M) {
450const inline __detail::enable_if_t<__detail::is_arithmetic<T>::
Value &&
451 __detail::is_same<half, T>::value,
466 __detail::HLSL_FIXED_VECTOR<half, L> I,
467 __detail::HLSL_FIXED_VECTOR<half, L> N) {
509const inline __detail::enable_if_t<__detail::is_arithmetic<T>::
Value &&
510 __detail::is_same<half, T>::value,
525 __detail::HLSL_FIXED_VECTOR<half, L> I,
526 __detail::HLSL_FIXED_VECTOR<half, L> N, half eta) {
554const inline __detail::enable_if_t<__detail::is_arithmetic<T>::
Value &&
555 __detail::is_same<half, T>::value,
570 __detail::HLSL_FIXED_VECTOR<half, N> Min,
571 __detail::HLSL_FIXED_VECTOR<half, N> Max,
572 __detail::HLSL_FIXED_VECTOR<half, N>
X) {
#define _HLSL_BUILTIN_ALIAS(builtin)
#define _HLSL_AVAILABILITY(platform, version)
#define _HLSL_16BIT_AVAILABILITY(environment, version)
constexpr vector< T, N > smoothstep_vec_impl(vector< T, N > Min, vector< T, N > Max, vector< T, N > X)
constexpr T length_impl(T X)
constexpr vector< T, 4 > dst_impl(vector< T, 4 > Src0, vector< T, 4 > Src1)
constexpr T faceforward_impl(T N, T I, T Ng)
constexpr vector< T, L > reflect_vec_impl(vector< T, L > I, vector< T, L > N)
constexpr T distance_impl(T X, T Y)
constexpr T reflect_impl(T I, T N)
constexpr T ldexp_impl(T X, T Exp)
constexpr enable_if_t< is_same< float, T >::value||is_same< half, T >::value, T > distance_vec_impl(vector< T, N > X, vector< T, N > Y)
constexpr T fmod_impl(T X, T Y)
typename enable_if< B, T >::Type enable_if_t
constexpr int4 d3d_color_to_ubyte4_impl(float4 V)
constexpr T smoothstep_impl(T Min, T Max, T X)
constexpr enable_if_t< is_same< float, T >::value||is_same< half, T >::value, T > length_vec_impl(vector< T, N > X)
constexpr T refract_impl(T I, T N, U Eta)
constexpr float dot2add_impl(half2 a, half2 b, float c)
vector< __detail::enable_if_t<(N > 1 &&N<=4), T >, N > HLSL_FIXED_VECTOR
constexpr vector< T, N > fmod_vec_impl(vector< T, N > X, vector< T, N > Y)
constexpr enable_if_t< sizeof(U)==sizeof(T), vector< U, N > > bit_cast(vector< T, N > V)
constexpr vector< T, 4 > lit_impl(T NDotL, T NDotH, T M)
unsigned int uint
An unsigned 32-bit integer.
constexpr int4 D3DCOLORtoUBYTE4(float4 V)
vector< float, 4 > float4
const __detail::enable_if_t< __detail::is_arithmetic< T >::Value &&__detail::is_same< half, T >::value, T > smoothstep(T Min, T Max, T X)
Returns a smooth Hermite interpolation between 0 and 1, if X is in the range [Min,...
const half4 lit(half NDotL, half NDotH, half M)
constexpr vector< uint, N > asuint(vector< T, N > V)
vector< double, 3 > double3
const __detail::enable_if_t< __detail::is_arithmetic< T >::Value &&__detail::is_same< half, T >::value, T > refract(T I, T N, T eta)
Returns a refraction using an entering ray, I, a surface normal, N and refraction index eta.
const __detail::enable_if_t< __detail::is_arithmetic< T >::Value &&__detail::is_same< half, T >::value, T > length(T X)
Returns the length of the specified floating-point vector.
const __detail::enable_if_t< __detail::is_arithmetic< T >::Value &&__detail::is_same< half, T >::value, T > ldexp(T X, T Exp)
Returns the result of multiplying the specified value by two raised to the power of the specified exp...
const __detail::enable_if_t< __detail::is_arithmetic< T >::Value &&__detail::is_same< half, T >::value, T > reflect(T I, T N)
Returns a reflection using an incident ray, I, and a surface normal, N.
const __detail::enable_if_t< __detail::is_arithmetic< T >::Value &&__detail::is_same< half, T >::value, T > distance(T X, T Y)
Returns a distance scalar between X and Y.
vector< double, 4 > double4
vector< double, 2 > double2
const __detail::enable_if_t< __detail::is_arithmetic< T >::Value &&__detail::is_same< half, T >::value, T > faceforward(T N, T I, T Ng)
Flips the surface-normal (if needed) to face in a direction opposite to I.
const half4 dst(half4 Src0, half4 Src1)
constexpr vector< int, N > asint(vector< T, N > V)
const __detail::enable_if_t< __detail::is_arithmetic< T >::Value &&__detail::is_same< half, T >::value, T > fmod(T X, T Y)
Returns the linear interpolation of x to y.
constexpr vector< float, N > asfloat(vector< T, N > V)
const float dot2add(half2 A, half2 B, float C)
Dot product of 2 vector of type half and add a float scalar value.