<div dir="ltr">With the formatting fixed:<br>Reviewed-by: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com">jason.ekstrand@intel.com</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 13, 2014 at 8:59 AM, Brian Paul <span dir="ltr"><<a href="mailto:brianp@vmware.com" target="_blank">brianp@vmware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 10/08/2014 06:00 PM, <a href="mailto:sroland@vmware.com" target="_blank">sroland@vmware.com</a> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: Roland Scheidegger <<a href="mailto:sroland@vmware.com" target="_blank">sroland@vmware.com</a>><br>
<br>
Some formats had some "implied" precision which relied on the driver picking a<br>
specific hw format (e.g. RGB5 and RGB5 both relied on driver picking 565).<br>
These tests will now be skipped (for the exact test).<br>
Others didn't have any implied precision but relied on driver picking a format<br>
with at least 8 bits even though the internal format only implied 4.<br>
Also, the exact tests for srgb8 and srgb8_alpha8 were failing too due to using<br>
GL_BYTE instead of GL_UNSIGNED_BYTE.<br>
With these fixes the only tests llvmpipe is failing seem to be the exact<br>
GL_RGB8_SNORM and GL_RGB16_SNORM ones (1, 2 or 4 channels work and the errors<br>
seem to be one bit so maybe triggers some conversion somewhere using different<br>
signed conversion formula).<br>
---<br>
tests/texturing/teximage-<u></u>colors.c | 43 ++++++++++++++++++++++++++++++<u></u>++++-----<br>
1 file changed, 38 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/tests/texturing/teximage-<u></u>colors.c b/tests/texturing/teximage-<u></u>colors.c<br>
index 2bee02f..dcbab65 100644<br>
--- a/tests/texturing/teximage-<u></u>colors.c<br>
+++ b/tests/texturing/teximage-<u></u>colors.c<br>
@@ -60,12 +60,12 @@ struct texture_format formats[] = {<br>
<br>
FORMAT(GL_RGB, GL_RGB, GL_NONE),<br>
FORMAT(GL_R3_G3_B2, GL_RGB, GL_UNSIGNED_BYTE_3_3_2),<br>
- FORMAT(GL_RGB4, GL_RGB, GL_UNSIGNED_SHORT_5_6_5),<br>
- FORMAT(GL_RGB5, GL_RGB, GL_UNSIGNED_SHORT_5_6_5),<br>
+ FORMAT(GL_RGB4, GL_RGB, GL_NONE),<br>
+ FORMAT(GL_RGB5, GL_RGB, GL_NONE),<br>
FORMAT(GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE),<br>
FORMAT(GL_RGB8_SNORM, GL_RGB, GL_BYTE),<br>
- FORMAT(GL_SRGB8, GL_RGB, GL_BYTE),<br>
- FORMAT(GL_RGB10, GL_RGB, GL_UNSIGNED_SHORT),<br>
+ FORMAT(GL_SRGB8, GL_RGB, GL_UNSIGNED_BYTE),<br>
+ FORMAT(GL_RGB10, GL_RGB, GL_NONE),<br>
FORMAT(GL_R11F_G11F_B10F, GL_RGB, GL_NONE),<br>
FORMAT(GL_RGB12, GL_RGB, GL_NONE),<br>
FORMAT(GL_RGB9_E5, GL_RGB, GL_NONE),<br>
@@ -81,7 +81,7 @@ struct texture_format formats[] = {<br>
FORMAT(GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE),<br>
FORMAT(GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_10_10_10_2),<br>
FORMAT(GL_RGBA8_SNORM, GL_RGBA, GL_BYTE),<br>
- FORMAT(GL_SRGB8_ALPHA8, GL_RGBA, GL_BYTE),<br>
+ FORMAT(GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE),<br>
FORMAT(GL_RGBA12, GL_RGBA, GL_NONE),<br>
FORMAT(GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT),<br>
FORMAT(GL_RGBA16_SNORM, GL_RGBA, GL_SHORT),<br>
@@ -543,6 +543,39 @@ piglit_init(int argc, char **argv)<br>
tolerance[3] = 0.3;<br>
break;<br>
}<br>
+<br>
+ /* The tolerance lowering above only works for formats which have<br>
+ explicit data types associated with them and even then it's fishy<br>
+ for some.<br>
+ The default sort of assumes at least 7 bits which doesn't make<br>
+ much sense in any case (for the specific formats with more bits).<br>
+ But just fix the cases which cannot pass (unless the driver encodes<br>
+ them with more bits). */<br>
</blockquote>
<br></div></div>
The comment is indented with a mix of spaces and tabs. For block comments, we usually prefix each line with '*'.<span class=""><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ switch (format->internal_format) {<br>
+ case GL_RGB4:<br>
+ tolerance[0] = 0.1;<br>
+ tolerance[1] = 0.1;<br>
+ tolerance[2] = 0.1;<br>
+ tolerance[3] = 0.1;<br>
+ break;<br>
+ case GL_RGB5:<br>
+ tolerance[0] = 0.05;<br>
+ tolerance[1] = 0.05;<br>
+ tolerance[2] = 0.05;<br>
+ break;<br>
+ case GL_LUMINANCE4_ALPHA4:<br>
+ tolerance[0] = 0.1;<br>
+ tolerance[1] = 0.1;<br>
+ tolerance[2] = 0.1;<br>
+ tolerance[3] = 0.1;<br>
+ break;<br>
+ case GL_LUMINANCE6_ALPHA2: /* broken but everybody uses 8+8 bits */<br>
+ case GL_LUMINANCE4: /* broken but presumably noone uses just 4 bits */<br>
+ case GL_ALPHA4: /* broken but presumably noone uses just 4 bits */<br>
+ case GL_RGBA2: /* broken (4444) but everybody uses more bits anyway */<br>
</blockquote>
<br></span>
Need some tab indents there too.<span class=""><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ default:<br>
+ break;<br>
+ }<br>
}<br>
<br>
void<br>
<br>
</blockquote>
<br></span>
Looks OK otherwise.<br>
Reviewed-by: Brian Paul <<a href="mailto:brianp@vmware.com" target="_blank">brianp@vmware.com</a>><br>
<br>
</blockquote></div><br></div>