From be43ab8218aa91591465b03be3cb7decb900d3f5 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Sun, 31 Jan 2016 14:29:53 +0100 Subject: [PATCH] Slightly change example --- shader-parser/examples/example.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/shader-parser/examples/example.rs b/shader-parser/examples/example.rs index 5d8a6c46..dd86e6a8 100644 --- a/shader-parser/examples/example.rs +++ b/shader-parser/examples/example.rs @@ -5,13 +5,23 @@ fn main() { let shader = r#" #version 450 +struct S { + vec3 val1; + bool val2[5]; +}; + uniform sampler2D u_texture; +uniform S u_data; in vec2 v_texcoords; out vec4 f_color; void main() { - f_color = texture(u_texture, v_texcoords); + if (u_data.val2[4]) { + f_color = texture(u_texture, v_texcoords); + } else { + f_color = vec4(u_data.val1, 1.0); + } } "#;