* http://blog.selfshadow.com/2012/11/12/counting-quads/
* Quad Overdraw based on ScenePS4 from the revised implementation. The
colours are new, up to 20 levels. Picking pixels shows the overdraw level
* Available per-pass and per-drawcall, a pass defined the same way as in
the mesh view, drawcalls since last clear or RT change.
* List of events now passed through to RenderOverlay the same as RenderMesh
* VAO initial state is not working yet - it gets reverted because the VAOs
aren't marked as dirty (ie. initial state not needed because replay is
accurate at the first replay, not out of sync) and not marked as written
mid-frame (ie. restarting and replaying again shouldn't be out of sync as
nothing was changed).
* Allows drivers to store a blob of data instead of just a ResourceType
object for storing initial contents. The ResourceManager takes ownership
of the memory and delete[]s it when it's done.
* It's unfortunate to have to use program introspection so heavily like
this (perhaps there should be a GL-specific shader reflection structure
like DXBC where these locations and strides could be cached), but it's
not too bad and handles any arbitrary layout
* 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.
* Bail if we find an IAT entry already hooked as it means this module has
been processed already.
* Avoid allocations/std::string in the ApplyHooks function.
* We can't use the uniform locations from our separable program as that's
not guaranteed to be the same in the real program (could end up reading
a completely different uniform value).
* This avoids going into VirtualProtect changing the page access while code
may potentially be executing these areas of memory (since the module is
hooked, and may have returned to user code)