forked from libretro/RetroArch
-
Notifications
You must be signed in to change notification settings - Fork 2
/
shader_utils.h
94 lines (79 loc) · 1.72 KB
/
shader_utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#pragma once
#include <wiiu/gx2/shaders.h>
/* incompatible with elf builds */
/* #define GX2_CAN_ACCESS_DATA_SECTION */
#ifdef __cplusplus
extern "C" {
#endif
typedef union
__attribute__((aligned (16)))
{
struct __attribute__((scalar_storage_order ("little-endian")))
{
float x;
float y;
};
struct __attribute__((scalar_storage_order ("little-endian")))
{
float width;
float height;
};
}GX2_vec2;
typedef struct
__attribute__((aligned (16)))
__attribute__((scalar_storage_order ("little-endian")))
{
float x;
float y;
union
{
struct __attribute__((scalar_storage_order ("little-endian")))
{
float z;
float w;
};
struct __attribute__((scalar_storage_order ("little-endian")))
{
float width;
float height;
};
};
}GX2_vec4;
typedef union
{
struct
{
GX2_vec4 v0;
GX2_vec4 v1;
GX2_vec4 v2;
GX2_vec4 v3;
};
struct __attribute__((scalar_storage_order ("little-endian")))
{
float data[16];
};
}GX2_mat4x4;
typedef struct
{
GX2VertexShader vs;
GX2PixelShader ps;
GX2GeometryShader gs;
GX2FetchShader fs;
GX2AttribStream* attribute_stream;
}GX2Shader;
void GX2InitShader(GX2Shader* shader);
void GX2DestroyShader(GX2Shader* shader);
void GX2SetShader(GX2Shader* shader);
void check_shader(const void* shader_, u32 shader_size, const void* org_, u32 org_size, const char* name);
void check_shader_verbose(u32* shader, u32 shader_size, u32* org, u32 org_size, const char* name);
typedef struct
{
GX2VertexShader* vs;
GX2PixelShader* ps;
u8* data;
} GFDFile;
GFDFile* gfd_open(const char* filename);
void gfd_free(GFDFile* gfd);
#ifdef __cplusplus
}
#endif