Open ziga-lunarg opened 6 months ago
@ziga-lunarg thanks for the test!
I'm trying to use dynamic rendering local read, and I think I encounter the same issue? "image layout is VK_IMAGE_LAYOUT_UNDEFINED"...."If vkCmdPipelineBarrier2 is called within a render pass instance started with vkCmdBeginRendering"..."it must be in the VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ_KHR"....
Using the following code version:
commit c1fc23ca9b42e766addeb6e5e552d1bb4f79c6f9 (HEAD -> main, origin/main, origin/HEAD) Author: spencer-lunarg spencer@lunarg.com Date: Thu Apr 25 19:22:08 2024 +0900
layers: Don't count ImageQuery as image accesses
Digging through the code, in cc_validation.cpp: ' for (const auto &entry : *image_view_image_state->layout_range_map) { if (entry.second != VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ_KHR && entry.second != VK_IMAGE_LAYOUT_GENERAL) { const auto &vuid = sync_vuid_maps::GetShaderTileImageVUID( barrier_loc, sync_vuid_maps::ShaderTileImageError::kShaderTileImageLayout); skip |= LogError(vuid, img_barrier.image, barrier_loc, "image layout is %s.", string_VkImageLayout(entry.second)); } } '
it seems that layout_range_map only gets updated when command buffer is executed?
But the layout check above gets executed before the command buffer executes (when the user calls pipelineBarrier)?
So maybe the layout state is out of sync with regards to recording time vs command buffer execution time?
(e.g. the layout state is in GPU timeline, while the check is performed in CPU timeline?)
The CTS test
dEQP-VK.dynamic_rendering.primary_cmd_buff.local_read.max_input_attachments
falsely triggersVUID-vkCmdPipelineBarrier-image-09555
.Here is a test to reproduce: