Skip to content

Commit 4446fa5

Browse files
Fix synchronization validation errors in ray tracing samples (#1414)
1 parent 6021c01 commit 4446fa5

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

samples/extensions/ray_tracing_basic/ray_tracing_basic.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,8 +745,13 @@ void RaytracingBasic::build_command_buffers()
745745
// Prepare current swap chain image as transfer destination
746746
vkb::image_layout_transition(draw_cmd_buffers[i],
747747
get_render_context().get_swapchain().get_images()[i],
748+
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
749+
VK_PIPELINE_STAGE_TRANSFER_BIT,
750+
{},
751+
VK_ACCESS_TRANSFER_WRITE_BIT,
748752
VK_IMAGE_LAYOUT_UNDEFINED,
749-
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
753+
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
754+
subresource_range);
750755

751756
// Prepare ray tracing output image as transfer source
752757
vkb::image_layout_transition(draw_cmd_buffers[i],

samples/extensions/ray_tracing_extended/ray_tracing_extended.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,8 +1407,13 @@ void RaytracingExtended::draw()
14071407
// Prepare current swap chain image as transfer destination
14081408
vkb::image_layout_transition(draw_cmd_buffers[i],
14091409
get_render_context().get_swapchain().get_images()[i],
1410+
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
1411+
VK_PIPELINE_STAGE_TRANSFER_BIT,
1412+
{},
1413+
VK_ACCESS_TRANSFER_WRITE_BIT,
14101414
VK_IMAGE_LAYOUT_UNDEFINED,
1411-
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
1415+
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
1416+
subresource_range);
14121417

14131418
// Prepare ray tracing output image as transfer source
14141419
vkb::image_layout_transition(draw_cmd_buffers[i],

samples/extensions/ray_tracing_position_fetch/ray_tracing_position_fetch.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,13 @@ void RayTracingPositionFetch::build_command_buffers()
467467
// Prepare current swap chain image as transfer destination
468468
vkb::image_layout_transition(draw_cmd_buffers[i],
469469
get_render_context().get_swapchain().get_images()[i],
470+
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
471+
VK_PIPELINE_STAGE_TRANSFER_BIT,
472+
{},
473+
VK_ACCESS_TRANSFER_WRITE_BIT,
470474
VK_IMAGE_LAYOUT_UNDEFINED,
471-
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
475+
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
476+
subresource_range);
472477

473478
// Prepare ray tracing output image as transfer source
474479
vkb::image_layout_transition(draw_cmd_buffers[i],

samples/extensions/ray_tracing_reflection/ray_tracing_reflection.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,8 +872,13 @@ void RaytracingReflection::build_command_buffers()
872872
// Prepare current swap chain image as transfer destination
873873
vkb::image_layout_transition(draw_cmd_buffers[i],
874874
get_render_context().get_swapchain().get_images()[i],
875+
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
876+
VK_PIPELINE_STAGE_TRANSFER_BIT,
877+
{},
878+
VK_ACCESS_TRANSFER_WRITE_BIT,
875879
VK_IMAGE_LAYOUT_UNDEFINED,
876-
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
880+
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
881+
subresource_range);
877882

878883
// Prepare ray tracing output image as transfer source
879884
vkb::image_layout_transition(draw_cmd_buffers[i],

0 commit comments

Comments
 (0)