* This could lead to a crash at least on vulkan, where the memcpy reads
off the end of the data. On GL this could mean the index data doesn't
get read back.
* I got a crash report that seemed to have a file become invalid or
unavailable in between it being opened to determine the driver (which
already handles I/O failures) and the driver opening it. This check
just makes that more robust
indexes with a size less than uint32 were being ugpraded to uint32,
but the buffer range size was still dependent on the original width.
Before this change, when doing selection on indexed meshes with a
width of 2, the second half of the mesh would be unpickable.
The new vertex picking solution raycasts from the mouse's position,
picking vertices based on
1. The triangle it has intersected (take the nearest triangle)
2. The nearest vertex to the intersection point on the triangle
This is replacing a solution that was based on how close the vertex was
to the mouse in screen space and its depth.
This commit only supports the OpenGL path in the VS Input window.
I have disabled vertex picking in Vulkan for now, as there are some
cross dependencies (debuguniforms.h).
* Pixel shader debugging was right by coincidence because it replayed
the drawcall, but technically that could produce incorrect results as
we would then pick up UAV contents from after the draw, not before.
* This also fixes the problem of capturing 32-bit programs with 64-bit
RenderDoc failing to properly insert environment variables and
error'ing when it tries to do it directly.
For example ASTC/ETC2 textures in Vulkan need to be forced to RGBA8 to be
displayed by D3D11.
IReplayDriver has virtual method IsTextureFormatSupported(ResourceFormat)
so each API can decide if a format should be converted.
Parameters to GetTextureData() are moved to a struct, to save any
non-default behaviour needed for fetching texture data into the proxy.
MakeDXGIFormat now returns DXGI_FORMAT_UNKNOWN for unsupported formats
instead of asserting. We use this to determine whether to remap.
* If a buffer is used as a texbuffer, or a texture as a view, then any
time the underlying data is dirty and needs to be saved as initial
contents but the data object is never referenced directly (only the
view), we need to force the underlying data object to have initial
contents.
* This fixes a couple of cases - the case where a buffer is modified
mid frame would not properly have its contents reset each frame
* Also any buffer that isn't modified during the frame would have its
initial contents overwritten by some partially recorded updates before
a buffer was marked as high traffic/dirty.