* 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.
* Several places were using HGRAM_PIXELS_PER_TILE*HGRAM_PIXELS_PER_TILE
instead of HGRAM_PIXELS_PER_TILE*HGRAM_TILES_PER_BLOCK and calculating
blocks as too large. This meant histogram/minmax would miscalculate the
number of blocks needed and fail to read properly from > 2048 textures
* Technically CopySubresourceRegion should only be called for matching
types, but the handling won't change (we'll just mark dest resource as
dirty), so this fires when programs are being a bit naughty for no use.