<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Feb 14, 2017 at 4:08 AM, Iago Toral <span dir="ltr"><<a href="mailto:itoral@igalia.com" target="_blank">itoral@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Tue, 2017-02-14 at 11:42 +0000, Alex Smith wrote:<br>
> Hi Iago,<br>
><br>
> On 14 February 2017 at 11:19, Iago Toral <<a href="mailto:itoral@igalia.com" target="_blank">itoral@igalia.com</a>> wrote:<br>
> > On Tue, 2017-02-14 at 09:46 +0000, Alex Smith wrote:<br>
> > > On 14 February 2017 at 08:45, Iago Toral <<a href="mailto:itoral@igalia.com" target="_blank">itoral@igalia.com</a>><br>
> > wrote:<br>
> > > > On Mon, 2017-02-13 at 16:29 +0000, Lionel Landwerlin wrote:<br>
> > > > > Run this by our CI earlier today and got a few failures :<br>
> > > > ><br>
> > > > > dEQP-VK.image.load_store.buffe<wbr>r.r8g8b8a8_snorm<br>
> > > > > dEQP-VK.image.load_store.buffe<wbr>r.r8g8b8a8_unorm<br>
> > > > > dEQP-<br>
> > VK.image.format_reinterpret.bu<wbr>ffer.r32_uint_r8g8b8a8_snorm<br>
> > > > > dEQP-<br>
> > > > VK.image.format_reinterpret.bu<wbr>ffer.r8g8b8a8_uint_r8g8b8a8_un<wbr>orm<br>
> > > > > dEQP-<br>
> > > > VK.image.format_reinterpret.bu<wbr>ffer.r8g8b8a8_sint_r8g8b8a8_sn<wbr>orm<br>
> > > > > dEQP-<br>
> > > > VK.image.format_reinterpret.bu<wbr>ffer.r8g8b8a8_sint_r8g8b8a8_un<wbr>orm<br>
</span><span>> > > > > dEQP-<br>
> > VK.image.format_reinterpret.bu<wbr>ffer.r32_sint_r8g8b8a8_unorm<br>
> > > > > dEQP-<br>
> > VK.image.format_reinterpret.bu<wbr>ffer.r32_sint_r8g8b8a8_snorm<br>
> > > > > dEQP-<br>
> > VK.image.format_reinterpret.bu<wbr>ffer.r32_uint_r8g8b8a8_unorm<br>
</span><div><div class="m_-5719535575661193194h5">> > > > > dEQP-<br>
> > > ><br>
> > VK.image.format_reinterpret.bu<wbr>ffer.r8g8b8a8_snorm_r8g8b8a8_<wbr>unorm<br>
> > > > > dEQP-VK.image.store.buffer.r8g<wbr>8b8a8_unorm<br>
> > > > > dEQP-VK.image.store.buffer.r8g<wbr>8b8a8_snorm<br>
> > > > ><br>
> > > > > I'm not quite sure why, it seems our backend discards format<br>
> > > > layout<br>
> > > > > qualifiers when we have writeonly set.<br>
> > > ><br>
> > > > For what is worth, I see a lot more regressions from<br>
> > > > image.load_store<br>
> > > > tests with this patch. Some of these get fixed with the second<br>
> > > > patch,<br>
> > > > but even then I see all of dEQP-<br>
> > > > VK.image.load_store.*.r32g32b3<wbr>2a32.*<br>
> > > > regressing (with Lionel's comment to patch 2 fixed)<br>
> > > These are all fixed by applying Jason's patch<br>
> > > "anv/apply_pipeline_layout: Set image.write_only to false" [1]<br>
> > before<br>
> > > this one. I've just tested locally and see no failures with both<br>
> > that<br>
> > > patch and this one applied. I'll include that patch when I resend<br>
> > the<br>
> > > series.<br>
> ><br>
> > Right, I can confirm this too. The second patch in the series, even<br>
> > with Lionel's comment fixed, does seem to add regressions even with<br>
> > Jason's patch though.<br>
> Were these failures on buffer-related tests (e.g. dEQP-<br>
> VK.image.load_store.buffer.*)?<br>
><br>
> If so, I've fixed these in the new version of the patch I submitted a<br>
> few hours ago - buffer views also needed to be changed to handle<br>
> write-only accesses in the same way as image views. With the new<br>
> patch I see no failures on the dEQP-VK.image.* tests.<br>
<br>
</div></div>Yes, I can confirm that your v2 passes all of dEQP-<br>
VK.image.{load_}store.* on my end too. Also, I have done a quick test<br>
with some CTS tests removing the image format for the writeonly images<br>
in the dEQP-VK.image.store.* tests and they all seem to pass (this<br>
needs the patch I sent to the list today), so I think it looks good.<span class="m_-5719535575661193194HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>I've run the series through our CI system and also hacked up the dEQP-VK.image.store.* tests to not provide a format (just to make sure that works) and everything checks out. I pushed it in the following order: 1/3 (my patch), Iago's patch, 2/3, 3/3 (Alex's patches).<br><br></div><div>Thanks, Alex, for the feature! And thanks to Lionel and Iago for careful review and testing! Good work.<br><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"><span class="m_-5719535575661193194HOEnZb"><font color="#888888">
Iago<br>
</font></span><div class="m_-5719535575661193194HOEnZb"><div class="m_-5719535575661193194h5"><br>
> Thanks,<br>
> Alex<br>
> <br>
> ><br>
> > Iago<br>
> ><br>
> > > Alex<br>
> > ><br>
> > > [1] <a href="https://lists.freedesktop.org/archives/mesa-dev/2017-February" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>archives/mesa-dev/2017-Februar<wbr>y</a><br>
> > /144<br>
> > > 167.html<br>
> > > <br>
> > > ><br>
> > > > Iago<br>
> > > ><br>
> > > > > -<br>
> > > > > Lionel<br>
> > > > ><br>
> > > > > On 13/02/17 16:10, Jason Ekstrand wrote:<br>
> > > > > > Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>><br>
> > > > > ><br>
> > > > > > On Thu, Feb 9, 2017 at 8:06 AM, Alex Smith <asmith@feralint<br>
> > erac<br>
> > > > tive<br>
> > > > > > .com> wrote:<br>
> > > > > > > Allow that capability if the driver indicates that it is<br>
> > > > > > > supported, and<br>
> > > > > > > flag whether images are read-only/write-only in the<br>
> > > > nir_variable<br>
> > > > > > > (based<br>
> > > > > > > on the NonReadable and NonWritable decorations), which<br>
> > > > drivers<br>
> > > > > > > may need<br>
> > > > > > > to implement this.<br>
> > > > > > ><br>
> > > > > > > Signed-off-by: Alex Smith <<a href="mailto:asmith@feralinteractive.com" target="_blank">asmith@feralinteractive.com</a>><br>
> > > > > > > ---<br>
> > > > > > > src/compiler/spirv/nir_spirv.<wbr>h | 1 +<br>
> > > > > > > src/compiler/spirv/spirv_to_n<wbr>ir.c | 5 ++++-<br>
> > > > > > > src/compiler/spirv/vtn_variab<wbr>les.c | 5 ++++-<br>
> > > > > > > 3 files changed, 9 insertions(+), 2 deletions(-)<br>
> > > > > > ><br>
> > > > > > > diff --git a/src/compiler/spirv/nir_spirv<wbr>.h<br>
> > > > > > > b/src/compiler/spirv/nir_spirv<wbr>.h<br>
> > > > > > > index e0ebc62..e43e9b5 100644<br>
> > > > > > > --- a/src/compiler/spirv/nir_spirv<wbr>.h<br>
> > > > > > > +++ b/src/compiler/spirv/nir_spirv<wbr>.h<br>
> > > > > > > @@ -49,6 +49,7 @@ struct nir_spirv_supported_extensions {<br>
> > > > > > > bool image_ms_array;<br>
> > > > > > > bool tessellation;<br>
> > > > > > > bool draw_parameters;<br>
> > > > > > > + bool image_write_without_format;<br>
> > > > > > > };<br>
> > > > > > ><br>
> > > > > > > nir_function *spirv_to_nir(const uint32_t *words, size_t<br>
> > > > > > > word_count,<br>
> > > > > > > diff --git a/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
> > > > > > > b/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
> > > > > > > index 416e12a..3f77ddf 100644<br>
> > > > > > > --- a/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
> > > > > > > +++ b/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
> > > > > > > @@ -2666,7 +2666,6 @@<br>
> > vtn_handle_preamble_instructio<wbr>n(struct<br>
> > > > > > > vtn_builder *b, SpvOp opcode,<br>
> > > > > > > case SpvCapabilityMinLod:<br>
> > > > > > > case SpvCapabilityTransformFeedback<wbr>:<br>
> > > > > > > case SpvCapabilityStorageImageReadW<wbr>ithoutFormat:<br>
> > > > > > > - case SpvCapabilityStorageImageWrite<wbr>WithoutFormat:<br>
> > > > > > > vtn_warn("Unsupported SPIR-V capability: %s",<br>
> > > > > > > spirv_capability_to_string(ca<wbr>p));<br>
> > > > > > > break;<br>
> > > > > > > @@ -2702,6 +2701,10 @@<br>
> > vtn_handle_preamble_instructio<wbr>n(struct<br>
> > > > > > > vtn_builder *b, SpvOp opcode,<br>
> > > > > > > spv_check_supported(draw_param<wbr>eters, cap);<br>
> > > > > > > break;<br>
> > > > > > ><br>
> > > > > > > + case SpvCapabilityStorageImageWrite<wbr>WithoutFormat:<br>
> > > > > > > + spv_check_supported(image_wri<wbr>te_without_format,<br>
> > > > cap);<br>
> > > > > > > + break;<br>
> > > > > > > +<br>
> > > > > > > default:<br>
> > > > > > > unreachable("Unhandled capability");<br>
> > > > > > > }<br>
> > > > > > > diff --git a/src/compiler/spirv/vtn_varia<wbr>bles.c<br>
> > > > > > > b/src/compiler/spirv/vtn_varia<wbr>bles.c<br>
> > > > > > > index 098cfb5..d7d882e 100644<br>
> > > > > > > --- a/src/compiler/spirv/vtn_varia<wbr>bles.c<br>
> > > > > > > +++ b/src/compiler/spirv/vtn_varia<wbr>bles.c<br>
> > > > > > > @@ -1054,8 +1054,12 @@ apply_var_decoration(struct<br>
> > > > vtn_builder<br>
> > > > > > > *b, nir_variable *nir_var,<br>
> > > > > > > assert(nir_var->constant_init<wbr>ializer != NULL);<br>
> > > > > > > nir_var->data.read_only = true;<br>
> > > > > > > break;<br>
> > > > > > > + case SpvDecorationNonReadable:<br>
> > > > > > > + nir_var->data.image.write_only = true;<br>
> > > > > > > + break;<br>
> > > > > > > case SpvDecorationNonWritable:<br>
> > > > > > > nir_var->data.read_only = true;<br>
> > > > > > > + nir_var->data.image.read_only = true;<br>
> > > > > > > break;<br>
> > > > > > > case SpvDecorationComponent:<br>
> > > > > > > nir_var->data.location_frac = dec->literals[0];<br>
> > > > > > > @@ -1107,7 +1111,6 @@ apply_var_decoration(struct<br>
> > vtn_builder<br>
> > > > *b,<br>
> > > > > > > nir_variable *nir_var,<br>
> > > > > > > case SpvDecorationAliased:<br>
> > > > > > > case SpvDecorationVolatile:<br>
> > > > > > > case SpvDecorationCoherent:<br>
> > > > > > > - case SpvDecorationNonReadable:<br>
> > > > > > > case SpvDecorationUniform:<br>
> > > > > > > case SpvDecorationStream:<br>
> > > > > > > case SpvDecorationOffset:<br>
> > > > > > > --<br>
> > > > > > > 2.7.4<br>
> > > > > > ><br>
> > > > > > > ______________________________<wbr>_________________<br>
> > > > > > > mesa-dev mailing list<br>
> > > > > > > <a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
> > > > > > > <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
> > > > > > ><br>
> > > > > ><br>
> > > > > ><br>
> > > > > > ______________________________<wbr>_________________<br>
> > > > > > mesa-dev mailing list<br>
> > > > > > <a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
> > > > > > <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
> > > > > ______________________________<wbr>_________________<br>
> > > > > mesa-dev mailing list<br>
> > > > > <a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
> > > > > <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
> > > ><br>
> ><br>
</div></div></blockquote></div><br></div></div>