Cache VAOs between runs.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 4 Jul 2017 23:06:12 +0000 (01:06 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 4 Jul 2017 23:10:57 +0000 (01:10 +0200)
commit2d8043bb837b45c9ae509450b3e1b1eb545e44b9
tree0e9b1718770fe9dd774a3a34654463ae6c326b19
parent7ff8195d27166151be38d637ae4b2633d4b39556
Cache VAOs between runs.

NVIDIA's drivers (at least the Linux drivers) seem to have a bug
where, if you call glVertexAttribPointer() in one thread together
with some specific activity in another thread (at least another
glVertexAttribPointer() will do, but I've also seen it during
glXSwapBuffers()), it will try to free a non-malloced pointer,
crashing everything. This happens very rarely, but often enough
that it's a real problem for Nageru.

We solve it by simply pre-creating all needed VAOs ahead-of-time
and caching them, which makes us call glVertexAttribPointer()
a _lot_ less often (basically never, instead of several times
per frame). This might actually be a bit slower than the old code
(I haven't tested), but at least it works around the driver bug.

ABI break, unfortunately, but no API break.
effect_chain.cpp
effect_chain.h
resource_pool.cpp
resource_pool.h
version.h