* 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.
* If you're capturing and replaying on the same driver it's insanely
unlikely that this translation will be anything other than the identity
map, although it wouldn't be illegal to renumber locations. However this
should allow moving captures between vendors/driver versions/platforms,
which in the past wasn't possible because locations would change (quite
validly) when the programs were recompiled. There might be other issues,
but at least this one is fixed.
* This won't work if the feedback is started before the captured frame then
captured inside it, either by being paused or actually active across the
SwapBuffers call.
* Note that the uniform subroutines are saved and restored by the render
state, but they are not properly restored anywhere where we fetch &
restore the current program. Will probably need a special helper class
to push/pop that correctly.
* We want the application to pass us real GLSL shaders so we can do all
kinds of juicy things to them. This is generally indicated by the program
having a LINK_STATUS of FALSE or similar, and we can pretty much get that
by just not passing through the call.
* This means that all APIs pass byte string types. ALL strings everywhere
in the entire codebase must be assumed to be and treated as UTF-8 content
not ASCII.
* Gets rid of all the horrible %hs specifiers that caused warnings on
linux! Hooray.
* We convert to wide strings, or use wide characters, only when necessary
to use the Win32 API. Some windows specific code will stay in wide chars
just for convenience.
* Files are already serialised as UTF-8 strings for linux/windows binary
compatibility, so this change doesn't break backwards compatibility.
* For APIs where the shader namespace/bindpoint (which may be arbitrary
like 'the Nth texture resource' can be mapped, at each event, to the
actual API bind point where the object is.
* On D3D11 this is pass-through, on GL this returns the value of each
uniform.
* This also means GL shader reflection structures are properly immutable
and the variance in the uniform values is handled elsewhere.
* In future this might need to be expanded to support more complex binding
methods, where the mapping returns the resource rather than just mapping
to an integer bind ponit.
* Need to find a better way of solving the non-immutable-shader-reflection
given baked in uniform values. Probably expose the uniform values mapping
to the user, and for D3D it just becomes trivial and unchanging.
* Also I need to create separable programs per-shader for use for
reflection in that case, but thanks to the stupid gl_PerVertex
redeclaration that becomes a nightmare.
* This lets us distinguish framebuffer object 1 on context A from
FBO 1 on context B.
* At the moment we assume that all shareable objects are shared between
all contexts. I think this is sensible and fairly common, but it will
break if some contexts don't share as the objects will alias.
* Remove legacy wrapped functions that were only hacked-in to get
glxgears working as a proof of concept.
* Split out groups of wrapped functions into separate files by type