Draft D2D trace support.
Get d2d to build on MinGW.
Fix Mingw64 build.
Tweak d2d1 specs.
Fix MSVC build.
Trace dwrite.dll too.
More D2D spec tweaks.
Merge branch 'master' into d2d

Conflicts:
	compat.h
	trace.py
More MinGW<->DXSDK compatability fixes.
Merge branch 'master' into d2d

Conflicts:
	compat.h
Fix *CreateFactory's tracing.
Fix assertion failure.
Try to cope with unwrapped objects.
Merge branch 'master' into d2d
Merge branch 'master' into d2d
Add support for basic GPU profiling of draw calls to retrace.

Currently only supports opengl using glBegin/EndQuery and glQueryCounter.

Based on code from Yuanhan Liu timing-trace branch.
Improved GPU profiling code.

Now only allows a certain number of active queries,
this fixes results with applications that have many draw calls.
Fixed gpu profiling under multiple contexts.

Now flushes the results for all queries on context switch.
Added support for recording GL_SAMPLES_PASSED.
Improved profiling capabilities.

Logs which shader is active to allow per shader profiling.
Merged cpu profiling code from retrace to trace_profiler.
Allow choice of profiling for gpu / cpu / pixels drawn.