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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
/* automatically generated by rust-bindgen */
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct glslopt_shader {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct glslopt_ctx {
_unused: [u8; 0],
}
pub const glslopt_shader_type_kGlslOptShaderVertex: glslopt_shader_type = 0;
pub const glslopt_shader_type_kGlslOptShaderFragment: glslopt_shader_type = 1;
pub type glslopt_shader_type = u32;
pub const glslopt_options_kGlslOptionSkipPreprocessor: glslopt_options = 1;
pub const glslopt_options_kGlslOptionNotFullShader: glslopt_options = 2;
pub type glslopt_options = u32;
pub const glslopt_target_kGlslTargetOpenGL: glslopt_target = 0;
pub const glslopt_target_kGlslTargetOpenGLES20: glslopt_target = 1;
pub const glslopt_target_kGlslTargetOpenGLES30: glslopt_target = 2;
pub const glslopt_target_kGlslTargetMetal: glslopt_target = 3;
pub type glslopt_target = u32;
pub const glslopt_basic_type_kGlslTypeFloat: glslopt_basic_type = 0;
pub const glslopt_basic_type_kGlslTypeInt: glslopt_basic_type = 1;
pub const glslopt_basic_type_kGlslTypeBool: glslopt_basic_type = 2;
pub const glslopt_basic_type_kGlslTypeTex2D: glslopt_basic_type = 3;
pub const glslopt_basic_type_kGlslTypeTex3D: glslopt_basic_type = 4;
pub const glslopt_basic_type_kGlslTypeTexCube: glslopt_basic_type = 5;
pub const glslopt_basic_type_kGlslTypeTex2DShadow: glslopt_basic_type = 6;
pub const glslopt_basic_type_kGlslTypeTex2DArray: glslopt_basic_type = 7;
pub const glslopt_basic_type_kGlslTypeOther: glslopt_basic_type = 8;
pub const glslopt_basic_type_kGlslTypeCount: glslopt_basic_type = 9;
pub type glslopt_basic_type = u32;
pub const glslopt_precision_kGlslPrecHigh: glslopt_precision = 0;
pub const glslopt_precision_kGlslPrecMedium: glslopt_precision = 1;
pub const glslopt_precision_kGlslPrecLow: glslopt_precision = 2;
pub const glslopt_precision_kGlslPrecCount: glslopt_precision = 3;
pub type glslopt_precision = u32;
extern "C" {
pub fn glslopt_initialize(target: glslopt_target) -> *mut glslopt_ctx;
}
extern "C" {
pub fn glslopt_cleanup(ctx: *mut glslopt_ctx);
}
extern "C" {
pub fn glslopt_set_max_unroll_iterations(
ctx: *mut glslopt_ctx,
iterations: ::std::os::raw::c_uint,
);
}
extern "C" {
pub fn glslopt_optimize(
ctx: *mut glslopt_ctx,
type_: glslopt_shader_type,
shaderSource: *const ::std::os::raw::c_char,
options: ::std::os::raw::c_uint,
) -> *mut glslopt_shader;
}
extern "C" {
pub fn glslopt_get_status(shader: *mut glslopt_shader) -> bool;
}
extern "C" {
pub fn glslopt_get_output(shader: *mut glslopt_shader) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn glslopt_get_raw_output(shader: *mut glslopt_shader) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn glslopt_get_log(shader: *mut glslopt_shader) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn glslopt_shader_delete(shader: *mut glslopt_shader);
}
extern "C" {
pub fn glslopt_shader_get_input_count(shader: *mut glslopt_shader) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn glslopt_shader_get_input_desc(
shader: *mut glslopt_shader,
index: ::std::os::raw::c_int,
outName: *mut *const ::std::os::raw::c_char,
outType: *mut glslopt_basic_type,
outPrec: *mut glslopt_precision,
outVecSize: *mut ::std::os::raw::c_int,
outMatSize: *mut ::std::os::raw::c_int,
outArraySize: *mut ::std::os::raw::c_int,
outLocation: *mut ::std::os::raw::c_int,
);
}
extern "C" {
pub fn glslopt_shader_get_uniform_count(shader: *mut glslopt_shader) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn glslopt_shader_get_uniform_total_size(
shader: *mut glslopt_shader,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn glslopt_shader_get_uniform_desc(
shader: *mut glslopt_shader,
index: ::std::os::raw::c_int,
outName: *mut *const ::std::os::raw::c_char,
outType: *mut glslopt_basic_type,
outPrec: *mut glslopt_precision,
outVecSize: *mut ::std::os::raw::c_int,
outMatSize: *mut ::std::os::raw::c_int,
outArraySize: *mut ::std::os::raw::c_int,
outLocation: *mut ::std::os::raw::c_int,
);
}
extern "C" {
pub fn glslopt_shader_get_texture_count(shader: *mut glslopt_shader) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn glslopt_shader_get_texture_desc(
shader: *mut glslopt_shader,
index: ::std::os::raw::c_int,
outName: *mut *const ::std::os::raw::c_char,
outType: *mut glslopt_basic_type,
outPrec: *mut glslopt_precision,
outVecSize: *mut ::std::os::raw::c_int,
outMatSize: *mut ::std::os::raw::c_int,
outArraySize: *mut ::std::os::raw::c_int,
outLocation: *mut ::std::os::raw::c_int,
);
}
extern "C" {
pub fn glslopt_shader_get_stats(
shader: *mut glslopt_shader,
approxMath: *mut ::std::os::raw::c_int,
approxTex: *mut ::std::os::raw::c_int,
approxFlow: *mut ::std::os::raw::c_int,
);
}
|