9#ifndef _HLSL_HLSL_INTRINSICS_H_
10#define _HLSL_HLSL_INTRINSICS_H_
17#include "hlsl_inline_intrinsics_gen.inc"
27template <
typename T,
int N>
28constexpr vector<float, N>
asfloat(vector<T, N>
V) {
32template <
typename T>
constexpr float asfloat(T F) {
44template <
typename T,
int N>
constexpr vector<int, N>
asint(vector<T, N>
V) {
48template <
typename T>
constexpr int asint(T F) {
60#ifdef __HLSL_ENABLE_16_BIT
62template <
typename T,
int N>
64constexpr __detail::enable_if_t<__detail::is_same<int16_t, T>::value ||
65 __detail::is_same<uint16_t, T>::value ||
66 __detail::is_same<half, T>::value,
67 vector<int16_t, N>> asint16(vector<T, N>
V) {
74 __detail::is_same<uint16_t, T>::value ||
76 int16_t> asint16(T F) {
89template <
typename T,
int N>
constexpr vector<uint, N>
asuint(vector<T, N>
V) {
123#ifdef __HLSL_ENABLE_16_BIT
125template <
typename T,
int N>
128 __detail::is_same<uint16_t, T>::value ||
130 vector<uint16_t, N>> asuint16(vector<T, N>
V) {
136constexpr __detail::enable_if_t<__detail::is_same<int16_t, T>::value ||
137 __detail::is_same<uint16_t, T>::value ||
138 __detail::is_same<half, T>::value,
139 uint16_t> asuint16(T F) {
153#ifdef __HLSL_ENABLE_16_BIT
158 __detail::is_same<uint16_t, T>::value,
163template <
typename T,
int N>
167 __detail::is_same<uint16_t, T>::value,
181template <
typename T,
int N>
182const inline __detail::enable_if_t<__detail::is_same<int, T>::value ||
190const inline __detail::enable_if_t<__detail::is_same<int64_t, T>::value ||
197template <
typename T,
int N>
198const inline __detail::enable_if_t<__detail::is_same<int64_t, T>::value ||
242constexpr __detail::enable_if_t<__detail::is_arithmetic<T>::
Value &&
243 __detail::is_same<half, T>::value,
258constexpr vector<half, N>
mul(half x, vector<half, N> y) {
262template <
typename T,
int N>
constexpr vector<T, N>
mul(T x, vector<T, N> y) {
267template <
int R,
int C>
269constexpr matrix<half,
R,
C>
mul(half x, matrix<half,
R,
C> y) {
273template <
typename T,
int R,
int C>
274constexpr matrix<T, R, C>
mul(T x, matrix<T, R, C> y) {
281constexpr vector<half, N>
mul(vector<half, N> x, half y) {
285template <
typename T,
int N>
constexpr vector<T, N>
mul(vector<T, N> x, T y) {
292half
mul(vector<half, N> x, vector<half, N> y) {
296template <
typename T,
int N> T
mul(vector<T, N> x, vector<T, N> y) {
301template <
int R,
int C>
303constexpr matrix<half,
R,
C>
mul(matrix<half,
R,
C> x, half y) {
307template <
typename T,
int R,
int C>
308constexpr matrix<T, R, C>
mul(matrix<T, R, C> x, T y) {
#define _HLSL_BUILTIN_ALIAS(builtin)
#define _HLSL_AVAILABILITY(platform, version)
#define _HLSL_16BIT_AVAILABILITY(platform, version,...)
constexpr K firstbithigh_impl(T X)
typename enable_if< B, T >::Type enable_if_t
constexpr enable_if_t< sizeof(U)==sizeof(T), vector< U, N > > bit_cast(vector< T, N > V)
constexpr enable_if_t<!is_same< double, T >::value, T > mul_vec_impl(vector< T, N > x, vector< T, N > y)
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_mul) vector< half
unsigned int uint
An unsigned 32-bit integer.
C mul(vector< half, R >, matrix< half, R, C >)
const __detail::enable_if_t< __detail::is_same< int, T >::value||__detail::is_same< uint, T >::value, uint > firstbithigh(T X)
Returns the location of the first set bit starting from the lowest order bit and working upward,...
constexpr vector< uint, N > asuint(vector< T, N > V)
vector< double, 3 > double3
vector< double, 4 > double4
vector< double, 2 > double2
constexpr vector< int, N > asint(vector< T, N > V)
constexpr vector< float, N > asfloat(vector< T, N > V)