summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2023-02-17 09:24:26 -0800
committer3gg <3gg@shellblade.net>2023-02-17 09:24:26 -0800
commit9a22d4eb956e6eadc488fa3f4c336a0b2b2dda55 (patch)
treea3c4216fe15b0d6a56ae8968c77aeca851da4c40
parenta58dbb9081a08b01931badd953ed1fe6cd5bd1c7 (diff)
Fix sizeof calculations in gfx_make_buffer().
-rw-r--r--gfx/src/render/render_backend.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gfx/src/render/render_backend.c b/gfx/src/render/render_backend.c
index 0fc8c85..b3f832b 100644
--- a/gfx/src/render/render_backend.c
+++ b/gfx/src/render/render_backend.c
@@ -117,19 +117,19 @@ Buffer* gfx_make_buffer(
117Buffer* gfx_make_buffer2d( 117Buffer* gfx_make_buffer2d(
118 RenderBackend* render_backend, const vec2* verts, size_t count) { 118 RenderBackend* render_backend, const vec2* verts, size_t count) {
119 return gfx_make_buffer( 119 return gfx_make_buffer(
120 render_backend, (const void*)verts, count * sizeof(verts)); 120 render_backend, (const void*)verts, count * 2 * sizeof(float));
121} 121}
122 122
123Buffer* gfx_make_buffer3d( 123Buffer* gfx_make_buffer3d(
124 RenderBackend* render_backend, const vec3* verts, size_t count) { 124 RenderBackend* render_backend, const vec3* verts, size_t count) {
125 return gfx_make_buffer( 125 return gfx_make_buffer(
126 render_backend, (const void*)verts, count * sizeof(verts)); 126 render_backend, (const void*)verts, count * 3 * sizeof(float));
127} 127}
128 128
129Buffer* gfx_make_buffer4d( 129Buffer* gfx_make_buffer4d(
130 RenderBackend* render_backend, const vec4* verts, size_t count) { 130 RenderBackend* render_backend, const vec4* verts, size_t count) {
131 return gfx_make_buffer( 131 return gfx_make_buffer(
132 render_backend, (const void*)verts, count * sizeof(verts)); 132 render_backend, (const void*)verts, count * 4 * sizeof(float));
133} 133}
134 134
135Buffer* gfx_make_bufferu8( 135Buffer* gfx_make_bufferu8(