Skip to content

Commit

Permalink
Add update_buffer_inline function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Themaister committed Nov 30, 2024
1 parent e4b27bd commit eb64a9a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vulkan/command_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2247,6 +2247,12 @@ void *CommandBuffer::update_buffer(const Buffer &buffer, VkDeviceSize offset, Vk
return data.host;
}

void CommandBuffer::update_buffer_inline(const Buffer &buffer, VkDeviceSize offset, VkDeviceSize size, const void *data)
{
VK_ASSERT(size <= 64 * 1024);
table.vkCmdUpdateBuffer(cmd, buffer.get_buffer(), offset, size, data);
}

void *CommandBuffer::update_image(const Image &image, const VkOffset3D &offset, const VkExtent3D &extent,
uint32_t row_length, uint32_t image_height,
const VkImageSubresourceLayers &subresource)
Expand Down
2 changes: 2 additions & 0 deletions vulkan/command_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ class CommandBuffer : public Util::IntrusivePtrEnabled<CommandBuffer, CommandBuf
void *allocate_index_data(VkDeviceSize size, VkIndexType index_type);

void *update_buffer(const Buffer &buffer, VkDeviceSize offset, VkDeviceSize size);
void update_buffer_inline(const Buffer &buffer, VkDeviceSize offset, VkDeviceSize size,
const void *data);
void *update_image(const Image &image, const VkOffset3D &offset, const VkExtent3D &extent, uint32_t row_length,
uint32_t image_height, const VkImageSubresourceLayers &subresource);
void *update_image(const Image &image, uint32_t row_length = 0, uint32_t image_height = 0);
Expand Down

0 comments on commit eb64a9a

Please sign in to comment.