diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-10 23:18:22 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-10 23:18:22 +1000 |
commit | ee1b7fd3bc66501b252ce9e3e5ba89ac9aa54632 (patch) | |
tree | 47b9b1916933d76bfcc327ad2f39370833bd3712 /src/ral/ral_common.c | |
parent | 8dc076e714fad6ee6fb493360e094c4002b1584a (diff) |
more work on bindings and ral
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; +} |