From 9a22d4eb956e6eadc488fa3f4c336a0b2b2dda55 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Fri, 17 Feb 2023 09:24:26 -0800 Subject: Fix sizeof calculations in gfx_make_buffer(). --- gfx/src/render/render_backend.c | 6 +++--- 1 file 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( Buffer* gfx_make_buffer2d( RenderBackend* render_backend, const vec2* verts, size_t count) { return gfx_make_buffer( - render_backend, (const void*)verts, count * sizeof(verts)); + render_backend, (const void*)verts, count * 2 * sizeof(float)); } Buffer* gfx_make_buffer3d( RenderBackend* render_backend, const vec3* verts, size_t count) { return gfx_make_buffer( - render_backend, (const void*)verts, count * sizeof(verts)); + render_backend, (const void*)verts, count * 3 * sizeof(float)); } Buffer* gfx_make_buffer4d( RenderBackend* render_backend, const vec4* verts, size_t count) { return gfx_make_buffer( - render_backend, (const void*)verts, count * sizeof(verts)); + render_backend, (const void*)verts, count * 4 * sizeof(float)); } Buffer* gfx_make_bufferu8( -- cgit v1.2.3