Jason Sams | 717e34a | 2010-03-16 15:35:57 -0700 | [diff] [blame] | 1 | |
| 2 | typedef char int8_t; |
| 3 | typedef short int16_t; |
| 4 | typedef int int32_t; |
Jason Sams | 22fa371 | 2010-05-19 17:22:57 -0700 | [diff] [blame] | 5 | typedef long long int64_t; |
Jason Sams | 717e34a | 2010-03-16 15:35:57 -0700 | [diff] [blame] | 6 | |
| 7 | typedef unsigned char uint8_t; |
| 8 | typedef unsigned short uint16_t; |
| 9 | typedef unsigned int uint32_t; |
Jason Sams | 22fa371 | 2010-05-19 17:22:57 -0700 | [diff] [blame] | 10 | typedef unsigned long long uint64_t; |
Jason Sams | 717e34a | 2010-03-16 15:35:57 -0700 | [diff] [blame] | 11 | |
| 12 | typedef uint8_t uchar; |
| 13 | typedef uint16_t ushort; |
| 14 | typedef uint32_t uint; |
Jason Sams | 22fa371 | 2010-05-19 17:22:57 -0700 | [diff] [blame] | 15 | typedef uint64_t ulong; |
Jason Sams | 717e34a | 2010-03-16 15:35:57 -0700 | [diff] [blame] | 16 | |
Shih-wei Liao | efa1760 | 2010-06-09 18:03:56 -0700 | [diff] [blame] | 17 | typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_element; |
| 18 | typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_type; |
| 19 | typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_allocation; |
| 20 | typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_sampler; |
| 21 | typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_script; |
| 22 | typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_mesh; |
| 23 | typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_program_fragment; |
| 24 | typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_program_vertex; |
| 25 | typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_program_raster; |
| 26 | typedef struct { int* p; } __attribute__((packed, aligned(4))) rs_program_store; |
Jason Sams | 717e34a | 2010-03-16 15:35:57 -0700 | [diff] [blame] | 27 | |
| 28 | typedef float float2 __attribute__((ext_vector_type(2))); |
| 29 | typedef float float3 __attribute__((ext_vector_type(3))); |
| 30 | typedef float float4 __attribute__((ext_vector_type(4))); |
Jason Sams | 717e34a | 2010-03-16 15:35:57 -0700 | [diff] [blame] | 31 | |
| 32 | typedef uchar uchar2 __attribute__((ext_vector_type(2))); |
| 33 | typedef uchar uchar3 __attribute__((ext_vector_type(3))); |
| 34 | typedef uchar uchar4 __attribute__((ext_vector_type(4))); |
Jason Sams | 717e34a | 2010-03-16 15:35:57 -0700 | [diff] [blame] | 35 | |
| 36 | typedef ushort ushort2 __attribute__((ext_vector_type(2))); |
| 37 | typedef ushort ushort3 __attribute__((ext_vector_type(3))); |
| 38 | typedef ushort ushort4 __attribute__((ext_vector_type(4))); |
Jason Sams | 717e34a | 2010-03-16 15:35:57 -0700 | [diff] [blame] | 39 | |
| 40 | typedef uint uint2 __attribute__((ext_vector_type(2))); |
| 41 | typedef uint uint3 __attribute__((ext_vector_type(3))); |
| 42 | typedef uint uint4 __attribute__((ext_vector_type(4))); |
Jason Sams | 717e34a | 2010-03-16 15:35:57 -0700 | [diff] [blame] | 43 | |
| 44 | typedef char char2 __attribute__((ext_vector_type(2))); |
| 45 | typedef char char3 __attribute__((ext_vector_type(3))); |
| 46 | typedef char char4 __attribute__((ext_vector_type(4))); |
Jason Sams | 717e34a | 2010-03-16 15:35:57 -0700 | [diff] [blame] | 47 | |
| 48 | typedef short short2 __attribute__((ext_vector_type(2))); |
| 49 | typedef short short3 __attribute__((ext_vector_type(3))); |
| 50 | typedef short short4 __attribute__((ext_vector_type(4))); |
Jason Sams | 717e34a | 2010-03-16 15:35:57 -0700 | [diff] [blame] | 51 | |
| 52 | typedef int int2 __attribute__((ext_vector_type(2))); |
| 53 | typedef int int3 __attribute__((ext_vector_type(3))); |
| 54 | typedef int int4 __attribute__((ext_vector_type(4))); |
Jason Sams | 717e34a | 2010-03-16 15:35:57 -0700 | [diff] [blame] | 55 | |
| 56 | |
Jason Sams | 22fa371 | 2010-05-19 17:22:57 -0700 | [diff] [blame] | 57 | typedef struct { |
| 58 | float m[16]; |
| 59 | } rs_matrix4x4; |
| 60 | |
Jason Sams | 7fe6bce | 2010-06-24 13:54:11 -0700 | [diff] [blame^] | 61 | typedef struct { |
| 62 | float m[9]; |
| 63 | } rs_matrix3x3; |
| 64 | |
| 65 | typedef struct { |
| 66 | float m[4]; |
| 67 | } rs_matrix2x2; |
| 68 | |
| 69 | |
Jason Sams | 97589cb | 2010-06-17 15:55:00 -0700 | [diff] [blame] | 70 | #define RS_PACKED __attribute__((packed, aligned(4))) |
| 71 | |