* When binding an empty texture, sanitise the parameters so we don't
pass invalid enums for access/format.
* When fetching, actually use the indexed Get functions to get the right
slot. Ooops :S.
* GL_MIN_MAP_BUFFER_ALIGNMENT is now satisfied (up to 64), and from reading
the spec, yes the mip dimensions have to be defined as standard, you
can't define just some crazy custom mip chain sizes as that's invalid.
* For every texture unit in GL, you can have one of each texture bound to
it. So you can bind a 2d and a 3d to slot 5, and as long as you don't
try to use both at once, you can use one in one shader, one in another,
without needing to rebind. So the state vector we need to save includes
every type of texture.
* I think, from checking against the spec tables, this should be the entire
state vector saved now for core 4.5. There might still be some extension
state not saved.
* Note in some cases we still unconditionally return an object (like
ID3D11InfoQueue) just for compatibility's sake if it's pretty ubiquitous
and programs might expect it to always be there. This change however will
stop us from reporting interfaces that might actually not be HW or OS
supported.
* e.g. class instances only crazy people use, so there's no point to have
it eating up a ton of space when 99.9% of the time it's empty. Also
the border colour in samplers is only listed if the addressing is set to
use the border colour.
* I also collapsed down some of the columns to make it a little simpler
visually, like min lod/max lod become just "lod clamp" with a range, and
constant buffers simplified down to a couple of columns.
* When jumping between draws the tables are rebuilt which destroys any
vertical scrolling, so we save/restore it which means the same row will
be at the top of the view. If there are fewer resources it'll just be
as scrolled down as possible.
* Even though this is latched state from glClearColor etc, this means we
don't have to list that in the pipeline state, we can just show it here
where it's relevant.
* If we generate an unmap chunk on a buffer while idle, it contains
'dangerous' data set at that point - it means that if we fetch the buffer
initial contents at frame start, these are actually saved *before* the
unmap chunk, in the initialisation/creation chunk which contains the
shadow copy. Then the unmap overwrites with older data.
* When mapping buffers, we should always either update the initial chunk or
mark the buffer dirty so the initial chunk is refreshed on capture.
* This was changed in commit 99c6719928 and
was probably ok before then (although going into the serialise function
was unnecessary and did some redundant copies into a chunk we were going
to throw away). I'm not sure why I made that change, if it was to fix a
bug I can't understand how. I guess I'll see if anything breaks.
* We were allowing *any* difference between depth and render targets, but
that's not quite right. Oversized depth is fine, but e.g. mismatched
multisampled and not is invalid.
* We also take frame references on invalid attempted OM sets, so that the
targets don't get trimmed from the log and potentially make the set valid
* This will allow the adding of things like 'redundant api call' for calls
that have no effect, as well as potential problems like drawing with an
empty viewport, or similar things that are common problems. Reading out-
of-bounds on buffers etc is a good example of 'defined' behaviour that
is probably not desired.
* These heuristics could also identify potential performance problems.
* It also supports adding debug messages after log-load time, so you could
do an additional extra-strength pass, or do a detailed check of one
draw call (e.g. a broken draw, to try and figure out the problem). If
there are any unread debug messages, the status bar will flash and the
debug messages window will show a count as (N).
* This allows 'partial' rows in the mesh viewer, if a vertex input element
references invalid/out of bounds data, but the others are fine (coming
from different streams).
* When idle if we map a resource that doesn't have backing store (like a
texture that wasn't initialised on creation) we create shadow storage
for the map. We only need it temporarily, so make sure to free it after
we unmap, otherwise it will stick around for hte lifetime of that
resource (!).