rs_types.rsh revision ed2ea272afbab08d0b5d882202c8eb19a5233481
1#ifndef __RS_TYPES_RSH__
2#define __RS_TYPES_RSH__
3
4#define M_PI        3.14159265358979323846264338327950288f   /* pi */
5
6#include "stdbool.h"
7typedef char int8_t;
8typedef short int16_t;
9typedef int int32_t;
10typedef long long int64_t;
11
12typedef unsigned char uint8_t;
13typedef unsigned short uint16_t;
14typedef unsigned int uint32_t;
15typedef unsigned long long uint64_t;
16
17typedef uint8_t uchar;
18typedef uint16_t ushort;
19typedef uint32_t uint;
20typedef uint64_t ulong;
21
22typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_element;
23typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_type;
24typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_allocation;
25typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_sampler;
26typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_script;
27typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_mesh;
28typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_program_fragment;
29typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_program_vertex;
30typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_program_raster;
31typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_program_store;
32typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_font;
33
34
35typedef float float2 __attribute__((ext_vector_type(2)));
36typedef float float3 __attribute__((ext_vector_type(3)));
37typedef float float4 __attribute__((ext_vector_type(4)));
38
39typedef uchar uchar2 __attribute__((ext_vector_type(2)));
40typedef uchar uchar3 __attribute__((ext_vector_type(3)));
41typedef uchar uchar4 __attribute__((ext_vector_type(4)));
42
43typedef ushort ushort2 __attribute__((ext_vector_type(2)));
44typedef ushort ushort3 __attribute__((ext_vector_type(3)));
45typedef ushort ushort4 __attribute__((ext_vector_type(4)));
46
47typedef uint uint2 __attribute__((ext_vector_type(2)));
48typedef uint uint3 __attribute__((ext_vector_type(3)));
49typedef uint uint4 __attribute__((ext_vector_type(4)));
50
51typedef char char2 __attribute__((ext_vector_type(2)));
52typedef char char3 __attribute__((ext_vector_type(3)));
53typedef char char4 __attribute__((ext_vector_type(4)));
54
55typedef short short2 __attribute__((ext_vector_type(2)));
56typedef short short3 __attribute__((ext_vector_type(3)));
57typedef short short4 __attribute__((ext_vector_type(4)));
58
59typedef int int2 __attribute__((ext_vector_type(2)));
60typedef int int3 __attribute__((ext_vector_type(3)));
61typedef int int4 __attribute__((ext_vector_type(4)));
62
63
64typedef struct {
65    float m[16];
66} rs_matrix4x4;
67
68typedef struct {
69    float m[9];
70} rs_matrix3x3;
71
72typedef struct {
73    float m[4];
74} rs_matrix2x2;
75
76typedef float4 rs_quaternion;
77
78#define RS_PACKED __attribute__((packed, aligned(4)))
79
80#endif
81