* If GL_NEAREST is specified it means the whole mip chain is locked off,
even if we do textureLod in the shader.
* Instead, go back to using GL_NEAREST_MIPMAP_NEAREST and clamp the
MAX_LEVEL to make the texture mipmap complete when necessary.
* We need to serialise out the new state vector that's applied when we
change context.
* Note we still have very hacky incomplete support of contexts, and no
support of true threading. We currently assume all contexts share with
all others, and if any actual parallel rendering happened it would break.
* It's handled already on the C++ side by binding a point or linear sampler
to that slot, but also it seems that it's not well defined (that I can
see) if texelFetch should sRGB decode or not. On nvidia it seems to, but
on AMD it seems like it doesn't do the decode.
* On nvidia it seems that doing glCopyImageSubData() on a D32F_S8 texture
can cause serious problems, so ignore it for now. We can generally get
away with it, as usually the only depth buffer in this format is the
'main' depth buffer, which isn't used frame-to-frame.
* If a buffer gets marked as dirty before being mapped as persistent (e.g.
mapped for write & not invalidate), we won't hit this warning and then if
the buffer map is truly persistent forever, we'll never see the map again
to warn during frame capture!
* If we're ignoring a map it's marked correctly as dirty, but otherwise a
buffer could be mapped once then not touched, not become dirty, and so
we need the unmap chunk in its record.
* We track as little state as possible - basically only objects bound to
binding points that we need to identify for old-style non-DSA functions.
This is mostly for convenience - the best balance between tracking GL's
_insane_ state vector and having to query everything we want every time.
* Although we don't properly handle multiple contexts, we need to make sure
this state is tracked per context otherwise we can get weird mismatches
and get crashes with e.g. invalid VAOs.