From: Karmjit Mahil Date: Wed, 27 Jul 2022 15:25:00 +0000 (+0100) Subject: pvr: Implement vkCmdUpdateBuffer(). X-Git-Tag: upstream/23.3.3~9830 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=96b6b69d8a59b226f41e3faf82380f0a6d016d93;p=platform%2Fupstream%2Fmesa.git pvr: Implement vkCmdUpdateBuffer(). Signed-off-by: Karmjit Mahil Acked-by: Frank Binns Part-of: --- diff --git a/src/imagination/vulkan/pvr_blit.c b/src/imagination/vulkan/pvr_blit.c index e25da8e..9552f86 100644 --- a/src/imagination/vulkan/pvr_blit.c +++ b/src/imagination/vulkan/pvr_blit.c @@ -70,51 +70,6 @@ void pvr_CmdCopyImage2KHR(VkCommandBuffer commandBuffer, assert(!"Unimplemented"); } -void pvr_CmdUpdateBuffer(VkCommandBuffer commandBuffer, - VkBuffer dstBuffer, - VkDeviceSize dstOffset, - VkDeviceSize dataSize, - const void *pData) -{ - assert(!"Unimplemented"); -} - -void pvr_CmdFillBuffer(VkCommandBuffer commandBuffer, - VkBuffer dstBuffer, - VkDeviceSize dstOffset, - VkDeviceSize fillSize, - uint32_t data) -{ - assert(!"Unimplemented"); -} - -void pvr_CmdCopyBufferToImage2KHR( - VkCommandBuffer commandBuffer, - const VkCopyBufferToImageInfo2 *pCopyBufferToImageInfo) -{ - assert(!"Unimplemented"); -} - -void pvr_CmdClearColorImage(VkCommandBuffer commandBuffer, - VkImage _image, - VkImageLayout imageLayout, - const VkClearColorValue *pColor, - uint32_t rangeCount, - const VkImageSubresourceRange *pRanges) -{ - assert(!"Unimplemented"); -} - -void pvr_CmdClearDepthStencilImage(VkCommandBuffer commandBuffer, - VkImage image_h, - VkImageLayout imageLayout, - const VkClearDepthStencilValue *pDepthStencil, - uint32_t rangeCount, - const VkImageSubresourceRange *pRanges) -{ - assert(!"Unimplemented"); -} - static struct pvr_transfer_cmd * pvr_transfer_cmd_alloc(struct pvr_cmd_buffer *cmd_buffer) { @@ -248,6 +203,67 @@ static VkResult pvr_cmd_copy_buffer_region(struct pvr_cmd_buffer *cmd_buffer, return VK_SUCCESS; } +void pvr_CmdUpdateBuffer(VkCommandBuffer commandBuffer, + VkBuffer dstBuffer, + VkDeviceSize dstOffset, + VkDeviceSize dataSize, + const void *pData) +{ + PVR_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer); + PVR_FROM_HANDLE(pvr_buffer, dst, dstBuffer); + struct pvr_bo *pvr_bo; + VkResult result; + + PVR_CHECK_COMMAND_BUFFER_BUILDING_STATE(cmd_buffer); + + result = pvr_cmd_buffer_upload_general(cmd_buffer, pData, dataSize, &pvr_bo); + if (result != VK_SUCCESS) + return; + + pvr_cmd_copy_buffer_region(cmd_buffer, + pvr_bo->vma->dev_addr, + 0, + dst->dev_addr, + dstOffset, + dataSize); +} + +void pvr_CmdFillBuffer(VkCommandBuffer commandBuffer, + VkBuffer dstBuffer, + VkDeviceSize dstOffset, + VkDeviceSize fillSize, + uint32_t data) +{ + assert(!"Unimplemented"); +} + +void pvr_CmdCopyBufferToImage2KHR( + VkCommandBuffer commandBuffer, + const VkCopyBufferToImageInfo2 *pCopyBufferToImageInfo) +{ + assert(!"Unimplemented"); +} + +void pvr_CmdClearColorImage(VkCommandBuffer commandBuffer, + VkImage _image, + VkImageLayout imageLayout, + const VkClearColorValue *pColor, + uint32_t rangeCount, + const VkImageSubresourceRange *pRanges) +{ + assert(!"Unimplemented"); +} + +void pvr_CmdClearDepthStencilImage(VkCommandBuffer commandBuffer, + VkImage image_h, + VkImageLayout imageLayout, + const VkClearDepthStencilValue *pDepthStencil, + uint32_t rangeCount, + const VkImageSubresourceRange *pRanges) +{ + assert(!"Unimplemented"); +} + void pvr_CmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2 *pCopyBufferInfo) { diff --git a/src/imagination/vulkan/pvr_private.h b/src/imagination/vulkan/pvr_private.h index 2a40d53..7e5d054 100644 --- a/src/imagination/vulkan/pvr_private.h +++ b/src/imagination/vulkan/pvr_private.h @@ -1285,15 +1285,6 @@ VkResult pvr_cmd_buffer_alloc_mem(struct pvr_cmd_buffer *cmd_buffer, uint64_t size, uint32_t flags, struct pvr_bo **const pvr_bo_out); -VkResult pvr_cmd_buffer_upload_pds(struct pvr_cmd_buffer *const cmd_buffer, - const uint32_t *data, - uint32_t data_size_dwords, - uint32_t data_alignment, - const uint32_t *code, - uint32_t code_size_dwords, - uint32_t code_alignment, - uint64_t min_alignment, - struct pvr_pds_upload *const pds_upload_out); void pvr_calculate_vertex_cam_size(const struct pvr_device_info *dev_info, const uint32_t vs_output_size, @@ -1421,6 +1412,15 @@ VkResult pvr_cmd_buffer_upload_general(struct pvr_cmd_buffer *const cmd_buffer, const void *const data, const size_t size, struct pvr_bo **const pvr_bo_out); +VkResult pvr_cmd_buffer_upload_pds(struct pvr_cmd_buffer *const cmd_buffer, + const uint32_t *data, + uint32_t data_size_dwords, + uint32_t data_alignment, + const uint32_t *code, + uint32_t code_size_dwords, + uint32_t code_alignment, + uint64_t min_alignment, + struct pvr_pds_upload *const pds_upload_out); VkResult pvr_cmd_buffer_start_sub_cmd(struct pvr_cmd_buffer *cmd_buffer, enum pvr_sub_cmd_type type);