* This is the first attempt at backwards logfile compatibility. Since most
captures are fairly ephemeral I don't know to what degree I'll go in
future to support old captures, but since this was a fairly trivial
example (just skip serialising a bit of data if it's an old version
without it), I'll test this out.
* ld_ms has 4 operands but the operand in [3] is not a sampler and won't
have any indices.
* Speculative fix for a crash report uploaded with a crash here on a ld_ms
* Essentially when streamout'ing to a buffer a hidden counter is saved with
it that contains the number of primitives written.
* With this change we issue queries over each buffer's duration as a
stream-out target so we have those counters available when necessary.
* At the start of frame capture, we save out the current value of all those
queries, and use them if that buffer is used for a DrawAuto() without
being streamout'd to again in the captured frame.
* If a pixel unpack buffer is bound, we mark the resource as dirty when
idle. When capframing we serialise just the pointer value as offset, not
the buffer contents.
* glTexImage probably makes some assumptions about usage, at the least it
assumes that it won't be called to re-size/re-allocate textures (that
will probably break), and it also assumes that level 0 will always be
glTexImage'd and the other levels are standard mip sizes (I don't know
what happens in GL if you specify non pow-2 descending mip sizes for
different levels. Given we're only targetting core 3.2 and above, this is
probably a safe set of assumptions.
* Before, we'd remap the visible range (if the range was 0.25-0.75 this
meant 0.0 would be mapped to 'negative') before checking on negative
values, which didn't feel like the right thing for the overlay to show.
* This needs to be refactored to use the program interface query API so
we can get the location of uniform blocks and set them
* We also need to copy over sampler uniform values (getting away with it
for now as we're generally replacing the pixel shader, so there aren't
any samplers used in the cases I've tested).
* Instead of using FetchTexture we store the internal format in the texture
data in the driver, so it's available for use.
* This fixes some issues with the overlay textures
* There was a problem where a value of 1.0 would show up as 'clipping' if
the range meant that it was transformed to something like 1.0000000432f
so we use FLT_EPSILON as a slight fudge factor.
* Same implementation as D3D11 essentially
* Split out the texture sampling from texdisplay.frag into its own file so
it can be reused. Also removed the discard;s from the texture sample
functions and moved them up into the texture display function.