<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">n Fri, Jul 11, 2014 at 1:06 PM, Ilia Mirkin <span dir="ltr"><<a href="mailto:imirkin@alum.mit.edu" target="_blank">imirkin@alum.mit.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Kinda like <a href="http://patchwork.freedesktop.org/patch/17718/" target="_blank">http://patchwork.freedesktop.org/patch/17718/</a> ? :) </blockquote>
<div><br></div><div>Yeah, kinda like that :-).  Only my patch solves it a little more for-sure<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The<br>

feedback I got (although not apparently in e-mail) was that it was<br>
shady. OTOH, the test doesn't do what it claims to due to the CSE that<br>
now happens, so perhaps it should just get deleted.<br></blockquote><div><br></div><div>If it's not doing anything, then let's get rid of it.  In any case, I won't care about it failing.<br></div><div>--Jason<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5"><br>
On Fri, Jul 11, 2014 at 4:01 PM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> The only reason this test passed before is because we were rounding wrong<br>
> in texture upload.  Previously, the shader started with 0.01, effectively<br>
> multiplied it by 34, and then compared it to 0.4.  The problem is that,<br>
> when converting from float to unsigned byte, you get 0.01 * 255 = 2.55.<br>
> Previously, we were rounding this up to 3.  Then 3 * 34 = 102 and<br>
> 102 / 255 = 0.4.  However, the OpenGL spec specifies that you should simply<br>
> cast the floating point value to the integer value and this rounds down to<br>
> 2.  The result is that you get 2 * 34 = 68 and 68 / 255 = 2.667 which is<br>
> nowhere close to 0.4.<br>
><br>
> The new version simply starts with 0.4 and then divides by 4 at the end of<br>
> the shader to get back to 0.4.<br>
><br>
> Signed-off-by: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com">jason.ekstrand@intel.com</a>><br>
> ---<br>
>  tests/shaders/glsl-fs-lots-of-tex.shader_test | 5 +++--<br>
>  1 file changed, 3 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/tests/shaders/glsl-fs-lots-of-tex.shader_test b/tests/shaders/glsl-fs-lots-of-tex.shader_test<br>
> index a31778f..9056774 100644<br>
> --- a/tests/shaders/glsl-fs-lots-of-tex.shader_test<br>
> +++ b/tests/shaders/glsl-fs-lots-of-tex.shader_test<br>
> @@ -34,12 +34,13 @@ void main()<br>
>         vec4 p = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);<br>
>         vec4 q = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);<br>
><br>
> -       gl_FragColor = a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + q;<br>
> +       vec4 sum = a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + q;<br>
> +       gl_FragColor = sum / 34.0f;<br>
>  }<br>
><br>
>  [test]<br>
>  uniform int tex 0<br>
>  uniform vec4 cst 0.0 0.0 0.0 0.0<br>
> -texture checkerboard 0 0 (8, 8) (0.01, 0.0, 0.0, 0.0) (0.01, 0.0, 0.0, 0.0)<br>
> +texture checkerboard 0 0 (8, 8) (0.4, 0.0, 0.0, 0.0) (0.4, 0.0, 0.0, 0.0)<br>
>  draw rect -1 -1 2 2<br>
>  relative probe rgb (0.75, 0.75) (0.4, 0.0, 0.0)<br>
> --<br>
> 2.0.0<br>
><br>
</div></div>> _______________________________________________<br>
> Piglit mailing list<br>
> <a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/piglit" target="_blank">http://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</blockquote></div><br></div></div>