Skip to content

Commit

Permalink
Add CommandRecorder.copyBufferRanges
Browse files Browse the repository at this point in the history
  • Loading branch information
knokko committed Oct 24, 2024
1 parent 113163c commit 4ac4345
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,19 @@ public void copyBuffer(VkbBufferRange source, long vkDestBuffer, long destOffset
vkCmdCopyBuffer(commandBuffer, source.buffer().vkBuffer(), vkDestBuffer, copyRegion);
}

/**
* Calls <i>vkCmdCopyBuffer</i> to copy a <i>VkbBufferRange</i> to another <i>VkbBufferRange</i> with the same size.
* @param source The source buffer range
* @param destination The destination buffer range
* @throws IllegalArgumentException When the buffer ranges don't have the same size
*/
public void copyBufferRanges(VkbBufferRange source, VkbBufferRange destination) {
if (destination.size() != source.size()) {
throw new IllegalArgumentException("Sizes differ: " + source.size() + " and " + destination.size());
}
copyBuffer(source, destination.buffer().vkBuffer(), destination.offset());
}

/**
* Calls <i>vkCmdCopyImage</i>
* @param source The source image
Expand Down

0 comments on commit 4ac4345

Please sign in to comment.