From ad6122a80b8a92d9e57a3c8053267e29c6a8046a Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Thu, 12 Feb 2015 19:18:56 +0000 Subject: [PATCH 1/2] Replace if statements with logical OR --- tests/spec/glsl-1.10/execution/varying-packing/simple.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/tests/spec/glsl-1.10/execution/varying-packing/simple.c b/tests/spec/glsl-1.10/execution/varying-packing/simple.c index 6d07a36..ae9ee3f 100644 --- a/tests/spec/glsl-1.10/execution/varying-packing/simple.c +++ b/tests/spec/glsl-1.10/execution/varying-packing/simple.c @@ -224,12 +224,12 @@ get_shader(bool is_vs, unsigned glsl_version, int num_varyings, if (varyings[i].type->base != BASE_TYPE_FLOAT) opt_flat_keyword = "flat "; if (varyings[i].array_elems != 0) { - text += sprintf(text, "%s%s %s var%u[%u];\n", + text += sprintf(text, "%s%s %s var%03u[%u];\n", opt_flat_keyword, varying_keyword, varyings[i].type->name, i, varyings[i].array_elems); } else { - text += sprintf(text, "%s%s %s var%u;\n", + text += sprintf(text, "%s%s %s var%03u;\n", opt_flat_keyword, varying_keyword, varyings[i].type->name, i); } @@ -253,8 +253,8 @@ get_shader(bool is_vs, unsigned glsl_version, int num_varyings, for (l = 0; l < varyings[i].type->num_rows; ++l) { text += sprintf(text, " "); if (!is_vs) - text += sprintf(text, "if ("); - text += sprintf(text, "var%u", i); + text += sprintf(text, "failed = failed || "); + text += sprintf(text, "var%03u", i); if (varyings[i].array_elems) text += sprintf(text, "[%u]", j); if (varyings[i].type->num_cols > 1) @@ -265,16 +265,9 @@ get_shader(bool is_vs, unsigned glsl_version, int num_varyings, text += sprintf(text, " = "); else text += sprintf(text, " != "); - text += sprintf(text, "%s(i + %u)", + text += sprintf(text, "%s(i + %u);\n", base_type_name, offset++); - if (is_vs) { - text += sprintf(text, ";\n"); - } else { - text += sprintf(text, - ")\n" - " failed = true;\n"); - } } } } -- 2.0.5