* Old method gave:
error X8000: D3D11 Internal Compiler Error: Invalid Bytecode: Instructions
calculating derivatives across pixels, and using temp storage or indexed
values for input coordinates, are not permitted within flow control that
has a branch condition that could vary across pixels. Opcode 53 (count is
1-based).
* It seemed related to taking ddx() of things like SV_CullDistance inside
the if(), so I refactored to not branch, and instead just avoid the
InterlockedAdd only and when not a hit it will just write to an ignored
element at the end of the UAV.
* GLenum enum now lists all GL_ before GLX_ and WGL_ to give priority for
string representation.
* Also dropped eGL_UNKNOWN_ENUM for eGL_NONE as it's a little friendlier
* 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).