clang  15.0.0git
hlsl_basic_types.h
Go to the documentation of this file.
1 //===----- hlsl_basic_types.h - HLSL definitions for basic types ----------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef _HLSL_HLSL_BASIC_TYPES_H_
10 #define _HLSL_HLSL_BASIC_TYPES_H_
11 
12 // built-in scalar data types:
13 
14 #ifdef __HLSL_ENABLE_16_BIT
15 // 16-bit integer.
16 typedef unsigned short uint16_t;
17 typedef short int16_t;
18 #endif
19 
20 // unsigned 32-bit integer.
21 typedef unsigned int uint;
22 
23 // 64-bit integer.
24 typedef unsigned long uint64_t;
25 typedef long int64_t;
26 
27 // built-in vector data types:
28 
29 #ifdef __HLSL_ENABLE_16_BIT
30 typedef vector<int16_t, 2> int16_t2;
31 typedef vector<int16_t, 3> int16_t3;
32 typedef vector<int16_t, 4> int16_t4;
33 typedef vector<uint16_t, 2> uint16_t2;
34 typedef vector<uint16_t, 3> uint16_t3;
35 typedef vector<uint16_t, 4> uint16_t4;
36 #endif
37 
38 typedef vector<int, 2> int2;
39 typedef vector<int, 3> int3;
40 typedef vector<int, 4> int4;
41 typedef vector<uint, 2> uint2;
42 typedef vector<uint, 3> uint3;
43 typedef vector<uint, 4> uint4;
44 typedef vector<int64_t, 2> int64_t2;
45 typedef vector<int64_t, 3> int64_t3;
46 typedef vector<int64_t, 4> int64_t4;
47 typedef vector<uint64_t, 2> uint64_t2;
48 typedef vector<uint64_t, 3> uint64_t3;
49 typedef vector<uint64_t, 4> uint64_t4;
50 
51 #ifdef __HLSL_ENABLE_16_BIT
52 typedef vector<half, 2> half2;
53 typedef vector<half, 3> half3;
54 typedef vector<half, 4> half4;
55 #endif
56 
57 typedef vector<float, 2> float2;
58 typedef vector<float, 3> float3;
59 typedef vector<float, 4> float4;
60 typedef vector<double, 2> double2;
61 typedef vector<double, 3> double3;
62 typedef vector<double, 4> double4;
63 
64 #endif //_HLSL_HLSL_BASIC_TYPES_H_
uint64_t3
vector< uint64_t, 3 > uint64_t3
Definition: hlsl_basic_types.h:48
double4
vector< double, 4 > double4
Definition: hlsl_basic_types.h:62
uint
unsigned int uint
Definition: hlsl_basic_types.h:21
int64_t2
vector< int64_t, 2 > int64_t2
Definition: hlsl_basic_types.h:44
uint4
vector< uint, 4 > uint4
Definition: hlsl_basic_types.h:43
int4
vector< int, 4 > int4
Definition: hlsl_basic_types.h:40
uint2
vector< uint, 2 > uint2
Definition: hlsl_basic_types.h:41
uint64_t
unsigned long uint64_t
Definition: hlsl_basic_types.h:24
int3
vector< int, 3 > int3
Definition: hlsl_basic_types.h:39
float4
vector< float, 4 > float4
Definition: hlsl_basic_types.h:59
float3
vector< float, 3 > float3
Definition: hlsl_basic_types.h:58
int64_t3
vector< int64_t, 3 > int64_t3
Definition: hlsl_basic_types.h:45
double2
vector< double, 2 > double2
Definition: hlsl_basic_types.h:60
double3
vector< double, 3 > double3
Definition: hlsl_basic_types.h:61
int2
vector< int, 2 > int2
Definition: hlsl_basic_types.h:38
uint3
vector< uint, 3 > uint3
Definition: hlsl_basic_types.h:42
uint64_t4
vector< uint64_t, 4 > uint64_t4
Definition: hlsl_basic_types.h:49
int64_t
long int64_t
Definition: hlsl_basic_types.h:25
int64_t4
vector< int64_t, 4 > int64_t4
Definition: hlsl_basic_types.h:46
float2
vector< float, 2 > float2
Definition: hlsl_basic_types.h:57
uint64_t2
vector< uint64_t, 2 > uint64_t2
Definition: hlsl_basic_types.h:47