File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,38 @@ in vec3 position;
200200void main() {
201201 gl_Position = modelMatrix * viewMatrices[gl_ViewID_OVR] * vec4(position, 1.);
202202}
203+ "#
204+ )
205+ }
206+
207+ #[ test]
208+ #[ ignore]
209+ fn test_patch_glsl_source_elif_expand ( ) {
210+ let source_str = r#"
211+ #version 300 es
212+ #define CS1
213+ #define CS2
214+ #define CS3
215+
216+ vec3 test() {
217+ #if defined(CS1)
218+ return vec3(1.0, 0.0, 0.0);
219+ #elif defined(CS2)
220+ return vec3(2.0, 0.0, 0.0);
221+ #elif defined(CS3)
222+ return vec3(3.0, 1.0, 0.0);
223+ #else
224+ return vec3(0.0, 0.0, 1.0);
225+ #endif
226+ }
227+ "# ;
228+ let patched_source_str = patch_glsl_source_from_str ( source_str) ;
229+ assert_eq ! (
230+ patched_source_str,
231+ r#"#version 300 es
232+ vec3 test() {
233+ return vec3(1., 0., 0.);
234+ }
203235"#
204236 )
205237 }
You can’t perform that action at this time.
0 commit comments