ApiTrace: Adding batch files to copy 32-bit and 64-bit wrappers into the correct output directories so that the ApiTrace projects can be run from within VisualStudio. These need to be run manually after building the solution to copy the new wrappers into the correct directory. I am not adding these to the post-build process in VS because the project files may get regenerated in the future if files are added to the CMake configs.

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1710584]
ApiTrace: Initial hook up of tracing a single frame based on frame number
* command line parameter has been added to allow specifying a frame number to trace
* the value is passed to the wrappers via an environment variable (this is how the trace filename was already being passed)
* the shared trace code was extended to compare the env var value to the current frame number
* the gltrace has been extended to support incrementing the frame number

* there were bugs in the existing scripts that caused incorrect behavior in special-cased entrypoints if tracing was not enabled. This mainly caused the GREMEDY extensions to not be exposed, but fixing the issue cause a series of other tweaks to the python scripts.

* I have manually confirmed that single-frame traces contain the same calls as a full trace.

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1712961]
ApiTrace: merge latest changes from cworth github branch
* ability to replay on a remote system
* more api calls get trimmed due to not having side effects
* --auto is the default trim option
* replay a trace can now loop the last frame
* misc bug fixes

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1714104]
ApiTrace: Modify python scripts
* Generate new functions that primarily perform tracing of entrypoints to the file, which also take in an already known result, and can optionally call the actual API call to get the result.
** This required splitting the wgltrace.py (generates OpenGL32 entrypoints) into a new wgltrace_tracefuncs.py (generates the new trace functions).
* Improved indentation in the generated files
* When the frame number is incremented and becomes the frame to capture, a function is now called to snapshot the state.
** Emiting of a few dummy state values to validate that the new trace functions are working as expected

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1716476]
ApiTrace: Start of state snapshot
 * if single frame tracing is enabled, always trace certain glGen* and glDelete* calls, glCreate*, glNew*, and several wgl* calls. These will allow us to ensure that the same objects are created, and going forward will allow us to more easily keep track of which objects exist and will need to be queried.
 * some minor script clean up

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1717270]
ApiTrace - missed this file in my last checkin
* pass the hdc into the CreateContext call

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1717379]
ApiTrace: Move scoped_allocator.hpp to the ApiTrace/Common folder and add it to the project

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1719176]
ApiTrace: basic state capture
* Create a header to declare the _trace_gl* functions so that they can be used by both the generated entrypoints and also by the new state snapshot functionality. Added wgltrace_tracefuncsDecl.py to do this. A bit of rework was needed to get the files to generate code in the correct place.
* The glstate_snapshot.py was duplicated and modified from the glstate_params.py that was part of the glretrace_common project. It still needs some clean up and needs to handle a lot more entrypoints, but this is a good first step.

