Repository: godot
Issue: Vulkan Validation: (via  RendererCanvasCull::render_canvas) vkCmdDrawIndexed: Hazard READ_AFTER_WRITE for VkImageView
Labels: bug,topic:rendering

### Godot version

Godot Engine v4.0.dev.calinou.795cd2eb3 ([`795cd2eb3`](https://github.com/godotengine/godot/commits/795cd2eb3))

### System information

Linux, Elementary OS 5.1, Intel(R) HD Graphics 4400 (HSW GT2), Vulkan API 1.2.182

### Issue description

```
ERROR: VALIDATION - Message Id Number: 1287084845 | Message Id Name: SYNC-HAZARD-READ_AFTER_WRITE
        Validation Error: [ SYNC-HAZARD-READ_AFTER_WRITE ] Object 0: handle = 0xba98ae0000002ace, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x4cb75b2d | vkCmdDrawIndexed: Hazard READ_AFTER_WRITE for VkImageView 0xba98ae0000002ace[], in VkCommandBuffer 0x55555f9d0520[], and VkPipeline 0xd74bd40000003597[], VkDescriptorSet 0x59c86700000035c5[], type: VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, imageLayout: VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, binding #0, index 0. Access info (usage: SYNC_FRAGMENT_SHADER_SHADER_STORAGE_READ, prior_usage: SYNC_IMAGE_LAYOUT_TRANSITION, write_barriers: 0, command: vkCmdEndRenderPass, seq_no: 941, reset_no: 41).
        Objects - 1
                Object[0] - VK_OBJECT_TYPE_IMAGE_VIEW, Handle -5001056071171691826
   at: _debug_messenger_callback (drivers/vulkan/vulkan_context.cpp:157)
```

```
#0  VulkanContext::_debug_messenger_callback (messageSeverity=VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT, messageType=0x2, pCallbackData=0x7fffffffb750, pUserData=0x55555f0317b0) at drivers/vulkan/vulkan_context.cpp:53
#1  0x00007fffe93ff5de in debug_log_msg (layer_prefix=0x7fffe9a10799 "Validation", text_vuid=<optimized out>, message=<optimized out>, objects=..., msg_flags=<optimizedout>, debug_data=<optimized out>) at /root/sdk-build/1.2.182.0/source/Vulkan-ValidationLayers/layers/vk_layer_logging.h:475
#2  LogMsgLocked (debug_data=<optimized out>, msg_flags=msg_flags@entry=0x8, objects=..., vuid_text="SYNC-HAZARD-READ_AFTER_WRITE", err_msg=<optimized out>) at /root/sdk-build/1.2.182.0/source/Vulkan-ValidationLayers/layers/vk_layer_logging.h:735
#3  0x00007fffe9461bc7 in ValidationObject::LogError<VkImageView_T*> (this=0x55555f968790, src_object=<optimized out>, vuid_text="SYNC-HAZARD-READ_AFTER_WRITE", format=0x7fffe9c18d38 "%s: Hazard %s for %s, in %s, and %s, %s, type: %s, imageLayout: %s, binding #%u, index %u. Access info %s.") at /root/sdk-build/1.2.182.0/source/Vulkan-ValidationLayers/layers/generated/chassis.h:3310
#4  0x00007fffe97529ad in CommandBufferAccessContext::ValidateDispatchDrawDescriptorSet (this=this@entry=0x555562aa39e0, pipelineBindPoint=pipelineBindPoint@entry=VK_PIPELINE_BIND_POINT_GRAPHICS, func_name=func_name@entry=0x7fffe9a11f29 "vkCmdDrawIndexed") at /root/sdk-build/1.2.182.0/source/Vulkan-ValidationLayers/layers/synchronization_validation.cpp:1835
#5  0x00007fffe9754148 in SyncValidator::PreCallValidateCmdDrawIndexed (this=<optimized out>, commandBuffer=<optimized out>, indexCount=0x6, instanceCount=<optimized out>, firstIndex=0x0, vertexOffset=<optimized out>, firstInstance=0x0) at /root/sdk-build/1.2.182.0/source/Vulkan-ValidationLayers/layers/synchronization_validation.cpp:4078
#6  0x00007fffe929760d in vulkan_layer_chassis::CmdDrawIndexed (commandBuffer=<optimized out>, indexCount=<optimized out>, instanceCount=<optimized out>, firstIndex=<optimized out>, vertexOffset=0x0, firstInstance=0x0) at /root/sdk-build/1.2.182.0/source/Vulkan-ValidationLayers/layers/generated/chassis.cpp:3031
#7  0x00005555587a0ba0 in RenderingDeviceVulkan::draw_list_draw (this=0x55555f7b0090, p_list=0x800000000000000, p_use_indices=0x1, p_instances=0x1, p_procedural_vertices=0x0) at drivers/vulkan/rendering_device_vulkan.cpp:7468
#8  0x000055555ae3ae37 in RendererCanvasRenderRD::_render_item (this=0x7fffe4290020, p_draw_list=0x800000000000000, p_render_target=..., p_item=0x55556b550f40, p_framebuffer_format=0x5, p_canvas_transform_inverse=..., current_clip=@0x7fffffffc5e8: 0x55556b550bf0, p_lights=0x0, p_pipeline_variants=0x7fffe4290140) at servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp:570
#9  0x000055555ae3e4ce in RendererCanvasRenderRD::_render_items (this=0x7fffe4290020, p_to_render_target=..., p_item_count=0x50, p_canvas_transform_inverse=..., p_lights=0x0, p_to_backbuffer=0x0) at servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp:1117
#10 0x000055555ae40159 in RendererCanvasRenderRD::canvas_render_items (this=0x7fffe4290020, p_to_render_target=..., p_item_list=0x555564f98690, p_modulate=..., p_light_list=0x0, p_directional_light_list=0x0, p_canvas_transform=..., p_default_filter=RenderingServer::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, p_default_repeat=RenderingServer::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED, p_snap_2d_vertices_to_pixel=0x0, r_sdf_used=@0x7fffffffca28: 0x0) at servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp:1466
#11 0x000055555adc19a1 in RendererCanvasCull::_render_canvas_item_tree (this=0x55555fa52110, p_to_render_target=..., p_child_items=0x55557a3ca5c0, p_child_item_count=0xf, p_canvas_item=0x0, p_transform=..., p_clip_rect=..., p_modulate=..., p_lights=0x0, p_directional_lights=0x0, p_default_filter=RenderingServer::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, p_default_repeat=RenderingServer::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED, p_snap_2d_vertices_to_pixel=0x0) at servers/rendering/renderer_canvas_cull.cpp:72
#12 0x000055555adc2a9b in RendererCanvasCull::render_canvas (this=0x55555fa52110, p_render_target=..., p_canvas=0x555564e06850, p_transform=..., p_lights=0x0, p_directional_lights=0x0, p_clip_rect=..., p_default_filter=RenderingServer::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, p_default_repeat=RenderingServer::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED, p_snap_2d_transforms_to_pixel=0x0, p_snap_2d_vertices_to_pixel=0x0) at servers/rendering/renderer_canvas_cull.cpp:359
#13 0x000055555ae11e40 in RendererViewport::_draw_viewport (this=0x55555fa72300, p_viewport=0x555564e668f0) at servers/rendering/renderer_viewport.cpp:457
#14 0x000055555ae12af4 in RendererViewport::draw_viewports (this=0x55555fa72300) at servers/rendering/renderer_viewport.cpp:608
#15 0x000055555aa65b7e in RenderingServerDefault::_draw (this=0x55555fa3cfa0, p_swap_buffers=0x1, frame_step=6.7999999999999998) at servers/rendering/rendering_server_default.cpp:97
#16 0x000055555aa678ac in RenderingServerDefault::draw (this=0x55555fa3cfa0, p_swap_buffers=0x1, frame_step=6.7999999999999998) at servers/rendering/rendering_server_default.cpp:379
#17 0x00005555576d8ce2 in Main::iteration () at main/main.cpp:2666
#18 0x00005555576928b6 in OS_LinuxBSD::run (this=0x7fffffffd540) at platform/linuxbsd/os_linuxbsd.cpp:342
#19 0x000055555768eded in main (argc=0x7, argv=0x7fffffffda38) at platform/linuxbsd/godot_linuxbsd.cpp:58
```

### Steps to reproduce

[vulk-previews-issue-repro-bb.zip](https://github.com/godotengine/godot/files/7465344/vulk-previews-issue-repro-bb.zip)


### Minimal reproduction project

_No response_