Re: glVertexAttribPointer performance
Brian Paul <[email protected]>
| Newsgroups | gmane.comp.video.mesa3d.user |
|---|---|
| Message-ID | <[email protected]> |
On 12/14/2018 02:08 AM, Pierre-Olivier Konecki wrote: > Hello, > > I'm currently developping some kind of Vulkan backed driver for OpenGL > and I was wondering how mesa devs handled glVertexAttribPointer data > when not using a VBO and passing a pointer to vertex data. In my > implementation I copy the data every frame and upload it to the GPU, > which is not ideal when the data is always the same. Is there some kind > of optimization trick in mesa for this? Not really. If the vertex data are not stored in a VBO, it's hard to know if the application changed the data between draw calls. So in the end, drivers typically wind up (re-)copying the data into GPU memory, unless the GPU can directly read from the user space. I suppose one could try caching such data and use some sort of hash/checksum to see if it's changed to avoid re-uploading, but that's something we haven't done. > If you have any other knowledge of performance trick used in mesa, I > would gladly hear about it too. I don't know if there's any tricks. A lot of it boils down to profiling applications, finding bottlenecks, and trying to improve the code accordingly. In some cases, applications are just poorly written and not much can be done about that. -Brian _______________________________________________ mesa-users mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-users