<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 22, 2015 at 4:18 PM, Ben Widawsky <span dir="ltr"><<a href="mailto:ben@bwidawsk.net" target="_blank">ben@bwidawsk.net</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"><span class="">On Thu, Sep 17, 2015 at 05:00:11PM +0100, Neil Roberts wrote:<br>
> In order to accomodate 16x MSAA, the starting sample pair index is now<br>
> 3 bits rather than 2 on SKL+.<br>
<br>
</span>Hooray for bad docs. "PS Thread Payload for Normal Dispatch": SSPI is 2 bits<br>
(R0.0.7:6) with 1 reserved for expansion.<br>
<span class=""><br>
> ---<br>
> src/mesa/drivers/dri/i965/brw_fs.cpp | 9 ++++++++-<br>
> 1 file changed, 8 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
> index 82f49b4..bd9bcdd 100644<br>
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
> @@ -1300,9 +1300,16 @@ fs_visitor::emit_sampleid_setup()<br>
> * are sample 1 of subspan 0; the third group is sample 0 of<br>
> * subspan 1, and finally sample 1 of subspan 1.<br>
> */<br>
> +<br>
> + /* SKL+ has an extra bit for the Starting Sample Pair Index to<br>
> + * accomodate 16x MSAA.<br>
> + */<br>
> + unsigned sspi_bits = devinfo->gen >= 9 ? 3 : 2;<br>
> + unsigned sspi_mask = ((1 << sspi_bits) - 1) << 6;<br>
> +<br>
<br>
</span>I think using the bits makes this unnecessarily hard to read.<br>
unsigned sspi_mask = devinfo->gen >= 9 ? 0x1c0 : 0xc0;<br>
<span class=""><br>
> abld.exec_all()<br>
> .AND(t1, fs_reg(retype(brw_vec1_grf(0, 0), BRW_REGISTER_TYPE_UD)),<br>
> - fs_reg(0xc0));<br>
> + fs_reg(sspi_mask));<br>
> abld.exec_all().SHR(t1, t1, fs_reg(5));<br>
><br>
> /* This works for both SIMD8 and SIMD16 */<br>
<br>
</span>I'm really sketchy on the details of how this actually works. Mostly, I get what<br>
this code is doing, and I agree that the only difference for 16x should be the<br>
extra bit (because SSPI needs to go up to 7 for SIMD8).<br></blockquote><div>As per docs we're supposed to get the per slot SampleID written to 15:0 bits in</div><div>R1.0. I used SSPI to compute the SampleID because I never got anything useful</div><div>in these bits on IVB. Things might have changed on later platforms. So, I think</div><div>it's worth trying to do what docs say. I'll send out a patch to add above reasoning</div><div>as a comment in this code. For now I'm happy with this patch: </div><div><br></div><div>Reviewed-by: Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a>><br></div><div> </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>
So take my:<br>
Reviewed-by: Ben Widawsky <<a href="mailto:ben@bwidawsk.net">ben@bwidawsk.net</a>><br>
<br>
with a grain of salt.<br>
<div class=""><div class="h5">_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div></div>