diff options
author | chai <chaifix@163.com> | 2021-10-28 00:47:35 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-10-28 00:47:35 +0800 |
commit | 1b6f71b2777bdc74d63f988346a8cfee766718b0 (patch) | |
tree | ae710ba057f4841e7d0911eb4d3e0c346f79a524 /Runtime/Graphics/VertexBuffer.h | |
parent | 305ca0a09d4e750186b5190432de47f3493e806a (diff) |
+DefaultVertexLayout
Diffstat (limited to 'Runtime/Graphics/VertexBuffer.h')
-rw-r--r-- | Runtime/Graphics/VertexBuffer.h | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/Runtime/Graphics/VertexBuffer.h b/Runtime/Graphics/VertexBuffer.h index b38b0b6..05aa16c 100644 --- a/Runtime/Graphics/VertexBuffer.h +++ b/Runtime/Graphics/VertexBuffer.h @@ -8,21 +8,8 @@ #include "OpenGL.h" #include "GPUDataBuffer.h" - -// 默认的顶点属性,够用了 -enum EVertexAttr -{ - VertexAttr_Position = 0, - VertexAttr_Normal, - VertexAttr_Tangent, - VertexAttr_Color, - VertexAttr_UV, - VertexAttr_UV2, - VertexAttr_UV3, - VertexAttr_UV4, - - VertexAttr_Count -}; +#include "DefaultVertexLayout.h" +#include "CustomVertexLayout.h" enum EPrimitive { @@ -31,22 +18,6 @@ enum EPrimitive Primitive_Point = 3, }; -struct VertexAttributeDescriptor -{ - const void* pointer; // 内存或显存 - uint componentType; - uint componentNum; - uint16 stride; -}; - -// GPU侧的顶点属性 -struct VertexDataInfo -{ - uint32 enableMask; - GLuint buffer; - VertexAttributeDescriptor attributes[VertexAttr_Count]; -}; - class VertexBuffer { public: @@ -63,7 +34,6 @@ public: void Draw(); private: - VertexBufferType m_Type; GPU::DataBuffer *m_VB; GPU::DataBuffer *m_IB;// vertex buffer and index buffer @@ -83,7 +53,7 @@ public: private: - void FillVertexArrayInfo(VertexDataInfo& dst); + void FillVertexDataInfo(DefaultVertexLayout& dst); void Clean(); |