layers: Validate 01586 for same-format plane views - #13207
Conversation
|
Author apollo-2006 not on autobuild list. Waiting for curator authorization before starting CI build. |
5b2e54f to
bed89fe
Compare
|
Author apollo-2006 not on autobuild list. Waiting for curator authorization before starting CI build. |
| vkt::Image mpimage(*m_device, image_ci, vkt::set_layout); | ||
| ycbcr_info.conversion = conversions_0; // Need two samplers with different conversions | ||
| vkt::ImageView view = mpimage.CreateView(VK_IMAGE_ASPECT_PLANE_0_BIT, &ycbcr_info); | ||
| vkt::ImageView view = mpimage.CreateView(VK_IMAGE_ASPECT_COLOR_BIT, &ycbcr_info); |
There was a problem hiding this comment.
this is wrong, the VU says
If creating a single-plane view,
if you set VK_IMAGE_ASPECT_COLOR_BIT your view is now not a single plane, but instead all the planes
There was a problem hiding this comment.
Right, COLOR_BIT makes it a multi-plane view. My reasoning was that these views chain a VkSamplerYcbcrConversionInfo, so as I read 06658 the view format has to match the conversion's (G8_B8R8_2PLANE_420_UNORM), and with PLANE_0 that format hits 01586. That's why I went with a multi-plane view, but if you had a different fix in mind for these tests I'm happy to change it.
|
|
||
| // A single-plane view using the image's own multiplane format is never compatible with the plane | ||
| // (the mismatched format case is checked below with VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) | ||
| if (image_format == view_format && IsOnlyOneValidPlaneAspect(image_format, aspect_mask)) { |
There was a problem hiding this comment.
I would have expected this logic to live near the other 01586, having it here is confusing to have the same VUID in 2 different spots
There was a problem hiding this comment.
Done. There is now a single 01586 check covering every single-plane view, and the one in the MUTABLE_FORMAT branch is gone.
bed89fe to
7c618c0
Compare
|
Author apollo-2006 not on autobuild list. Waiting for curator authorization before starting CI build. |
| descriptor_write.pImageInfo = &image_infos[0]; | ||
| m_errorMonitor->SetDesiredError("VUID-VkWriteDescriptorSet-descriptorType-02738"); | ||
| // The sampler is not immutable, so the COLOR aspect view of a multi-planar image is also invalid | ||
| m_errorMonitor->SetDesiredError("VUID-VkDescriptorImageInfo-sampler-01564"); |
There was a problem hiding this comment.
why are we triggering 01564 suddenly here
There was a problem hiding this comment.
I think it comes from the view now being COLOR_BIT. This second write goes to a binding without immutable samplers, so samplers_0 is used, and as I read 01564 that needs a plane aspect on a multi-planar image. The old PLANE_0 view kept it from firing before. Happy to restructure the test if you'd rather it only hit 02738.
|
|
||
| // Creating a single-plane view, the format must be compatible with the plane. | ||
| // This includes using the image's own multiplane format, which is never compatible with a plane. | ||
| if (IsOnlyOneValidPlaneAspect(image_format, aspect_mask)) { |
There was a problem hiding this comment.
if we are going to move this, can you write a test next to MultiplaneIncompatibleViewFormat2Plane that before this change does not trigger 01586 but now will trigger 01586
There was a problem hiding this comment.
Added NegativeYcbcr.MultiplanePlaneViewFormat right after it. It covers a PLANE_0 view that keeps G8_B8R8_2PLANE_420_UNORM on a MUTABLE_FORMAT image, and a PLANE_0 view with R8G8_UNORM on an image without MUTABLE_FORMAT (which also expects 12397). Neither reports 01586 on main.
7c618c0 to
4f4345b
Compare
|
Author apollo-2006 not on autobuild list. Waiting for curator authorization before starting CI build. |
4f4345b to
fc9e94e
Compare
|
Author apollo-2006 not on autobuild list. Waiting for curator authorization before starting CI build. |
fc9e94e to
eb076a5
Compare
|
Author apollo-2006 not on autobuild list. Waiting for curator authorization before starting CI build. |
VUID-VkImageViewCreateInfo-image-01586 requires a single-plane view to use a format compatible with its plane. It was only checked with
VK_IMAGE_CREATE_MUTABLE_FORMAT_BITand a view format different from the image format, so aVK_IMAGE_ASPECT_PLANE_0_BITview of aG8_B8R8_2PLANE_420_UNORMimage that keepsG8_B8R8_2PLANE_420_UNORMas its format was never reported, although plane 0 isR8_UNORM.01586 is now checked for every single-plane view in one place, next to 07818, and the check in the
MUTABLE_FORMATbranch is gone. A plane view of an image withoutMUTABLE_FORMATthat uses an incompatible format now reports 01586 as well as 12397, since it breaks both.Test changes:
PositiveSampler.SamplerConversionDifferentHandleandNegativeSampler.MultiplaneImageSamplerConversionMismatchcreated exactly that view (lavapipe asserts on it inlvp_CreateImageView). Their views chain aVkSamplerYcbcrConversionInfo, and as I read 06658 the view format then needs to be the conversion's format, and aPLANE_0view with that format doesn't match the plane for 01586. So both now create a multi-plane view withVK_IMAGE_ASPECT_COLOR_BIT. The negative test also expectsVUID-VkDescriptorImageInfo-sampler-01564: its second write uses a non-immutable sampler, and as I read 01564 that needs a plane aspect on a multi-planar image.Adds
NegativeYcbcr.MultiplanePlaneViewFormat, next toMultiplaneIncompatibleViewFormat2Plane: aPLANE_0view keepingG8_B8R8_2PLANE_420_UNORMon aMUTABLE_FORMATimage, and aPLANE_0view withR8G8_UNORMon an image withoutMUTABLE_FORMAT(which also expects 12397). Neither reports 01586 on main.Found by running the test suite on lavapipe.
Message for the same-format case:
Tested: full suite with the mock ICD and max_profile.json, no failures. Image view, sampler and YCbCr tests on lavapipe and RADV (RX 9070 XT).