leod / posh

Type-Safe Graphics Programming with Functional Shaders
136 stars 2 forks source link

Investigate performance impact of vertex array and framebuffer rebinding #119

Open leod opened 1 year ago

leod commented 1 year ago

Currently, for convenience, we just have a single global VAO and a single global framebuffer whose attachments are updated in each draw call. We need to check if this has performance implications.

Note that we do not want to expose these objects to the user-facing API, since having to maintain them makes the API more cumbersome. However, we could consider to have an internal caching layer. IIRC, glium does this for vertex arrays.

leod commented 1 year ago

Note that Mozilla's WebGL best practices say this:

I'm not sure what the exact overhead of this is. I'm fine with a small amount of per-draw-call overhead, but pipeline stalls must be avoided.