From b7fe7626b88a15e9c91e83ab9778db0ca5ebace9 Mon Sep 17 00:00:00 2001 From: HuYingzhuo Date: Tue, 16 Apr 2019 14:58:10 +0800 Subject: [PATCH] =?UTF-8?q?RenderSurface::CreateBuffer=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=A3=80=E6=B5=8B=E5=92=8C=E6=8A=A5=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/Vulkan/RenderSurface.cpp | 11 +++++++++-- example/Vulkan/VK.h | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/example/Vulkan/RenderSurface.cpp b/example/Vulkan/RenderSurface.cpp index 2c0f8298..cc89729c 100644 --- a/example/Vulkan/RenderSurface.cpp +++ b/example/Vulkan/RenderSurface.cpp @@ -55,11 +55,18 @@ namespace VertexBuffer *RenderSurface::CreateBuffer(VkBufferUsageFlags buf_usage,VkFormat format,uint32_t count,VkSharingMode sharing_mode) { - VulkanBuffer vb; - const uint32_t stride=GetStrideByFormat(format); + + if(stride==0) + { + std::cerr<<"format["<; #ifdef _DEBUG -bool CheckStrideBytesByFormat(); +bool CheckStrideBytesByFormat(); ///<检验所有数据类型长度数组是否符合规则 #endif//_DEBUG -uint32_t GetStrideByFormat(const VkFormat &); +uint32_t GetStrideByFormat(const VkFormat &); ///<根据数据类型获取访类型单个数据长度字节数 inline void debug_out(const hgl::List &layer_properties) {