ULRE/example/Vulkan/VKVertexInput.h

44 lines
1.0 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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:
bool Add(VertexBuffer *,bool instance=false);
public:
const List<VkBuffer> &GetBufferList()const{return buf_list;}
};//class VertexInput
VK_NAMESPACE_END
#endif//HGL_GRAPH_VULKAN_VERTEX_INPUT_INCLUDE