Repository: godot
Issue: Vulkan Validation: vkCmdDispatch: Hazard READ_AFTER_WRITE for VkImageView 0x73d1770000003223[radiance base cubemap View]
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

[Not sure how useful this will be but since I'm running the validation layers I figured I'd note some details down.]

```
ERROR: VALIDATION - Message Id Number: 1287084845 | Message Id Name: SYNC-HAZARD-READ_AFTER_WRITE
        Validation Error: [ SYNC-HAZARD-READ_AFTER_WRITE ] Object 0: handle = 0x73d1770000003223, name = radiance base cubemap View, type = VK_OBJECT_TYPE_IMAGE_VIEW; |MessageID = 0x4cb75b2d | vkCmdDispatch: Hazard READ_AFTER_WRITE for VkImageView 0x73d1770000003223[radiance base cubemap View], in VkCommandBuffer 0x55555f9d0520[], andVkPipeline 0x6c9d670000000378[], VkDescriptorSet 0x4f0d4300000034b7[], type: VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, imageLayout: VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, binding #0, index 0. Access info (usage: SYNC_COMPUTE_SHADER_SHADER_STORAGE_READ, prior_usage: SYNC_IMAGE_LAYOUT_TRANSITION, write_barriers: 0, command: vkCmdEndRenderPass, seq_no: 623, reset_no: 41).
        Objects - 1
                Object[0] - VK_OBJECT_TYPE_IMAGE_VIEW, Handle 8345582426377957923, Name "radiance base cubemap View"
   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=0x7fffffffb100, 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=<optimized out>, pipelineBindPoint=<optimized out>, func_name=<optimized out>) at /root/sdk-build/1.2.182.0/source/Vulkan-ValidationLayers/layers/synchronization_validation.cpp:1835
#5  0x00007fffe9297e96 in vulkan_layer_chassis::CmdDispatch (commandBuffer=0x55555f9d0520, groupCountX=0x20, groupCountY=0x20, groupCountZ=0x6) at /root/sdk-build/1.2.182.0/source/Vulkan-ValidationLayers/layers/generated/chassis.cpp:3102
#6  0x00005555587a4f21 in RenderingDeviceVulkan::compute_list_dispatch (this=0x55555f7b0090, p_list=0x4, p_x_groups=0x20, p_y_groups=0x20, p_z_groups=0x6) at drivers/vulkan/rendering_device_vulkan.cpp:8102
#7  0x000055555ae2b377 in EffectsRD::cubemap_roughness (this=0x555562a59ba0, p_source_rd_texture=..., p_dest_texture=..., p_face_id=0xa, p_sample_count=0x400, p_roughness=0.142857149, p_size=256) at servers/rendering/renderer_rd/effects_rd.cpp:1660
#8  0x000055555ab56c68 in RendererSceneSkyRD::ReflectionData::create_reflection_importance_sample (this=0x555564f51bf8, p_storage=0x55555fa85bb0, p_use_arrays=0x1, p_cube_side=0xa, p_base_layer=0x1, p_sky_ggx_samples_quality=0x400) at servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp:520
#9  0x000055555ab5c87e in RendererSceneSkyRD::update (this=0x5555607a17b0, p_env=0x555564f62780, p_projection=..., p_transform=..., p_time=6.7999999999999998, p_luminance_multiplier=1) at servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp:1331
#10 0x000055555abe2208 in RendererSceneRenderImplementation::RenderForwardClustered::_render_scene (this=0x5555607a0720, p_render_data=0x7fffffffc210, p_default_bg_color=...) at servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp:1378
#11 0x000055555ab2d41d in RendererSceneRenderRD::render_scene (this=0x5555607a0720, p_render_buffers=..., p_camera_data=0x7fffffffc9b0, p_instances=..., p_lights=..., p_reflection_probes=..., p_voxel_gi_instances=..., p_decals=..., p_lightmaps=..., p_fog_volumes=..., p_environment=..., p_camera_effects=..., p_shadow_atlas=..., p_occluder_debug_tex=..., p_reflection_atlas=..., p_reflection_probe=..., p_reflection_probe_pass=0xffffffff, p_screen_lod_threshold=0.00163934426, p_render_shadows=0x55555fa733e8, p_render_shadow_count=0x4, p_render_sdfgi_regions=0x55555fa7b3f0, p_render_sdfgi_region_count=0x0, p_sdfgi_update_data=0x55555fa7b930, r_render_info=0x55556b8008d0) at servers/rendering/renderer_rd/renderer_scene_render_rd.cpp:4684
#12 0x000055555adeb32e in RendererSceneCull::_render_scene (this=0x55555fa723a0, p_camera_data=0x7fffffffc9b0, p_render_buffers=..., p_environment=..., p_force_camera_effects=..., p_visible_layers=0xf0fffff, p_scenario=..., p_viewport=..., p_shadow_atlas=..., p_reflection_probe=..., p_reflection_probe_pass=0xffffffff, p_screen_lod_threshold=0.00163934426, p_using_shadows=0x1, r_render_info=0x55556b8008d0) at servers/rendering/renderer_scene_cull.cpp:3204
#13 0x000055555ade6c02 in RendererSceneCull::render_camera (this=0x55555fa723a0, p_render_buffers=..., p_camera=..., p_scenario=..., p_viewport=..., p_viewport_size=..., p_screen_lod_threshold=0.00163934426, p_shadow_atlas=..., p_xr_interface=..., r_render_info=0x55556b8008d0) at servers/rendering/renderer_scene_cull.cpp:2498
#14 0x000055555ae0fb5d in RendererViewport::_draw_3d (this=0x55555fa72300, p_viewport=0x55556b8007d0) at servers/rendering/renderer_viewport.cpp:120
#15 0x000055555ae1012a in RendererViewport::_draw_viewport (this=0x55555fa72300, p_viewport=0x55556b8007d0) at servers/rendering/renderer_viewport.cpp:179
#16 0x000055555ae12af4 in RendererViewport::draw_viewports (this=0x55555fa72300) at servers/rendering/renderer_viewport.cpp:608
#17 0x000055555aa65b7e in RenderingServerDefault::_draw (this=0x55555fa3cfa0, p_swap_buffers=0x1, frame_step=6.7999999999999998) at servers/rendering/rendering_server_default.cpp:97
#18 0x000055555aa678ac in RenderingServerDefault::draw (this=0x55555fa3cfa0, p_swap_buffers=0x1, frame_step=6.7999999999999998) at servers/rendering/rendering_server_default.cpp:379
#19 0x00005555576d8ce2 in Main::iteration () at main/main.cpp:2666
#20 0x00005555576928b6 in OS_LinuxBSD::run (this=0x7fffffffd540) at platform/linuxbsd/os_linuxbsd.cpp:342
#21 0x000055555768eded in main (argc=0x7, argv=0x7fffffffda38) at platform/linuxbsd/godot_linuxbsd.cpp:58
```

### Steps to reproduce

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


### Minimal reproduction project

_No response_