From: Brian Date: Sat, 29 Sep 2007 16:44:05 +0000 (-0600) Subject: hack in some code to test loops, break X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2727cfddbf64add52181bed999938a90811f01a3;p=mesa.git hack in some code to test loops, break --- diff --git a/progs/demos/arbfslight.c b/progs/demos/arbfslight.c index 39c9226b3d9..d6363eafeb2 100644 --- a/progs/demos/arbfslight.c +++ b/progs/demos/arbfslight.c @@ -210,7 +210,7 @@ static void Init (void) " // Compute diffuse and specular contributions\n" #if 0 " gl_FragColor = diffuse * dotProd + specular * pow (dotProd, 20.0);\n" -#else +#elif 1 /* test IF/ELSE/ENDIF */ " if (normal.y > 0.0) { \n" " gl_FragColor = diffuse * dotProd + specular * pow (dotProd, 20.0);\n" " } \n" @@ -222,6 +222,16 @@ static void Init (void) " gl_FragColor = vec4(1, 1, 0, 0); \n" " } \n" " } \n" +#elif 1 /* test LOOP */ + " while (1) { \n" + " if (normal.y >= 0.0) { \n" + " gl_FragColor = vec4(1, 0, 0, 0); \n" + " break; \n" + " } else { \n" + " gl_FragColor = diffuse * dotProd + specular * pow (dotProd, 20.0);\n" + " break; \n" + " } \n" + " } \n" #endif "}\n" ;