<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 25, 2014 at 10:59 AM, Neil Roberts <span dir="ltr"><<a href="mailto:neil@linux.intel.com" target="_blank">neil@linux.intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
I've been looking into this bug a bit more. I don't think disabling the<br>
blorp path on Sandybridge is the right thing to do. The only notable<br>
difference between the blorp code path and the meta code path seems to<br>
be that the blorp code forces the use of non-normalized coordinates<br>
whereas the meta code path doesn't. It looks like the linear filtering<br>
on Sandybridge is not very precise and switching to non-normalized<br>
coordinates is enough to tip it over the balance and make the test fail.<br>
<br>
You can also make the meta code path fail if you change the test to use<br>
a rectangle texture instead of a 2D texture. That will make it also use<br>
non-normalized coordinates. Therefore I think the meta path isn't really<br>
any better than the blorp path and the problem is with the sampler. I've<br>
made a patch for piglit to demonstrate using rectangle textures here:<br>
<br>
<a href="https://github.com/bpeel/piglit/commit/69d431af43825ea184e224c9dec7fca6" target="_blank">https://github.com/bpeel/piglit/commit/69d431af43825ea184e224c9dec7fca6</a><br>
<br>
I made a little test program to demonstrate the results of the linear<br>
filtering here:<br>
<br>
<a href="https://github.com/bpeel/glthing/blob/wip/simple-longblit/src/main.c" target="_blank">https://github.com/bpeel/glthing/blob/wip/simple-longblit/src/main.c</a><br>
<br>
This creates a 2x1 rectangle texture with a black pixel on the left and<br>
a red pixel on the right. It then renders this using a triangle strip<br>
into a 256x1 texture where the texture coordinates are set up such that<br>
the center of the first pixel in the destination samples the center of<br>
the left pixel in the source and the center of the rightmost pixel<br>
samples the center of the right pixel. Linear interpolation is used so<br>
that if the rendering is working preciesly the red channel of the result<br>
should have exactly the values from 0 to 255.<br>
<br>
On Haswell, this gives the values you would expect from 0 to 255.<br>
However on Sandybridge I get the following result:<br></blockquote><div>Good analysis Neil. I get perfect output on IVB too using RECT and</div><div>2D textures.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
00 00* 00* 00* 04 04* 04* 04* 08 08* 08* 08* 0c 0c* 0c* 0c*<br>
10 10* 10* 10* 14 14* 14* 14* 18 18* 18* 18* 1c 1c* 1c* 1c*<br>
20 20* 20* 20* 24 24* 24* 24* 28 28* 28* 28* 2c 2c* 2c* 2c*<br>
30 30* 30* 30* 34 34* 34* 34* 38 38* 38* 38* 3c 3c* 3c* 3c*<br>
40 40* 40* 40* 44 44* 44* 44* 48 48* 48* 48* 4c 4c* 4c* 4c*<br>
50 50* 50* 50* 54 54* 54* 54* 58 58* 58* 58* 5c 5c* 5c* 5c*<br>
60 60* 60* 60* 64 64* 64* 64* 68 68* 68* 68* 6c 6c* 6c* 6c*<br>
70 70* 70* 70* 74 74* 74* 74* 78 78* 78* 78* 7c 7c* 7c* 7c*<br>
80 80* 80* 80* 83* 83* 83* 83* 87* 87* 87* 87* 8b* 8b* 8b* 8b*<br>
8f* 8f* 8f* 8f* 93* 93* 93* 93* 97* 97* 97* 97* 9b* 9b* 9b* 9b*<br>
9f* 9f* 9f* 9f* a3* a3* a3* a3* a7* a7* a7* a7* ab* ab* ab* ab*<br>
af* af* af* af* b3* b3* b3* b3* b7* b7* b7* b7* bb* bb* bb* bb*<br>
bf* bf* bf* bf* c3* c3* c3* c3* c7* c7* c7* c7* cb* cb* cb* cb*<br>
cf* cf* cf* cf* d3* d3* d3* d3* d7* d7* d7* d7* db* db* db* db*<br>
df* df* df* df* e3* e3* e3* e3* e7* e7* e7* e7* eb* eb* eb* eb*<br>
ef* ef* ef* ef* f3* f3* f3* f3* f7* f7* f7* f7* fb* fb* fb* fb*<br>
Maximum diff = 4 (1.568627%)<br>
<br>
(The asterisk marks when the value is not correct)<br>
<br>
With a 2D texture this gives:<br>
<br>
00 00* 04* 04* 04 04* 08* 08* 08 08* 0c* 0c* 0c 0c* 10* 10*<br>
10 10* 14* 14* 14 14* 18* 18* 18 18* 1c* 1c* 1c 1c* 20* 20*<br>
20 20* 24* 24* 24 24* 28* 28* 28 28* 2c* 2c* 2c 2c* 30* 30*<br>
30 30* 34* 34* 34 34* 38* 38* 38 38* 3c* 3c* 3c 3c* 40* 40*<br>
40 40* 44* 44* 44 44* 48* 48* 48 48* 4c* 4c* 4c 4c* 50* 50*<br>
50 50* 54* 54* 54 54* 58* 58* 58 58* 5c* 5c* 5c 5c* 60* 60*<br>
60 60* 64* 64* 64 64* 68* 68* 68 68* 6c* 6c* 6c 6c* 70* 70*<br>
70 70* 74* 74* 74 74* 78* 78* 78 78* 7c* 7c* 7c 7c* 80* 80*<br>
80 80* 83* 83 83* 83* 87* 87 87* 87* 8b* 8b 8b* 8b* 8f* 8f<br>
8f* 8f* 93* 93 93* 93* 97* 97 97* 97* 9b* 9b 9b* 9b* 9f* 9f<br>
9f* 9f* a3* a3 a3* a3* a7* a7 a7* a7* ab* ab ab* ab* af* af<br>
af* af* b3* b3 b3* b3* b7* b7 b7* b7* bb* bb bb* bb* bf* bf<br>
bf* bf* c3* c3 c3* c3* c7* c7 c7* c7* cb* cb cb* cb* cf* cf<br>
cf* cf* d3* d3 d3* d3* d7* d7 d7* d7* db* db db* db* df* df<br>
df* df* e3* e3 e3* e3* e7* e7 e7* e7* eb* eb eb* eb* ef* ef<br>
ef* ef* f3* f3 f3* f3* f7* f7 f7* f7* fb* fb fb* fb* ff* ff<br>
Maximum diff = 2 (0.784314%)<br>
<br>
Piglit effectively has a default tolerance of 1% so the 2D texture<br>
version would pass. However the results are still clumped together in<br>
fours and they are just offset slightly. It doesn't look like it's<br>
actually any better.<br>
<br>
Is this amount of imprecision something that we should expect on<br>
Sandybridge? If so perhaps we should increase the tolerance level in the<br>
test.<br></blockquote><div> Increasing the tolerance will hide any imprecision issues in other platforms. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span><font color="#888888"><br>
- Neil<br>
</font></span></blockquote></div><br></div></div>