diff options
author | 3gg <3gg@shellblade.net> | 2023-02-17 09:24:26 -0800 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2023-02-17 09:24:26 -0800 |
commit | 9a22d4eb956e6eadc488fa3f4c336a0b2b2dda55 (patch) | |
tree | a3c4216fe15b0d6a56ae8968c77aeca851da4c40 | |
parent | a58dbb9081a08b01931badd953ed1fe6cd5bd1c7 (diff) |
Fix sizeof calculations in gfx_make_buffer().
-rw-r--r-- | gfx/src/render/render_backend.c | 6 |
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( | |||
117 | Buffer* gfx_make_buffer2d( | 117 | Buffer* 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 | ||
123 | Buffer* gfx_make_buffer3d( | 123 | Buffer* 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 | ||
129 | Buffer* gfx_make_buffer4d( | 129 | Buffer* 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 | ||
135 | Buffer* gfx_make_bufferu8( | 135 | Buffer* gfx_make_bufferu8( |