-
Notifications
You must be signed in to change notification settings - Fork 14
Reuse a dynamic buffer for different draw calls #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
gfx_graphics uses |
Removing the allocation would require Glium's buffers to be constructed from slices, I think. |
Is it possible to update the buffer with slices? |
It's not only a problem of slice vs vec. Creating a vertex buffer is a slightly costly operation due both to the implementation of glium (the background thread thing) and to glium/glium#478. I think that calling The most optimal implementation, in my opinion, uses two persistent buffers. This way you use the CPU to upload the data in the video memory while the GPU is drawing simultaneously. |
I can write the implementation, but we'd need something similar to gfx_graphics's But that's API-related so I think I'm going to leave this to you. |
@tomaka Just go ahead if you know what to do. If it gets similar to gfx_graphics then that's fine. |
I'll need to work on glium/glium#481 first |
I'm blocked on glium/glium#482 which is blocked on rust-lang/rust#22156 |
It seems this is already done? Closing. |
Currently it creates a new vertex buffer at each call.
It also allocates in
.collect()
when converting from a flat array to the buffer.The text was updated successfully, but these errors were encountered: