<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Feb 28, 2017 at 11:33 PM, 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"><div class="HOEnZb"><div class="h5">On Fri, 2017-02-24 at 07:25 -0800, Jason Ekstrand wrote:<br>
> On Feb 23, 2017 11:40 PM, "Iago Toral Quiroga" <<a href="mailto:itoral@igalia.com">itoral@igalia.com</a>><br>
> wrote:<br>
> According to the PRM description of the Depth field:<br>
><br>
>   "This field specifies the total number of levels for a volume<br>
> texture<br>
>    or the number of array elements allowed to be accessed starting at<br>
> the<br>
>    Minimum Array Element for arrayed surfaces"<br>
><br>
> However, ISL defines array_len as the length of the range<br>
> [base_array_layer, base_array_layer + array_len], so it already<br>
> represents<br>
> a value relative to the base array layer like the hardware expects.<br>
><br>
> This fixes a number of new CTS tests that would crash otherwise:<br>
> dEQP-VK.pipeline.render_to_<wbr>image.*<br>
> ---<br>
>  src/intel/vulkan/genX_cmd_<wbr>buffer.c | 3 +--<br>
>  1 file changed, 1 insertion(+), 2 deletions(-)<br>
><br>
> diff --git a/src/intel/vulkan/genX_cmd_<wbr>buffer.c<br>
> b/src/intel/vulkan/genX_cmd_<wbr>buffer.c<br>
> index 40a72f4..3c7b544 100644<br>
> --- a/src/intel/vulkan/genX_cmd_<wbr>buffer.c<br>
> +++ b/src/intel/vulkan/genX_cmd_<wbr>buffer.c<br>
> @@ -2269,8 +2269,7 @@ cmd_buffer_emit_depth_stencil(<wbr>struct<br>
> anv_cmd_buffer *cmd_buffer)<br>
><br>
>           assert(image->depth_surface.<wbr>isl.dim != ISL_SURF_DIM_3D);<br>
>           db.Depth =<br>
> -         db.RenderTargetViewExtent =<br>
> -            iview->isl.array_len - iview->isl.base_array_layer - 1;<br>
> +         db.RenderTargetViewExtent = iview->isl.array_len;<br>
><br>
> Don't we still want the -1?<br>
<br>
</div></div>The PRM says this about the Depth field:<br>
<br>
"This field specifies (...) the number of array elements allowed to be<br>
<span class="">accessed starting at the Minimum Array Element for arrayed surfaces"<br>
<br>
</span>And in anv_get_layerCount, we compute this value as:<br>
<br>
range->layerCount == VK_REMAINING_ARRAY_LAYERS ?<br>
   image->array_size - range->baseArrayLayer : range->layerCount;<br>
<br>
Since we want the number of elements including Minimum Array Element, I<br>
think we don't want the subtraction.<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>However, the field is a U11-1 field meaning it stores the actual value minus 1.  So for a single slice, the value in the field should be zero.<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="HOEnZb"><font color="#888888">
Iago<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
>  #if GEN_GEN >= 8<br>
>           db.SurfaceQPitch =<br>
> --<br>
> 2.7.4<br>
><br>
><br>
</div></div></blockquote></div><br></div></div>