summaryrefslogtreecommitdiff
path: root/Runtime/Graphics/VertexAttribute.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-10-31 14:27:26 +0800
committerchai <chaifix@163.com>2021-10-31 14:27:26 +0800
commit601442f94fc0dcfdc5a117c5f87d90b156d53045 (patch)
treeb006bcd6a28a965a900c64f4716007fcb45eee98 /Runtime/Graphics/VertexAttribute.h
parent26f05c6e3dcac9995345fb5a2b031be7e3ea79e9 (diff)
+static initiator
Diffstat (limited to 'Runtime/Graphics/VertexAttribute.h')
-rw-r--r--Runtime/Graphics/VertexAttribute.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/Runtime/Graphics/VertexAttribute.h b/Runtime/Graphics/VertexAttribute.h
index 4e50a1a..2757c70 100644
--- a/Runtime/Graphics/VertexAttribute.h
+++ b/Runtime/Graphics/VertexAttribute.h
@@ -21,6 +21,15 @@ enum VertexAttrFormat
struct VertexAttributeDescriptor
{
+ //union {
+ const void* pointer; // 内存地址,刚创建时留空
+ int startOffset; // 显存中相对VBO的偏移值
+ //};
+ uint componentNum; // 向量维度1,2,3,4
+ uint componentFormat; // 每个分量的类型
+ uint16 stride; // 间隔
+ bool normalize; // 是否归一化,只用于CustomVertexLayout
+
// for default vertex layout
VertexAttributeDescriptor() {}
// for custom vertex layout
@@ -33,14 +42,6 @@ struct VertexAttributeDescriptor
normalize = normalized;
}
- union {
- const void* pointer; // 内存地址或显存中相对VBO的偏移值
- int startOffset;
- };
- uint componentNum; // 向量维度1,2,3,4
- uint componentFormat; // 每个分量的类型
- uint16 stride; // 间隔
- bool normalize; // 是否归一化,只用于CustomVertexLayout
};
namespace VertexAttribute