anv: fix crash in vkCmdClearAttachments with unused attachment
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 15 Jul 2019 12:35:11 +0000 (15:35 +0300)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 15 Jul 2019 13:47:41 +0000 (16:47 +0300)
commitc9c8c2f7d7d83443928717a00c3be8f1f690e6c3
treeb2b1fb6fcce6a8ba403c139b75a6b95ec3ef84bf
parentb650f3d197bd049c3cf73baab4d0124f1665d724
anv: fix crash in vkCmdClearAttachments with unused attachment

anv_render_pass_compile() turns an unused attachment into a NULL
depth_stencil_attachment pointer so check that pointer before
accessing it.

Found with updates to existing CTS tests.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 208be8eafa30be ("anv: Make subpass::depth_stencil_attachment a pointer")
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
src/intel/vulkan/anv_blorp.c