2019-04-16 02:23:03 +08:00
|
|
|
|
#ifndef HGL_GRAPH_VULKAN_VERTEX_INPUT_INCLUDE
|
|
|
|
|
#define HGL_GRAPH_VULKAN_VERTEX_INPUT_INCLUDE
|
|
|
|
|
|
|
|
|
|
#include"VK.h"
|
|
|
|
|
#include"VKBuffer.h"
|
|
|
|
|
VK_NAMESPACE_BEGIN
|
|
|
|
|
/**
|
|
|
|
|
* 顶点输入配置,类似于OpenGL的VAB<br>
|
|
|
|
|
* 注:本引擎不支持一个BUFFER中包括多种数据
|
|
|
|
|
*/
|
|
|
|
|
class VertexInput
|
|
|
|
|
{
|
|
|
|
|
struct VertexInputBuffer
|
|
|
|
|
{
|
|
|
|
|
//按API,可以一个binding绑多个attrib,但我们仅支持1v1
|
|
|
|
|
|
|
|
|
|
VkVertexInputBindingDescription binding;
|
|
|
|
|
VkVertexInputAttributeDescription attrib;
|
|
|
|
|
VertexBuffer *buffer;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
VertexInputBuffer(VkVertexInputBindingDescription bind,VkVertexInputAttributeDescription attr,VertexBuffer *buf)
|
|
|
|
|
{
|
|
|
|
|
binding=bind;
|
|
|
|
|
attrib=attr;
|
|
|
|
|
buffer=buf;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ObjectList<VertexInputBuffer> vib_list;
|
|
|
|
|
List<VkBuffer> buf_list;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2019-04-17 02:26:58 +08:00
|
|
|
|
VertexInput()=default;
|
|
|
|
|
virtual ~VertexInput()=default;
|
|
|
|
|
|
2019-04-16 14:17:39 +08:00
|
|
|
|
bool Add(VertexBuffer *,bool instance=false);
|
2019-04-16 02:23:03 +08:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2019-04-16 13:21:21 +08:00
|
|
|
|
const List<VkBuffer> &GetBufferList()const{return buf_list;}
|
2019-04-16 02:23:03 +08:00
|
|
|
|
};//class VertexInput
|
|
|
|
|
VK_NAMESPACE_END
|
|
|
|
|
#endif//HGL_GRAPH_VULKAN_VERTEX_INPUT_INCLUDE
|