<div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">On Feb 9, 2017 02:23, "Juan A. Suarez Romero" <<a href="mailto:jasuarez@igalia.com">jasuarez@igalia.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">On Wed, 2017-02-08 at 13:35 -0800, Jason Ekstrand wrote:<br>
> This fixes the following Vulkan CTS tests on Haswell:<br>
><br>
> - dEQP-VK.api.image_clearing.<wbr>clear_color_image.1d_b4g4r4a4_<wbr>unorm_pack16<br>
> - dEQP-VK.api.image_clearing.<wbr>clear_color_image.2d_b4g4r4a4_<wbr>unorm_pack16<br>
> - dEQP-VK.api.image_clearing.<wbr>clear_color_image.3d_b4g4r4a4_<wbr>unorm_pack16<br>
> ---<br>
<br>
<br>
</div>I've tried, and it still crashes in assertion:<br>
<br>
deqp-vk: anv_private.h:1565: anv_swizzle_for_render: Assertion<br>
`swizzle.a == ISL_CHANNEL_SELECT_ONE || swizzle.a ==<br>
ISL_CHANNEL_SELECT_ALPHA' failed.<br>
<br>
<br>
It seems it still requires patch from <a href="https://lists.freedesktop.org/arc
hives/mesa-dev/2017-February/143480.html" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>arc<br>
hives/mesa-dev/2017-February/<wbr>143480.html</a><br>
<br>
<br>
There's a small typo also in a comment.<br>
<br>
Other than that, it is:<br>
<br>
Reviewed-by: Juan A. Suarez Romero <<a href="mailto:jasuarez@igalia.com">jasuarez@igalia.com</a>>.<br>
<br>
<br>
<br>
BTW, I've also sent a couple of patches to fix these tests:<br>
<br>
<a href="https://lists.freedesktop.org/archives/mesa-dev/2017-February/143479.ht
ml" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>archives/mesa-dev/2017-<wbr>February/143479.ht<br>
ml</a><br>
<br>
Giving the above comment, I guess your preference is using patch 1/2<br>
that I sent, and use this one you've sent instead of 2/2, right.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Yes, I would rather fix this in blorp though I am a bit surprised that patch 1 is needed too.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
        J.A.<br>
<div class="elided-text"><br>
<br>
>  src/intel/blorp/blorp_clear.c | 45 ++++++++++++++++++++++++++----<wbr>-------------<br>
>  1 file changed, 27 insertions(+), 18 deletions(-)<br>
><br>
> diff --git a/src/intel/blorp/blorp_clear.<wbr>c b/src/intel/blorp/blorp_clear.<wbr>c<br>
> index 8ea22ac..e452713 100644<br>
> --- a/src/intel/blorp/blorp_clear.<wbr>c<br>
> +++ b/src/intel/blorp/blorp_clear.<wbr>c<br>
> @@ -328,6 +328,23 @@ blorp_fast_clear(struct blorp_batch *batch,<br>
>     batch->blorp->exec(batch, &params);<br>
>  }<br>
><br>
> +static union isl_color_value<br>
> +swizzle_color_value(union isl_color_value src, struct isl_swizzle swizzle)<br>
> +{<br>
> +   union isl_color_value dst;<br>
> +<br>
> +   assert((unsigned)(swizzle.r - ISL_CHANNEL_SELECT_RED) < 4);<br>
> +   assert((unsigned)(swizzle.g - ISL_CHANNEL_SELECT_RED) < 4);<br>
> +   assert((unsigned)(swizzle.b - ISL_CHANNEL_SELECT_RED) < 4);<br>
> +   assert((unsigned)(swizzle.a - ISL_CHANNEL_SELECT_RED) < 4);<br>
> +<br>
> +   dst.u32[swizzle.r - ISL_CHANNEL_SELECT_RED] = src.u32[0];<br>
> +   dst.u32[swizzle.g - ISL_CHANNEL_SELECT_RED] = src.u32[1];<br>
> +   dst.u32[swizzle.b - ISL_CHANNEL_SELECT_RED] = src.u32[2];<br>
> +   dst.u32[swizzle.a - ISL_CHANNEL_SELECT_RED] = src.u32[3];<br>
> +<br>
> +   return dst;<br>
> +}<br>
><br>
>  void<br>
>  blorp_clear(struct blorp_batch *batch,<br>
> @@ -346,6 +363,14 @@ blorp_clear(struct blorp_batch *batch,<br>
>     params.x1 = x1;<br>
>     params.y1 = y1;<br>
><br>
> +   /* Manually apply the clear destination swizzle.  This way swizzled clears<br>
> +    * will work for swizzles which we can't normally use for rendering and it<br>
> +    * also ensures that they work on pre-Haswell hardware which can't swizlle<br>
</div>                                                                    ^^^<br>
                                                          typo: swizzle<br>
<div class="elided-text">> +    * at all.<br>
> +    */<br>
> +   clear_color = swizzle_color_value(clear_<wbr>color, swizzle);<br>
> +   swizzle = ISL_SWIZZLE_IDENTITY;<br>
> +<br>
>     if (format == ISL_FORMAT_R9G9B9E5_SHAREDEXP) {<br>
>        clear_color.u32[0] = float3_to_rgb9e5(clear_color.<wbr>f32);<br>
>        format = ISL_FORMAT_R32_UINT;<br>
> @@ -353,24 +378,8 @@ blorp_clear(struct blorp_batch *batch,<br>
>        /* Broadwell and earlier cannot render to this format so we need to work<br>
>         * around it by swapping the colors around and using B4G4R4A4 instead.<br>
>         */<br>
> -<br>
> -      /* First, we apply the swizzle. */<br>
> -      union isl_color_value old;<br>
> -      assert((unsigned)(swizzle.r - ISL_CHANNEL_SELECT_RED) < 4);<br>
> -      assert((unsigned)(swizzle.g - ISL_CHANNEL_SELECT_RED) < 4);<br>
> -      assert((unsigned)(swizzle.b - ISL_CHANNEL_SELECT_RED) < 4);<br>
> -      assert((unsigned)(swizzle.a - ISL_CHANNEL_SELECT_RED) < 4);<br>
> -      old.u32[swizzle.r - ISL_CHANNEL_SELECT_RED] = clear_color.u32[0];<br>
> -      old.u32[swizzle.g - ISL_CHANNEL_SELECT_RED] = clear_color.u32[1];<br>
> -      old.u32[swizzle.b - ISL_CHANNEL_SELECT_RED] = clear_color.u32[2];<br>
> -      old.u32[swizzle.a - ISL_CHANNEL_SELECT_RED] = clear_color.u32[3];<br>
> -      swizzle = ISL_SWIZZLE_IDENTITY;<br>
> -<br>
> -      /* Now we re-order for the new format */<br>
> -      clear_color.u32[0] = old.u32[1];<br>
> -      clear_color.u32[1] = old.u32[2];<br>
> -      clear_color.u32[2] = old.u32[3];<br>
> -      clear_color.u32[3] = old.u32[0];<br>
> +      const struct isl_swizzle ARGB = ISL_SWIZZLE(ALPHA, RED, GREEN, BLUE);<br>
> +      clear_color = swizzle_color_value(clear_<wbr>color, ARGB);<br>
>        format = ISL_FORMAT_B4G4R4A4_UNORM;<br>
>     }<br>
><br>
</div>______________________________<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>
</blockquote></div><br></div></div></div>