* NOTE: this checkin includes changes for cgl, d2d1, d3d8, d3d9, ddraw, dxgi, egl, and glx - In windows I'm able to compile all but cgl, egl, and glx (they aren't in the solution), so those three are completely untested. The DX-related traces compile successfully, but I have not yet attempted to test them.

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1719263]
ApiTrace: more progress on state capturing
* Separate out state that can be queried, but not replayed (ie, max's, versions, etc)
* Separate out most state that was deprecated as of OpenGL 3.3, as we won't need to focus on those right now
* Add a code path for simple state that can be queried with one glGet*, and set with one entrypoint
* Fixed up Material and Light setting even though those are deprecated
* A lot of progress on snapshot of texture state, however this is still incomplete as it does not handle textures that were created, but not part of the currently bound state

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1721018]
ApiTrace: additional deprecated state that we don't want to deal with right now

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1721487]
ApiTrace: Complete tracing and recreation of texture objects
* As the textures are generated, their names are stored in a map that corresponds to some of the texture state
* When the texture is populated with information, the name is looked up in the map and the texture state is set
* The state snapshot will back up the active texture unit and texture bindings on GL_TEXTURE0, will then recreate all the textures using that texture unit, and then restore the active texture bindings and unit
* This change supports 1D, 2D, 3D, and CUBE_MAP textures, both compressed and uncompressed
** Source2 does not currently use texture arrays or multisample textures, so those are not yet supported.

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1723371]
ApiTrace: Support for recreating framebuffer objects (fbo's)
* Use a list to track the existing fbo's based on calls to glGenFramebuffers and glDeleteFramebuffers
* The state snapshot will backup the current draw and read framebuffers, then iterate over the existing fbo's querying the objects bound each attachment point (all colors, depth, and stencil) emitting the necessary calls to recreate the same state

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1723740]
ApiTrace: Support for recreating Vertex Array Objects (VAO)
* Track the existence of VAOs based on glGenVertexArrays and glDeleteVertexArrays
* State snapshot will iterate through the list of existing VAOs and query / emit necessary calls to recreate the state
* This functionality is dependent on Buffer Objects, which I have not yet implemented. I guess that will be next.

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1724167]
ApiTrace: renaming functions and updating a few comments
* I don't want these functions to become confused with the other dump* functions (which write to a text file) that were in glparams.py, which I based this content on. using 'snapshot' instead of 'dump'

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1724199]
ApiTrace: Fix a bug in the texture recreation
* Found when attempting to replay the captured frame
* Use the correct target when querying texture level state for non-cubemap textures

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1724550]
ApiTrace: Support for recreating buffer objects
* Fix comment at top of file, this was originally based on glstate_params.py, not glparams.py
* Track existence of buffers based on calls to glGenBuffers and glDeleteBuffers and store them in a list
* The state snapshot will capture the bindings to each of the buffer targets, then emit calls to recreate the buffers by binding them as a GL_ARRAY_BUFFER to query necessary state and then supply the buffer data, then the previously buffer bindings are restored.
** It shouldn't matter that we're creating all the buffers as GL_ARRAY_BUFFERS, because this is just for populating the data. At render time they will be bound to the correct buffer targets.

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1724622]
ApiTrace: Add support for recreating Sampler objects
* This is currently doing a very thorough approach by setting all the state for every sampler that was created, but currently Source2 creates a bunch of unused samplers and so the generated trace file has a lot of superfluous SamplerParameter calls. A more optimized approach would be to only set those samplers that have been modified since they were created.
* Track existence of Samplers based on glGenSamplers and glDeleteSamplers
* Iterate through all the sampler objects and query / recreate their state, then iterate through all the texture units and query the bound sampler and emit calls to bind it.

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1724853]
ApiTrace: Fix a bug in getting texture data for compressed formats
* found while testing my upcoming changes to support program and shader objects (after which we are able to successfully play back single-frame traces)
* glGetTexImage should only be used for non-compressed textures
* glGetCompressedTexImage should be used for compressed textures

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1725286]
ApiTrace: Quick support for tracing the creation of shaders and programs
* Instead of trying to track all the created shaders and programs and (in some cases) tracking the supplied program source code, I'm always tracing the shader and program setup functions. The only downfall I see to this approach is that all calls to glUseProgram(..) and glUniform* which are made in the frames prior to the frame of interested will be recorded into the trace, potentially bloating the trace file. In order to avoid this issue, the existing programs can be tracked and the snapshot can query the uniforms and emit trace calls to set them.
* The snapshot will query the active program and replay & emit the call to make it the active program. This is redundant, but sets up the location for where the changes mentioned above should be made in the event that we decide to take that route to reduce trace file size.
* Add a bunch of GL_PROGRAM* state that cannot be replayed as they exist to report statistics about the bound program object.
* Add GL_TEXTURE_RESIDENT to the list of states that cannot be replayed (this reduces many warnings being displayed by apitrace).
***** After this change, single-frame traces can be successfully captured and replayed using apitrace ***** note that I've only tested with the first scene in RenderSystemTest, more tests to come soon!

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1725340]
ApiTrace: fix a few glErrors that were being generated during replay due to incorrectly attempting to set state

[git-p4: depot-paths = "//console/devtools/ApiTrace/": change = 1725491]