<div dir="ltr">Hi Iago,<div class="gmail_extra"><br><div class="gmail_quote">On 14 February 2017 at 11:19, 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5">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">itoral@igalia.com</a>> 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.<wbr>buffer.r8g8b8a8_snorm<br>
> > > dEQP-VK.image.load_store.<wbr>buffer.r8g8b8a8_unorm<br>
> > > dEQP-VK.image.format_<wbr>reinterpret.buffer.r32_uint_<wbr>r8g8b8a8_snorm<br>
> > > dEQP-<br>
> > VK.image.format_reinterpret.<wbr>buffer.r8g8b8a8_uint_r8g8b8a8_<wbr>unorm<br>
> > > dEQP-<br>
> > VK.image.format_reinterpret.<wbr>buffer.r8g8b8a8_sint_r8g8b8a8_<wbr>snorm<br>
> > > dEQP-<br>
> > VK.image.format_reinterpret.<wbr>buffer.r8g8b8a8_sint_r8g8b8a8_<wbr>unorm<br>
> > > dEQP-VK.image.format_<wbr>reinterpret.buffer.r32_sint_<wbr>r8g8b8a8_unorm<br>
> > > dEQP-VK.image.format_<wbr>reinterpret.buffer.r32_sint_<wbr>r8g8b8a8_snorm<br>
> > > dEQP-VK.image.format_<wbr>reinterpret.buffer.r32_uint_<wbr>r8g8b8a8_unorm<br>
> > > dEQP-<br>
> > VK.image.format_reinterpret.<wbr>buffer.r8g8b8a8_snorm_<wbr>r8g8b8a8_unorm<br>
> > > dEQP-VK.image.store.buffer.<wbr>r8g8b8a8_unorm<br>
> > > dEQP-VK.image.store.buffer.<wbr>r8g8b8a8_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.*.<wbr>r32g32b32a32.*<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] before<br>
> this one. I've just tested locally and see no failures with both that<br>
> patch and this one applied. I'll include that patch when I resend the<br>
> series.<br>
<br>
</div></div>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></blockquote><div><br></div><div>Were these failures on buffer-related tests (e.g. dEQP-VK.image.load_store.buffer.*)?</div><div><br></div><div>If so, I've fixed these in the new version of the patch I submitted a few hours ago - buffer views also needed to be changed to handle write-only accesses in the same way as image views. With the new patch I see no failures on the dEQP-VK.image.* tests.</div><div><br></div><div>Thanks,</div><div>Alex</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Iago<br>
<br>
> Alex<br>
><br>
> [1] <a href="https://lists.freedesktop.org/archives/mesa-dev/2017-February/144" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>archives/mesa-dev/2017-<wbr>February/144</a><br>
<div class="gmail-HOEnZb"><div class="gmail-h5">> 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">jason@jlekstrand.net</a>><br>
> > > ><br>
> > > > On Thu, Feb 9, 2017 at 8:06 AM, Alex Smith <asmith@feralinterac<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">asmith@feralinteractive.com</a>><br>
> > > > > ---<br>
> > > > >  src/compiler/spirv/nir_spirv.<wbr>h     | 1 +<br>
> > > > >  src/compiler/spirv/spirv_to_<wbr>nir.c  | 5 ++++-<br>
> > > > >  src/compiler/spirv/vtn_<wbr>variables.c | 5 ++++-<br>
> > > > >  3 files changed, 9 insertions(+), 2 deletions(-)<br>
> > > > ><br>
> > > > > diff --git a/src/compiler/spirv/nir_<wbr>spirv.h<br>
> > > > > b/src/compiler/spirv/nir_<wbr>spirv.h<br>
> > > > > index e0ebc62..e43e9b5 100644<br>
> > > > > --- a/src/compiler/spirv/nir_<wbr>spirv.h<br>
> > > > > +++ b/src/compiler/spirv/nir_<wbr>spirv.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 @@ vtn_handle_preamble_<wbr>instruction(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(<wbr>cap));<br>
> > > > >           break;<br>
> > > > > @@ -2702,6 +2701,10 @@ vtn_handle_preamble_<wbr>instruction(struct<br>
> > > > > vtn_builder *b, SpvOp opcode,<br>
> > > > >           spv_check_supported(draw_<wbr>parameters, cap);<br>
> > > > >           break;<br>
> > > > ><br>
> > > > > +      case SpvCapabilityStorageImageWrite<wbr>WithoutFormat:<br>
> > > > > +         spv_check_supported(image_<wbr>write_without_format,<br>
> > cap);<br>
> > > > > +         break;<br>
> > > > > +<br>
> > > > >        default:<br>
> > > > >           unreachable("Unhandled capability");<br>
> > > > >        }<br>
> > > > > diff --git a/src/compiler/spirv/vtn_<wbr>variables.c<br>
> > > > > b/src/compiler/spirv/vtn_<wbr>variables.c<br>
> > > > > index 098cfb5..d7d882e 100644<br>
> > > > > --- a/src/compiler/spirv/vtn_<wbr>variables.c<br>
> > > > > +++ b/src/compiler/spirv/vtn_<wbr>variables.c<br>
> > > > > @@ -1054,8 +1054,12 @@ apply_var_decoration(struct<br>
> > vtn_builder<br>
> > > > > *b, nir_variable *nir_var,<br>
> > > > >        assert(nir_var->constant_<wbr>initializer != 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 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">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">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">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>
</div></div></blockquote></div><br></div></div>