From 1924f6cf2c16e50546916125a07f8092c4fb5e13 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Fri, 21 Jun 2019 16:44:22 +0800 Subject: [PATCH] =?UTF-8?q?CommandBuffer=E5=A2=9E=E5=8A=A0CopyImageToBuffe?= =?UTF-8?q?r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/Vulkan/Atomsphere.cpp | 2 +- inc/hgl/graph/vulkan/VKCommandBuffer.h | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/example/Vulkan/Atomsphere.cpp b/example/Vulkan/Atomsphere.cpp index 78033300..a990a27b 100644 --- a/example/Vulkan/Atomsphere.cpp +++ b/example/Vulkan/Atomsphere.cpp @@ -56,7 +56,7 @@ private: void CreateRenderObject() { - ro_sphere=CreateRenderableSphere(db,material,16); + ro_sphere=CreateRenderableSphere(db,material,128); } bool InitAtomsphereUBO(vulkan::DescriptorSets *desc_set,uint bindpoint) diff --git a/inc/hgl/graph/vulkan/VKCommandBuffer.h b/inc/hgl/graph/vulkan/VKCommandBuffer.h index bf045771..daf4579d 100644 --- a/inc/hgl/graph/vulkan/VKCommandBuffer.h +++ b/inc/hgl/graph/vulkan/VKCommandBuffer.h @@ -66,11 +66,21 @@ public: VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, - const VkBufferImageCopy* pRegions) + const VkBufferImageCopy * pRegions) { vkCmdCopyBufferToImage(cmd_buf,srcBuffer,dstImage,dstImageLayout,regionCount,pRegions); } + void CopyImageToBuffer( + VkImage srcImage, + VkImageLayout srcImageLayout, + VkBuffer dstBuffer, + uint32_t regionCount, + const VkBufferImageCopy * pRegions) + { + vkCmdCopyImageToBuffer(cmd_buf,srcImage,srcImageLayout,dstBuffer,regionCount,pRegions); + } + bool BeginRenderPass(RenderPass *rp,Framebuffer *fb); bool Bind(Pipeline *p)