panvk: disable depth write when depth test is disabled

The spec says

  depthWriteEnable controls whether depth writes are enabled when
  depthTestEnable is VK_TRUE. Depth writes are always disabled when
  depthTestEnable is VK_FALSE.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-By: Benjamin Lee <benjamin.lee@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31878>
This commit is contained in:
Chia-I Wu 2024-10-28 11:34:03 -07:00 committed by Marge Bot
parent 09a2de2a51
commit cc1c663152

View file

@ -1116,7 +1116,7 @@ prepare_ds(struct panvk_cmd_buffer *cmdbuf)
if (fs)
cfg.depth_source = pan_depth_source(&fs->info);
cfg.depth_write_enable = ds->depth.write_enable;
cfg.depth_write_enable = test_z && ds->depth.write_enable;
cfg.depth_bias_enable = rs->depth_bias.enable;
cfg.depth_function = test_z ? translate_compare_func(ds->depth.compare_op)
: MALI_FUNC_ALWAYS;