diff options
Diffstat (limited to 'src/ral/ral_common.c')
-rw-r--r-- | src/ral/ral_common.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/ral/ral_common.c b/src/ral/ral_common.c index 35bf15f..53e35f0 100644 --- a/src/ral/ral_common.c +++ b/src/ral/ral_common.c @@ -32,7 +32,7 @@ void VertexDesc_AddAttr(VertexDescription* builder, const char* name, VertexAttr size_t size = VertexAttribSize(type); builder->attributes[i] = type; - builder->stride += size; + // builder->stride += size; builder->attr_names[i] = name; builder->attributes_count++; @@ -59,3 +59,12 @@ size_t VertexAttribSize(VertexAttribType attr) { break; } } + +size_t VertexDesc_CalcStride(VertexDescription* desc) { + size_t stride = 0; + for (int i = 0; i < desc->attributes_count; i++) { + size_t size =VertexAttribSize(desc->attributes[i]); + stride += size; + } + return stride; +} |