@@ -4545,6 +4545,41 @@ TEST_F(PositiveSyncVal, Multiview2) {
45454545 m_command_buffer.End ();
45464546}
45474547
4548+ TEST_F (PositiveSyncVal, MultiviewNullView) {
4549+ TEST_DESCRIPTION (" https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/12257" );
4550+ SetTargetApiVersion (VK_API_VERSION_1_3 );
4551+ AddRequiredFeature (vkt::Feature::dynamicRendering);
4552+ AddRequiredFeature (vkt::Feature::multiview);
4553+ RETURN_IF_SKIP (InitSyncVal ());
4554+
4555+ const VkFormat depth_format = FindSupportedDepthOnlyFormat (Gpu ());
4556+ const VkImageCreateInfo image_ci =
4557+ vkt::Image::ImageCreateInfo2D (128 , 128 , 1 , 2 /* layers*/ , depth_format, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT );
4558+ vkt::Image image (*m_device, image_ci);
4559+ vkt::ImageView image_view = image.CreateView (VK_IMAGE_VIEW_TYPE_2D_ARRAY , 0 , 1 , 0 , 2 , VK_IMAGE_ASPECT_DEPTH_BIT );
4560+
4561+ VkRenderingAttachmentInfo depth_attachment = vku::InitStructHelper ();
4562+ depth_attachment.imageView = image_view;
4563+ depth_attachment.imageLayout = VK_IMAGE_LAYOUT_GENERAL ;
4564+ depth_attachment.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR ;
4565+ depth_attachment.storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE ;
4566+
4567+ // It is allowed to specify VK_NULL_HANDLE image view
4568+ VkRenderingAttachmentInfo stencil_attachment = vku::InitStructHelper ();
4569+
4570+ VkRenderingInfo rendering_info = vku::InitStructHelper ();
4571+ rendering_info.renderArea .extent = {128 , 128 };
4572+ rendering_info.layerCount = 2 ;
4573+ rendering_info.viewMask = 0x3 ; // view 0 + view 1
4574+ rendering_info.pDepthAttachment = &depth_attachment;
4575+ rendering_info.pStencilAttachment = &stencil_attachment;
4576+
4577+ m_command_buffer.Begin ();
4578+ m_command_buffer.BeginRendering (rendering_info);
4579+ m_command_buffer.EndRendering ();
4580+ m_command_buffer.End ();
4581+ }
4582+
45484583TEST_F (PositiveSyncVal, ClearAttachmentSecondaryCb) {
45494584 TEST_DESCRIPTION (" https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/12217" );
45504585 SetTargetApiVersion (VK_API_VERSION_1_3 );
0 commit comments