I was trying to figure out how to render text using MSDF and SDL3 GPU. I’m glad so many great resources exist, and so much research has been done on the subject.
I got it to work, however I’m unsure why initially memory jumps to such a high number, while entering 4.5 million characters into the input field.
I know micro bench-marking is useless, but just wanted to apply what I learnt from my bunnymark experiment on instancing. Also, without this, I was only able to get 500 characters to show up on screen.
I have turned off resource cycling, so new data doesn’t have to pushed every frame, I just push to GPUBuffer only when input field changes, and also I fill up the SSBO only on change.
Here’s the SSBO / Structured Buffer:
Vec4 :: [4]f32
Mat4 :: matrix[4, 4]f32
SSBO_Font_Local :: struct {
model_mat : Mat4,
uv_rect : Vec4,
plane_rect : Vec4,
}
32 * 24 = 768 Bits = 96 Bytes per glyph
4,500,000 * 96 Bytes = 432000000 Bytes = 432 MB
I see App memory usage jump up to 2.58 GB, then down to 1.3 GB, before settling down at 566 MB.
Why does this jump happen?
Here’s the memory usage, before I enter the text using Dear Imgui:
And here’s after I clear the text: (I’m messing up the string builder or cstring conversion, which results in memory not being free, still investigating.)









