* If the application incorrectly calls WSACleanup() before WSAStartup()
then instead of just an error for invalid use, it will instead kill
all of the sockets we created from our early WSAStartup().
* To fix this, we hook those functions and track the process wide ref-
count, to prevent it from every going to 0 until we shut down our own.
* This was found on GTA 5 in particular but possibly some other
application will do this too.
* Still no plans to support these, but at least this will allow them to
be queried for. This might happen if e.g. an extension loader or old
bit of code just loads all functions unconditionally and might error
if one of these functions isn't found, even if it has no intention of
actually calling it.
* If we're only compressing 2D blocks the compressed block depth can be
0 and that's totally valid. We can't unconditionally divide through,
so sanitise inputs to make sure calculations are sensible.
* During capture if there was no unpack buffer we made sure that any
unpack state was applied during serialisation (as this makes sure that
we have a small set of data to serialise and don't have to serialise
loads of padding because of SKIP_ROWS or a large ROW_LENGTH)
* The flipside though is that it means on replay the pixel unpack state
might be set still with some configuration that we've already applied.
So instead we reset it back to identity before replaying any SubImage
call.
* Since buffers can be referenced indirectly on the GPU by their GPU
address, there's no feasible way to know if the buffer is actually
used or not. If an ExecuteIndirect is seen at all we just have to
pessimistically include all buffers.
* Generally textures take up the bulk of VRAM usage, so this likely
won't be too bad.
* Historically there was no bindpoint mapping so it was convenient to
just pad the cbuffers array so that the elements in it were indexed by
their bind point. It doesn't make any sense anymore especially with
D3D12's bind model, so just remove it and roll bind points into a
struct member.
Add the <math.h> header to some of the source files for the target
qrenderdoc. The build would not have succeded without these headers
declaration under Arch Linux/clang++.