Skip to content

Commit

Permalink
Merge pull request #353 from oddkiva/maint-fix-command-buffer-reset
Browse files Browse the repository at this point in the history
MAINT: fix command buffer reset.
  • Loading branch information
oddkiva authored Oct 17, 2023
2 parents f6c0bf9 + 72c14fc commit dac2a7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpp/test/Shakti/Vulkan/test_vulkan_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,21 +186,21 @@ BOOST_AUTO_TEST_CASE(test_image)
cmd_buf);
compute_queue.submit_commands(cmd_bufs);
compute_queue.wait();
cmd_bufs.reset(0);

// Copy the data from the staging buffer to the device image.
cmd_bufs.reset(0);
svk::record_copy_buffer_to_image(staging_image_buffer, image, cmd_buf);
compute_queue.submit_commands(cmd_bufs);
compute_queue.wait();

// Finally tell Vulkan that the image can only be used a read-only resource
// from a shader now on.
cmd_bufs.reset(0);
svk::record_image_layout_transition(
image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, cmd_buf);
compute_queue.submit_commands(cmd_bufs);
compute_queue.wait();
cmd_bufs.reset(0);
// Optional since the destructor calls it: but this helped to fix a bug in the
// implementation of the `clear` method.
cmd_bufs.clear();
Expand Down

0 comments on commit dac2a7e

Please sign in to comment.