45 lines
1.3 KiB
C
45 lines
1.3 KiB
C
|
#ifndef HGL_GRAPH_VULKAN_VERTEX_ATTRIB_BUFFER_INCLUDE
|
|||
|
#define HGL_GRAPH_VULKAN_VERTEX_ATTRIB_BUFFER_INCLUDE
|
|||
|
|
|||
|
#include<hgl/graph/VKBuffer.h>
|
|||
|
|
|||
|
namespace hgl
|
|||
|
{
|
|||
|
namespace graph
|
|||
|
{
|
|||
|
class VertexAttribBuffer:public GPUBuffer
|
|||
|
{
|
|||
|
VkFormat format; ///<<3C><><EFBFBD>ݸ<EFBFBD>ʽ
|
|||
|
uint32_t stride; ///<<3C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>
|
|||
|
uint32_t count; ///<<3C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
private:
|
|||
|
|
|||
|
friend class GPUDevice;
|
|||
|
|
|||
|
VertexAttribBuffer(VkDevice d,const GPUBufferData &vb,VkFormat fmt,uint32_t _stride,uint32_t _count):GPUBuffer(d,vb)
|
|||
|
{
|
|||
|
format=fmt;
|
|||
|
stride=_stride;
|
|||
|
count=_count;
|
|||
|
}
|
|||
|
|
|||
|
public:
|
|||
|
|
|||
|
~VertexAttribBuffer()=default;
|
|||
|
|
|||
|
const VkFormat GetFormat()const { return format; }
|
|||
|
const uint32_t GetStride()const { return stride; }
|
|||
|
const uint32_t GetCount ()const { return count; }
|
|||
|
|
|||
|
void *Map(VkDeviceSize start=0,VkDeviceSize size=0) override
|
|||
|
{
|
|||
|
return GPUBuffer::Map(start*stride,size*stride);
|
|||
|
}
|
|||
|
};//class VertexAttribBuffer:public GPUBuffer
|
|||
|
|
|||
|
using VAB=VertexAttribBuffer;
|
|||
|
}//namespace graph
|
|||
|
}//namespace hgl
|
|||
|
#endif//HGL_GRAPH_VULKAN_VERTEX_ATTRIB_BUFFER_INCLUDE
|