* Seen in Metro Redux, glTexImage was used to upload a 1920x1080 32bpp
image over and over, and each chunk faithfully recorded the data. Instead
we detect when glTexImage is called with the same size parameters, no
resizing/recreation effectively occurs, so we drop the chunk and just
mark the texture as dirty to fetch the data later.
* There is still a small race condition, but worst case if it's hit then
we load a library and free it, and the only way to protect it is to lock
around FreeLibrary which is quite scary.
* When a compatibility context is created (via the old CreateContext, or
via an appropriate CreateContextAttribs call), we can still do the vendor
checks but we want to make sure we perform them again if we ever create a
core profile context. Note that actually *using* a compatibility context
isn't supported at the moment, but this won't explicitly break that.
* These values are used to show the current pipeline state (as it's
convenient to show this data with the rest of the 'state', even if it's
not state. That means they need to be set every time when executing, not
just once when reading.
* It seems like there's some buggy behaviour when mixing and matching 'old'
style vertex attrib pointer/offset functions, and the new attrib/vertex
buffer binding style (which we use in VAO initial state since it's a
superset of functionality).
* Fortunately, the spec defines exactly how VertexAttribPointer is defined
in terms of the new system, so just do the replacement ourselves.
* e.g. if the 'wrong' VAO was bound at the time we replayed a
bind-to-create chunk, then we'd trample that VAO state (and it might not
ever be restored). So when reading, not executing, save and restore the
buffer binding.
* We need to have more comprehensive frame references for several reasons
but this will handle the case where a buffer is created, bound, deleted
before the frame ends.
* This lets us detect if the FBO/VAO behaviour is different from the main
spec, and so we won't miss deletes or other events if the context is
different since we'll treat them as shared like any other object.
* This means you don't hit a debugbreak and fire an exception in profile if
you load an image file (which tries to load as a logfile first, and
fails).
* Important buffer chunks like the first glBindBuffer and glBufferStorage
could happen in the frame, so need to preserve order between those and
glTexBuffer.
* It is only replayed in READING, so once at startup - not once per frame
replay.