<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 2, 2016 at 11:34 AM, Anuj Phogat <span dir="ltr"><<a href="mailto:anuj.phogat@gmail.com" target="_blank">anuj.phogat@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Piglit test ext_framebuffer_multisample_blit_scaled-blit-scaled<br>
(with added 16x sample support) now passes with this patch.<br>
<br>
Signed-off-by: Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a>><br>
Cc: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br>
Cc: "12.0" <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a>><br></blockquote><div><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br><br></div><div>Thanks for fixing my mess!<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 17 ++++++++++-------<br>
1 file changed, 10 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp<br>
index 1b8e112..782d285 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp<br>
@@ -1106,9 +1106,9 @@ blorp_nir_manual_blend_bilinear(nir_builder *b, nir_ssa_def *pos,<br>
* In the case of 16x MSAA the two layouts don't match.<br>
* Sample index layout: Sample number layout:<br>
* --------------------- ---------------------<br>
- * | 0 | 1 | 2 | 3 | | 15 | 10 | 9 | 13 |<br>
+ * | 0 | 1 | 2 | 3 | | 15 | 10 | 9 | 7 |<br>
* --------------------- ---------------------<br>
- * | 4 | 5 | 6 | 7 | | 4 | 1 | 7 | 3 |<br>
+ * | 4 | 5 | 6 | 7 | | 4 | 1 | 3 | 13 |<br>
* --------------------- ---------------------<br>
* | 8 | 9 | 10 | 11 | | 12 | 2 | 0 | 6 |<br>
* --------------------- ---------------------<br>
@@ -1116,7 +1116,7 @@ blorp_nir_manual_blend_bilinear(nir_builder *b, nir_ssa_def *pos,<br>
* --------------------- ---------------------<br>
*<br>
* This is equivalent to<br>
- * S' = (0xfa9d4173c206b85e >> (S * 4)) & 0xf<br>
+ * S' = (0xe58b602cd31479af >> (S * 4)) & 0xf<br>
*/<br>
nir_ssa_def *frac = nir_ffract(b, sample_coords);<br>
nir_ssa_def *sample =<br>
@@ -1130,11 +1130,11 @@ blorp_nir_manual_blend_bilinear(nir_builder *b, nir_ssa_def *pos,<br>
nir_imm_int(b, 0xf));<br>
} else if (tex_samples == 16) {<br>
nir_ssa_def *sample_low =<br>
- nir_iand(b, nir_ishr(b, nir_imm_int(b, 0xc206b85e),<br>
+ nir_iand(b, nir_ishr(b, nir_imm_int(b, 0xd31479af),<br>
nir_ishl(b, sample, nir_imm_int(b, 2))),<br>
nir_imm_int(b, 0xf));<br>
nir_ssa_def *sample_high =<br>
- nir_iand(b, nir_ishr(b, nir_imm_int(b, 0xfa9d4173),<br>
+ nir_iand(b, nir_ishr(b, nir_imm_int(b, 0xe58b602c),<br>
nir_ishl(b, nir_iadd(b, sample,<br>
nir_imm_int(b, -8)),<br>
nir_imm_int(b, 2))),<br>
@@ -1761,8 +1761,11 @@ brw_blorp_blit_miptrees(struct brw_context *brw,<br>
/* Scaling factors used for bilinear filtering in multisample scaled<br>
* blits.<br>
*/<br>
- wm_prog_key.x_scale = 2.0f;<br>
- wm_prog_key.y_scale = src_mt->num_samples / 2.0f;<br>
+ if (src_mt->num_samples == 16)<br>
+ wm_prog_key.x_scale = 4.0f;<br>
+ else<br>
+ wm_prog_key.x_scale = 2.0f;<br>
+ wm_prog_key.y_scale = src_mt->num_samples / wm_prog_key.x_scale;<br>
<br>
if (filter == GL_LINEAR &&<br>
params.src.num_samples <= 1 && params.dst.num_samples <= 1)<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.5.5<br>
<br>
</font></span></blockquote></div><br></div></div>