[Mesa-dev] [PATCH] anv: ensure that we do not emit negative Depth in 3DSTATE_DEPTH_BUFFER

Jason Ekstrand jason at jlekstrand.net
Wed Feb 22 17:38:23 UTC 2017


On Wed, Feb 22, 2017 at 6:45 AM, Iago Toral Quiroga <itoral at igalia.com>
wrote:

> This fixes a number of new CTS tests that would crash otherwise:
> dEQP-VK.pipeline.render_to_image.*
> ---
>  src/intel/vulkan/genX_cmd_buffer.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/intel/vulkan/genX_cmd_buffer.c
> b/src/intel/vulkan/genX_cmd_buffer.c
> index 40a72f4..cdd4501 100644
> --- a/src/intel/vulkan/genX_cmd_buffer.c
> +++ b/src/intel/vulkan/genX_cmd_buffer.c
> @@ -2270,7 +2270,8 @@ cmd_buffer_emit_depth_stencil(struct anv_cmd_buffer
> *cmd_buffer)
>           assert(image->depth_surface.isl.dim != ISL_SURF_DIM_3D);
>           db.Depth =
>           db.RenderTargetViewExtent =
> -            iview->isl.array_len - iview->isl.base_array_layer - 1;
> +            iview->isl.array_len <= iview->isl.base_array_layer
> +               ? 0 : iview->isl.array_len - iview->isl.base_array_layer -
> 1;
>

I think both the old code and the new code is broken. :(  I believe what we
actually want here is just array_len; we don't want to subtract
base_array_layer.

Does using just iview->isl.array_len fix the issue?


>
>  #if GEN_GEN >= 8
>           db.SurfaceQPitch =
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170222/88360f71/attachment.html>


More information about the mesa-dev mailing list