On 30 July 2012 10:40, Eric Anholt <span dir="ltr"><<a href="mailto:eric@anholt.net" target="_blank">eric@anholt.net</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>> writes:<br>
> +     "  for (uint i = 2u; i < number_to_classify; ++i) {\n"<br>
> +     "    if (number_to_classify % i == 0u)\n"<br>
> +     "      factor_found = true;\n"<br>
> +     "  }\n"<br>
<br>
</div>not breaking out of the loop if you find a factor :)<br></blockquote><div><br>You're right of course, if the goal was to create a fast primality test.  But the goal is to make a shader that can be made very slow or very fast depending on the size of its input parameter.  Breaking out of the loop when I found a factor would defeat the purpose :)<br>
 </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im"><br>
> +enum piglit_result<br>
> +piglit_display(void)<br>
> +{<br>
> +     enum piglit_result result = PIGLIT_PASS;<br>
> +     unsigned size;<br>
<br>
</div>needs<br>
<br>
        piglit_require_glsl_version(130);<br>
<br>
I think.<br></blockquote><div><br>Oh, yeah.  Oops.<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im"><br>
> +<br>
> +     glUseProgram(prog);<br>
> +     glClear(GL_COLOR_BUFFER_BIT);<br>
<br>
</div>Other than the require_version,<br>
<br>
Reviewed-by: Eric Anholt <<a href="mailto:eric@anholt.net">eric@anholt.net</a>><br>
</blockquote></div><br>