* 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.
* Doesn't compile yet! Just splitting this up logically so the change is
a bit easier to digest.
* I've commented and organised a bit better the gl_hookset.h hook list.
* The function hooks are set up for all of the ARB_dsa entry points.
Those that are semnatically identical to EXT_dsa are set up as aliases
(with EXT_ being canonical, so we can fall back if ARB_dsa isn't
supported - see comments in gl_hookset.h).
* Implemented the new functions except for the glTexture* family and the
glCreate* family. No deduplication of code yet.
* As with EXT_dsa we "promote" to the DSA function for serialisation,
but since unlike EXT_dsa we can't assume ARB_dsa is present, instead
we emulate those functions that we might use unconditionally but may
not be present.
* We make the ReplaceResource call recursive - so if we replace a shader
it will replace any programs that use that shader recursively and next
iteration if we are replacing a program, we replace any pipelines that
use it.
* In D3D11 the RTs and UAVs have the same namespace, but GL has separate
framebuffer attachments and images. This change splits up the concepts
so the D3D11 case is a special case, in a way, and that we can handle
any generic mix of the two nicely.
* We have a separable program for each shader that we can use to mess
about with and relink for doing overlay/analysis type stuff. We need
to make sure we create it properly and don't use re-use the separable
program that is the 'real' version.
* For each texture you view, it will reset back to mip 0 and slice 0
as it previously did, and it will also reset the channels back to
RGB only, which is new behaviour.
* Then each texture remembers those settings, so if you choose to view
slice 6 & alpha only of a texture any time you switch back to it
you'll see slice 6 & alpha only.
* It can be disabled in the options, but this is the new default
behaviour. Possibly in future the zoom level and visible range might
be rolled into this, but for now I think they might work better as
global state.
* This means these will spam errors if anyone is using a feature level
10.x or below device without ps_5_0 support, but that's unavoidable
and not too important (in release it'll just be some log spam).
* 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.
* Since we decode the visual colours into an integer by looking them up
in the overdraw ramp rather than re-running to get an integer return,
we make some invisibly subtly different colours above the highest
overdraw colour, and use these to tell overdraw levels above 20.
* Since the addition of the normalised UV co-ords the status bar will
flicker in width horrendously when scanning over a texture and it's
impossible to track where you are. Even worse, if the text is wide
enough (or the window narrow enough) you'll end up with the status
bar flickering between one and two lines - which is awful.
* For now I've added some padding for numbers and set a fixed width font
so the only varying element is the actual texel value, which is
unavoidable in the general case. The text is probably wider overall
so I'll need to see what feedback I get.
* 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.
* It's only used in glRasterSamplesEXT, so it's an error to either
glEnable/glDisable it or check via glIsEnabled. It's already handled
properly to RasterFixed, so just drop it from the enabled bits.
* We call LazyInit() in the first swapchain create, and on replay log
initialisation. This is guaranteed to be before we use it (on replay
it will always be hit, and in program if there's no swapchain, we
won't use the debug manager for text rendering). It's also late enough
that it won't be triggered for every device while enumerating or such.
* This saves on errors and other spam (and internal compile errors if
an older d3dcompiler.dll is used) when none of these resources are
used. We only use what's necessary for font rendering.
* If hardware support for feature level 11 isn't present, fall back to
the WARP software rasterizer. This will support everything needed, but
it certainly won't run well.
* There are loud warnings - I added a debug message to the debug errors&
warnings window so the status bar will indicate that, and it's in the
title.
* At most once every 3 weeks there will also be a message box pop up
when loading a log, to remind the user so that it isn't forgotten, as
for obvious reasons this is not the intended use-case (hopefully once
per 3 weeks isn't too often to be annoying).
* Client code can enumerate the IDs of counters that are supported -
some of these will be general, some will be IHV specific. It can also
request descriptions of the counters to determine the type of data or
units. This can be used to 'discover' counters that aren't hard
coded into renderdoc. I'll want to at least reserve IHV ranges so that
counter IDs are globally unique, and ideally IHV counters will also be
predeclared where possible.
* Also the refactor removes some ugly rdctype::array use outside of the
replay layer and replaces it just with std::vector, which is a nice
bonus.