Merge DebugCrash branch into master.

This gets all the bug fixes introduced as part of the bug hunt, but avoids the commented out code and disabled parts.

Includes Affinty flag setting code, and new logging.
Updated AC3 Shader Fix files, 547 files - Mike_ar69
AC3 Shader Fixes for v0.58: Fixed the issues with objects "sprouting up" from the ground as the view distance changes
Add /Debug for all projects to generate pdb files.

Even in Release, because I need the pdb files to do performance testing.  They are not included in the zip file stage, so they are there in Release when needed.
Add new 'hunting' flag in d3dx.ini for performance.

hunting=1 when you want to find shaders and textures.
hunting=0 when you want the best performance.

This skips past all the saving and matching code on the shaders and textures, so that hunting is ignored as a Release mode.

In AC3, this bumped performance from min 27 fps to 33 fps.

It's not exactly right, as it disables some features like Texture remapping from the .ini.  We don't use that in AC3, but it is used in BI.  OK for now.
Merge branch 'master' of https://github.com/bo3b/3Dmigoto.git
Hunting was disabling shadows altogether.

Fix to allow stereo map to be created at ClearRenderTargetView. Should still keep performance desired.
Add game specific d3dx.ini as play target.

The d3dx.ini has many settings, some conflict with the goal of having it run fast.  This allows the AC3 version to be different than debug or release version, and makes it less likely to botch an AC3 release version.

This file is tuned for maximum performance, including no shader hunting.
Final options for a _playing_ in d3dx.ini.

Setting cache_shaders=1, so that as the game is played shaders are saved as .bin for future sessions.  Alleviates some small loading stutters.

Leaving use_criticalsection=1, as safer than disabling it, and having measured no performance block with it on.
AC3 Shader Fix Update: Disable Decals, fix additional shadows in cut scenes
Add uninstall.bat to 7zip of AC3 project.
A couple of worthwhile tweaks for finding real D3D11Device.

Add debug mode to GPU when running in Debug versions.
Get real device, but doesn't seem to work.
Adding texture2darray to DecompileHLSL
Fix truncateTexturePos with Texture2DArray
Set better defaults for hunting version of d3dx.ini

Defaults are logging on, not full debug, cache shaders, dissassemble all to ASM, decompile all to HLSL.

And move it to the right spot in the solution, so that it's not all confusing by being the one in AC3 folder.
Hack version of F10 shader reload.

Works in both AC3, and AC4 though.
Just save the realDevice as the first one seen, which works in this case.

The crash was from setting the shader on the wrong device. There will be a better way to get the device but this is OK for now.
Merge branch 'GetRealDevice_F10'
Add an experimental thread based hunting loop.

This is a thread that sleeps for 100ms, then runs the RunFrameActions loop.

It's experimental because I'm not certain how it interacts with other parts of the tool.  I expect it to be OK, where it collects 100ms of shaders, instead of 15ms for one frame, so somewhat more than usual, but still a small subset of what is live.

Seems to allow hunting and marking with no problems.
Fix memory leak in F10 reload.

Any shader that is replaced a 2nd time can be released, as being no longer in use on the GPU.
Fix potential critical section bug when reloading shaders.

Reference needs to be inside critical section, before doing the SetShader call.