* Depth is not cleared, only colour buffers.
* This uses the same definition of pass as the quad overdraw overlay,
which isn't quite the same as the auto-grouping passes (which allow
for varying colour binds being grouped together). It only counts up
to the last draw where the outputs were different.
* Tweaked flycam a bit too, but not much.
* Refactored the API/C# side camera classes to avoid exposing a ton of
stuff just to do relative rotations in the arcball via quaternions.
* The arcball lookat position can also be dragged with alt-click or
middle click.
* Also supports other elements as position not just magically-selected
"POSITION" element.
* We handle them mostly as a series of rows, adding only the first row
as a varying name, but incrementing the stride for each to account for
the space taken up by a matrix.
* Note at the time of committing there are still some warnings in MS
headers that you might need to suppress in a couple of files.
* 3rd party code just has the warnings suppressed for ease of merging.
* The majority of warning fixes were for local variables shadowing
other locals, function parameters, or members. In most cases they
weren't a problem, but in some cases it was potentially dangerous!
* Previously for post VS data we could maintain the index buffer by just
doing the stream-out/transform feedback for a point list with each
unique index. To maintain the index buffer we padded out any gaps in
the indices with a single value, so that we could just shift the
indices. This causes severe problems though if the indices start at 0
and contain an invalid value like 0xcccccccc - we'd allocate a huge
array and perform a massively wasteful streamout.
* Instead, we just stream out on the tightly packed list of unique
indices, then remap each 'real' index to where it is in the tightly
packed output buffer.
* This prevents arrays or cubemaps from having the slice or face index
be incorrectly modified by the mip being displayed. Thanks Xavyiy on
twitter for the report.
https://twitter.com/Xavyiy/status/574352181190594560
* GL doesn't seem to support reading both depth and stencil channels
from a single texture, so we need to do a second pass to read back
the stencil component
* Also in the HLSL version, we were indexing off the end of an array
since we were drawing 5 lines but only had 4 verts in the array.
Oops!
* We can remove D3D's OutlineStripVB, as we're doing it all in the
shader.
* Since this would be another duplicated set of code, move the variants
into common functions - each of the variants (ARB_dsa, EXT_dsa,
non-DSA and possibly MultiTex) calls into a common function just with
a different resource record.
* Handling the ARB/EXT dsa differences on the texture calls, the target
parameter is set to GL_NONE for the ARB dsa calls (which lack a target
parameter). Then in the serialise replay part, if the target is
GL_NONE we use the ARB variant and otherwise use the EXT variant.
See the comments at the top of gl_texture_funcs.cpp
* For functions with common code that needs to happen on replay, we pass
the resource's ID instead of its record, to be compatible with replay
where there are no records. To save time & unnecessary queries, also
force all internal texture creates on replay to happen through the
DSA interfaces so we don't have to go looking up the texture via
selectors.
* The implementation needs the fine dFdx/dFdy variants, which are only
available in GLSL 4.50 and above. Without that support we fall back
to the normal dFdx/dFdy which are implementation dependent. In my
quick test on nvidia it so happened that it was still fine, but that's
not guaranteed.
* glsl and hlsl custom display shaders are kept separate, and only shown
for the appropriate log type.
* The little snippets added in the shader editor aren't updated yet, and
none of the pre-defined shader constants are filled out.
* We stream-out or transform feedback the whole instanced draw at once,
producing a buffer containing all N instances in one. Then when the
client requests postvs data, an offset into the buffer is calculated
(in 1/N chunks) and carried through everywhere.
* Since we were using the offset to indicate where the system position
output lay for since-last-clear auto drawing of meshes, we rearrange
the output attribute order so system position is always first in the
list.
* Also since-last-clear now doesn't include the current event, but does
include any previous instances before the current instance.
* This might be an nvidia bug but I honestly don't know what the syntax
for varyings is, and the spec seems vague (it just says 'user-defined'
variables). This system/heuristic works on NVIDIA and AMD though, so
it'll have to do for now.
* Still missing several features:
- solid shading of 'secondary' data
- highlighting of vertices/faces/supporting faces
- helpers like axis markers or frustum
- post VS data and re-projection
* So RenderMesh doesn't pick up anything implicitly from the current
event, log, pipeline state etc - everything it needs is explicitly
provided by the config parameters (note this might include a buffer
generated by postvs data fetching, but the implementation now doesn't
need to care or treat it as a special case.
* GL won't let you define too many texture uniforms, and currently the tex
sampling code blows it for the texture display shader. So we split it
by float/uint/sint and pick the right compiled version.
* If GL_NEAREST is specified it means the whole mip chain is locked off,
even if we do textureLod in the shader.
* Instead, go back to using GL_NEAREST_MIPMAP_NEAREST and clamp the
MAX_LEVEL to make the texture mipmap complete when necessary.