Skip to content

Commit eb64a9a

Browse files
committedNov 30, 2024·
Add update_buffer_inline function.
1 parent e4b27bd commit eb64a9a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
 

‎vulkan/command_buffer.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -2247,6 +2247,12 @@ void *CommandBuffer::update_buffer(const Buffer &buffer, VkDeviceSize offset, Vk
22472247
return data.host;
22482248
}
22492249

2250+
void CommandBuffer::update_buffer_inline(const Buffer &buffer, VkDeviceSize offset, VkDeviceSize size, const void *data)
2251+
{
2252+
VK_ASSERT(size <= 64 * 1024);
2253+
table.vkCmdUpdateBuffer(cmd, buffer.get_buffer(), offset, size, data);
2254+
}
2255+
22502256
void *CommandBuffer::update_image(const Image &image, const VkOffset3D &offset, const VkExtent3D &extent,
22512257
uint32_t row_length, uint32_t image_height,
22522258
const VkImageSubresourceLayers &subresource)

‎vulkan/command_buffer.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,8 @@ class CommandBuffer : public Util::IntrusivePtrEnabled<CommandBuffer, CommandBuf
500500
void *allocate_index_data(VkDeviceSize size, VkIndexType index_type);
501501

502502
void *update_buffer(const Buffer &buffer, VkDeviceSize offset, VkDeviceSize size);
503+
void update_buffer_inline(const Buffer &buffer, VkDeviceSize offset, VkDeviceSize size,
504+
const void *data);
503505
void *update_image(const Image &image, const VkOffset3D &offset, const VkExtent3D &extent, uint32_t row_length,
504506
uint32_t image_height, const VkImageSubresourceLayers &subresource);
505507
void *update_image(const Image &image, uint32_t row_length = 0, uint32_t image_height = 0);

0 commit comments

Comments
 (0)