apitrace: Changes to 'upstream'
.editorconfig | 27
.gitignore | 6
.lvimrc | 1
.travis.yml | 63
Android.mk | 9
CMakeLists.txt | 271
appveyor.yml | 38
cli/CMakeLists.txt | 10
cli/cli.hpp | 2
cli/cli_dump.cpp | 65
cli/cli_leaks.cpp | 85
cli/cli_main.cpp | 2
cli/cli_pickle.cpp | 34
cli/cli_repack.cpp | 170
cli/cli_sed.cpp | 49
cli/cli_trace.cpp | 31
cli/cli_trim.cpp | 284
cli/cli_trim_auto.cpp | 432
cli/cli_trim_auto_analyzer.cpp | 767 +
cli/cli_trim_auto_analyzer.hpp | 114
cli/pickle.hpp | 1
cli/trace_analyzer.cpp | 767 -
cli/trace_analyzer.hpp | 114
cmake/FindDirectX.cmake | 75
cmake/FindWaffle.cmake | 38
cmake/Windows10SDK.cmake | 53
cmake/toolchain/android.toolchain.cmake | 1767 --
common/highlight.cpp | 324
common/highlight.hpp | 86
common/os.hpp | 106
common/os_backtrace.cpp | 486
common/os_backtrace.hpp | 44
common/os_binary.hpp | 59
common/os_dl.hpp | 87
common/os_memory.hpp | 78
common/os_posix.cpp | 450
common/os_process.hpp | 89
common/os_string.hpp | 435
common/os_thread.hpp | 499
common/os_time.hpp | 104
common/os_version.hpp | 61
common/os_win32.cpp | 398
common/trace_api.hpp | 56
common/trace_callset.cpp | 255
common/trace_callset.hpp | 195
common/trace_dump.cpp | 313
common/trace_dump.hpp | 75
common/trace_fast_callset.cpp | 210
common/trace_fast_callset.hpp | 140
common/trace_file.cpp | 56
common/trace_file.hpp | 206
common/trace_file_read.cpp | 69
common/trace_file_snappy.cpp | 415
common/trace_file_write.cpp | 50
common/trace_file_zlib.cpp | 181
common/trace_format.hpp | 83
common/trace_loader.cpp | 137
common/trace_loader.hpp | 63
common/trace_lookup.hpp | 109
common/trace_model.cpp | 301
common/trace_model.hpp | 585
common/trace_option.cpp | 62
common/trace_option.hpp | 38
common/trace_parser.cpp | 1043 -
common/trace_parser.hpp | 224
common/trace_parser_flags.cpp | 646 -
common/trace_profiler.cpp | 259
common/trace_profiler.hpp | 143
common/trace_writer.cpp | 372
common/trace_writer.hpp | 116
common/trace_writer_local.cpp | 269
common/trace_writer_local.hpp | 121
common/trace_writer_model.cpp | 149
common/ubjson.hpp | 111
compat/cxx_compat.hpp | 65
compat/d3derr.hpp | 99
compat/winsdk_compat.h | 797 +
dispatch/compat.h | 771 -
dispatch/d2dimports.hpp | 11
dispatch/d3d10imports.hpp | 2
dispatch/d3d11imports.hpp | 4
dispatch/d3d8imports.hpp | 2
dispatch/d3d9imports.hpp | 2
dispatch/d3derr.hpp | 96
dispatch/d3dimports.hpp | 2
dispatch/dcompimports.hpp | 78
dispatch/dxgiint.h | 7
dispatch/dxva2imports.hpp | 49
dispatch/dxvaint.h | 179
dispatch/eglimports.hpp | 5
dispatch/glproc.py | 28
dispatch/glproc_egl.cpp | 97
dispatch/glproc_gl.cpp | 5
docs/Android.markdown | 45
docs/Dalvik.markdown | 52
docs/FORMAT.markdown | 2
docs/HACKING.markdown | 1
docs/INSTALL.markdown | 86
docs/NEWS.markdown | 4
docs/USAGE.markdown | 25
gui/CMakeLists.txt | 76
gui/androiddevicedialog.cpp | 16
gui/androiddevicedialog.h | 2
gui/androidfiledialog.cpp | 8
gui/androidfiledialog.h | 2
gui/androidretracer.cpp | 2
gui/androidretracer.h | 2
gui/apicalldelegate.h | 4
gui/apisurface.cpp | 26
gui/apisurface.h | 8
gui/apitrace.cpp | 18
gui/apitrace.h | 1
gui/apitracecall.cpp | 91
gui/apitracecall.h | 52
gui/apitracefilter.h | 2
gui/apitracemodel.cpp | 2
gui/apitracemodel.h | 24
gui/argumentseditor.h | 2
gui/calldurationgraph.h | 16
gui/glsledit.cpp | 6
gui/glsledit.h | 6
gui/graphing/frameaxiswidget.h | 2
gui/graphing/graphaxiswidget.h | 6
gui/graphing/graphlabelwidget.h | 2
gui/graphing/graphview.h | 10
gui/graphing/graphwidget.h | 2
gui/graphing/heatmapverticalaxiswidget.h | 4
gui/graphing/heatmapview.h | 8
gui/graphing/histogramview.h | 12
gui/graphing/timeaxiswidget.h | 2
gui/imageviewer.cpp | 10
gui/imageviewer.h | 6
gui/jumpwidget.h | 4
gui/leaktracethread.cpp | 82
gui/leaktracethread.h | 35
gui/mainwindow.cpp | 264
gui/mainwindow.h | 13
gui/pixelwidget.h | 20
gui/profiledialog.cpp | 12
gui/profileheatmap.h | 44
gui/profiletablemodel.cpp | 13
gui/profiletablemodel.h | 10
gui/qubjson_test.cpp | 4
gui/resources/glreference.tsv | 2598 +---
gui/retracer.cpp | 12
gui/retracer.h | 2
gui/saverthread.cpp | 28
gui/saverthread.h | 2
gui/searchwidget.h | 4
gui/settingsdialog.h | 2
gui/tracedialog.h | 2
gui/traceloader.cpp | 210
gui/traceloader.h | 2
gui/trimprocess.cpp | 2
gui/ui/jumpwidget.ui | 2
gui/ui/mainwindow.ui | 77
helpers/CMakeLists.txt | 2
helpers/com_ptr.hpp | 61
helpers/d3d11size.hpp | 56
helpers/d3d7size.hpp | 15
helpers/d3d8size.hpp | 98
helpers/d3d9size.hpp | 150
helpers/d3dcommonsize.hpp | 88
helpers/dxgisize.hpp | 43
helpers/glfeatures.cpp | 408
helpers/glfeatures.hpp | 177
helpers/glprofile.cpp | 325
helpers/glprofile.hpp | 143
helpers/glsize.hpp | 257
image/CMakeLists.txt | 17
image/README.markdown | 2
image/image.hpp | 156
image/image_bmp.cpp | 142
image/image_md5.cpp | 64
image/image_png.cpp | 277
image/image_pnm.cpp | 319
image/image_raw.cpp | 66
inject/CMakeLists.txt | 10
inject/inject.h | 74
inject/injectee.cpp | 434
inject/injector.cpp | 180
lib/CMakeLists.txt | 5
lib/guids/CMakeLists.txt | 9
lib/guids/guids.cpp | 132
lib/guids/guids.hpp | 51
lib/guids/guids_defs.hpp | 40
lib/guids/guids_entries.h | 763 +
lib/guids/guids_test.cpp | 56
lib/highlight/CMakeLists.txt | 4
lib/highlight/highlight.cpp | 324
lib/highlight/highlight.hpp | 86
lib/image/CMakeLists.txt | 18
lib/image/README.markdown | 2
lib/image/image.hpp | 156
lib/image/image_bmp.cpp | 142
lib/image/image_md5.cpp | 64
lib/image/image_png.cpp | 277
lib/image/image_pnm.cpp | 319
lib/image/image_raw.cpp | 66
lib/os/CMakeLists.txt | 40
lib/os/os.hpp | 106
lib/os/os_backtrace.cpp | 486
lib/os/os_backtrace.hpp | 44
lib/os/os_binary.hpp | 59
lib/os/os_crtdbg.cpp | 92
lib/os/os_crtdbg.hpp | 57
lib/os/os_dl.hpp | 87
lib/os/os_memory.hpp | 78
lib/os/os_osx.mm | 41
lib/os/os_posix.cpp | 468
lib/os/os_process.hpp | 89
lib/os/os_string.hpp | 437
lib/os/os_thread.hpp | 539
lib/os/os_thread_test.cpp | 161
lib/os/os_time.hpp | 104
lib/os/os_version.hpp | 61
lib/os/os_win32.cpp | 405
lib/os/thread_pool.hpp | 113
lib/trace/CMakeLists.txt | 37
lib/trace/trace_api.hpp | 56
lib/trace/trace_callset.cpp | 264
lib/trace/trace_callset.hpp | 195
lib/trace/trace_dump.cpp | 327
lib/trace/trace_dump.hpp | 76
lib/trace/trace_dump_internal.hpp | 81
lib/trace/trace_fast_callset.cpp | 210
lib/trace/trace_fast_callset.hpp | 140
lib/trace/trace_file.cpp | 60
lib/trace/trace_file.hpp | 169
lib/trace/trace_file_brotli.cpp | 150
lib/trace/trace_file_read.cpp | 70
lib/trace/trace_file_snappy.cpp | 353
lib/trace/trace_file_zlib.cpp | 144
lib/trace/trace_format.hpp | 83
lib/trace/trace_lookup.hpp | 109
lib/trace/trace_model.cpp | 301
lib/trace/trace_model.hpp | 593
lib/trace/trace_option.cpp | 62
lib/trace/trace_option.hpp | 38
lib/trace/trace_ostream.hpp | 52
lib/trace/trace_ostream_snappy.cpp | 207
lib/trace/trace_ostream_zlib.cpp | 93
lib/trace/trace_parser.cpp | 1039 +
lib/trace/trace_parser.hpp | 248
lib/trace/trace_parser_flags.cpp | 550
lib/trace/trace_parser_flags_test.cpp | 644 +
lib/trace/trace_parser_loop.cpp | 111
lib/trace/trace_profiler.cpp | 259
lib/trace/trace_profiler.hpp | 143
lib/trace/trace_snappy.hpp | 34
lib/trace/trace_writer.cpp | 372
lib/trace/trace_writer.hpp | 116
lib/trace/trace_writer_local.cpp | 287
lib/trace/trace_writer_local.hpp | 121
lib/trace/trace_writer_model.cpp | 149
lib/ubjson/ubjson.hpp | 111
retrace/CMakeLists.txt | 35
retrace/d3d10state.cpp | 40
retrace/d3d10state.hpp | 9
retrace/d3d10state_images.cpp | 49
retrace/d3d11state.cpp | 40
retrace/d3d9retrace.py | 64
retrace/d3d9state.cpp | 10
retrace/d3d9state_formats.cpp | 6
retrace/d3d9state_images.cpp | 22
retrace/d3dretrace.hpp | 3
retrace/d3dretrace_dxgi.hpp | 11
retrace/d3dretrace_dxgi_misc.cpp | 113
retrace/d3dretrace_ws.cpp | 135
retrace/d3dstate.hpp | 12
retrace/ddrawretrace.py | 13
retrace/dxgiretrace.py | 140
retrace/dxgistate.cpp | 85
retrace/dxgistate.hpp | 2
retrace/glretrace.hpp | 124
retrace/glretrace.py | 153
retrace/glretrace_cgl.cpp | 29
retrace/glretrace_egl.cpp | 22
retrace/glretrace_glx.cpp | 17
retrace/glretrace_main.cpp | 398
retrace/glretrace_wgl.cpp | 216
retrace/glretrace_wgl.hpp | 42
retrace/glretrace_wgl_font.cpp | 4896 ++++++++
retrace/glretrace_ws.cpp | 87
retrace/glstate.cpp | 69
retrace/glstate_formats.cpp | 63
retrace/glstate_images.cpp | 283
retrace/glstate_internal.hpp | 20
retrace/glstate_shaders.cpp | 444
retrace/glws.cpp | 35
retrace/glws.hpp | 78
retrace/glws_cocoa.mm | 52
retrace/glws_egl_android.cpp | 46
retrace/glws_egl_xlib.cpp | 53
retrace/glws_glx.cpp | 269
retrace/glws_waffle.cpp | 142
retrace/glws_wgl.cpp | 462
retrace/glws_xlib.cpp | 10
retrace/json.cpp | 10
retrace/metric_backend.hpp | 285
retrace/metric_backend_amd_perfmon.cpp | 449
retrace/metric_backend_amd_perfmon.hpp | 178
retrace/metric_backend_intel_perfquery.cpp | 361
retrace/metric_backend_intel_perfquery.hpp | 170
retrace/metric_backend_opengl.cpp | 481
retrace/metric_backend_opengl.hpp | 198
retrace/metric_helper.cpp | 217
retrace/metric_writer.cpp | 224
retrace/metric_writer.hpp | 124
retrace/mmap_allocator.hpp | 171
retrace/retrace.hpp | 26
retrace/retrace.py | 54
retrace/retrace_main.cpp | 188
retrace/retrace_swizzle.cpp | 6
retrace/retrace_swizzle.hpp | 9
retrace/state_writer_json.cpp | 28
retrace/state_writer_ubjson.cpp | 28
retrace/threaded_snapshot.hpp | 91
retrace/ws.cpp | 38
retrace/ws.hpp | 37
retrace/ws_win32.cpp | 237
retrace/ws_win32.hpp | 49
scripts/CMakeLists.txt | 10
scripts/jsondiff.py | 32
scripts/leaks.py | 162
scripts/retracediff.py | 5
scripts/snapdiff.py | 51
scripts/tracediff.py | 6
scripts/unpickle.py | 11
specs/cglapi.py | 3
specs/d2d1.py | 784 +
specs/d2dbasetypes.py | 80
specs/d2derr.py | 62
specs/d3d10.py | 47
specs/d3d11.py | 1096 +
specs/d3d9.py | 31
specs/d3d9dxva2.py | 382
specs/d3dcommon.py | 702 -
specs/dcomp.py | 303
specs/ddraw.py | 25
specs/dwrite.py | 639 +
specs/dxgi.py | 87
specs/dxva2.py | 458
specs/eglapi.py | 217
specs/eglenum.py | 56
specs/glapi.py | 251
specs/glparams.py | 188
specs/gltypes.py | 1
specs/scripts/Makefile | 6
specs/scripts/cxx2api.h | 39
specs/scripts/cxx2api.py | 488
specs/scripts/xml2glparams.py | 38
specs/stdapi.py | 26
specs/wglapi.py | 14
specs/winapi.py | 11
thirdparty/brotli/CMakeLists.txt | 75
thirdparty/brotli/CONTRIBUTING.md | 27
thirdparty/brotli/LICENSE | 19
thirdparty/brotli/README.md | 17
thirdparty/brotli/dec/bit_reader.c | 48
thirdparty/brotli/dec/bit_reader.h | 389
thirdparty/brotli/dec/context.h | 251
thirdparty/brotli/dec/decode.c | 2237 +++
thirdparty/brotli/dec/decode.h | 96
thirdparty/brotli/dec/dictionary.c | 9466 +++++++++++++++
thirdparty/brotli/dec/dictionary.h | 38
thirdparty/brotli/dec/huffman.c | 357
thirdparty/brotli/dec/huffman.h | 73
thirdparty/brotli/dec/port.h | 224
thirdparty/brotli/dec/prefix.h | 749 +
thirdparty/brotli/dec/state.c | 178
thirdparty/brotli/dec/state.h | 249
thirdparty/brotli/dec/transform.h | 300
thirdparty/brotli/dec/types.h | 38
thirdparty/brotli/enc/backward_references.cc | 858 +
thirdparty/brotli/enc/backward_references.h | 116
thirdparty/brotli/enc/bit_cost.h | 161
thirdparty/brotli/enc/block_splitter.cc | 505
thirdparty/brotli/enc/block_splitter.h | 61
thirdparty/brotli/enc/brotli_bit_stream.cc | 1181 +
thirdparty/brotli/enc/brotli_bit_stream.h | 179
thirdparty/brotli/enc/cluster.h | 330
thirdparty/brotli/enc/command.h | 156
thirdparty/brotli/enc/compress_fragment.cc | 701 +
thirdparty/brotli/enc/compress_fragment.h | 47
thirdparty/brotli/enc/compress_fragment_two_pass.cc | 524
thirdparty/brotli/enc/compress_fragment_two_pass.h | 40
thirdparty/brotli/enc/context.h | 178
thirdparty/brotli/enc/dictionary.cc | 9466 +++++++++++++++
thirdparty/brotli/enc/dictionary.h | 41
thirdparty/brotli/enc/dictionary_hash.h | 4117 ++++++
thirdparty/brotli/enc/encode.cc | 1175 +
thirdparty/brotli/enc/encode.h | 207
thirdparty/brotli/enc/encode_parallel.cc | 279
thirdparty/brotli/enc/encode_parallel.h | 28
thirdparty/brotli/enc/entropy_encode.cc | 480
thirdparty/brotli/enc/entropy_encode.h | 104
thirdparty/brotli/enc/entropy_encode_static.h | 572
thirdparty/brotli/enc/fast_log.h | 139
thirdparty/brotli/enc/find_match_length.h | 77
thirdparty/brotli/enc/hash.h | 974 +
thirdparty/brotli/enc/histogram.cc | 67
thirdparty/brotli/enc/histogram.h | 94
thirdparty/brotli/enc/literal_cost.cc | 165
thirdparty/brotli/enc/literal_cost.h | 24
thirdparty/brotli/enc/metablock.cc | 539
thirdparty/brotli/enc/metablock.h | 80
thirdparty/brotli/enc/port.h | 142
thirdparty/brotli/enc/prefix.h | 79
thirdparty/brotli/enc/ringbuffer.h | 145
thirdparty/brotli/enc/static_dict.cc | 455
thirdparty/brotli/enc/static_dict.h | 32
thirdparty/brotli/enc/static_dict_lut.h |12055 ++++++++++++++++++++
thirdparty/brotli/enc/streams.cc | 114
thirdparty/brotli/enc/streams.h | 121
thirdparty/brotli/enc/transform.h | 248
thirdparty/brotli/enc/types.h | 29
thirdparty/brotli/enc/utf8_util.cc | 83
thirdparty/brotli/enc/utf8_util.h | 25
thirdparty/brotli/enc/write_bits.h | 84
thirdparty/crc32c/CMakeLists.txt | 3
thirdparty/crc32c/README.md | 6
thirdparty/crc32c/crc32c.c | 332
thirdparty/crc32c/crc32c.hpp | 111
thirdparty/khronos/EGL/egl.h | 6
thirdparty/khronos/EGL/eglext.h | 76
thirdparty/khronos/EGL/eglplatform.h | 2
thirdparty/khronos/EGL/eglplatform.patch | 14
thirdparty/khronos/GL/glext.h | 197
thirdparty/khronos/GL/glxext.h | 6
thirdparty/khronos/GL/wglext.h | 6
thirdparty/khronos/GLES2/gl2.h | 6
thirdparty/khronos/GLES2/gl2ext.h | 124
thirdparty/khronos/Makefile | 18
thirdparty/snappy/AUTHORS | 1
thirdparty/snappy/CMakeLists.txt | 23
thirdparty/snappy/COPYING | 54
thirdparty/snappy/ChangeLog | 1916 ---
thirdparty/snappy/NEWS | 128
thirdparty/snappy/README | 135
thirdparty/snappy/config.h | 146
thirdparty/snappy/format_description.txt | 110
thirdparty/snappy/framing_format.txt | 135
thirdparty/snappy/snappy-c.cc | 90
thirdparty/snappy/snappy-c.h | 138
thirdparty/snappy/snappy-internal.h | 150
thirdparty/snappy/snappy-sinksource.cc | 71
thirdparty/snappy/snappy-sinksource.h | 137
thirdparty/snappy/snappy-stubs-internal.cc | 42
thirdparty/snappy/snappy-stubs-internal.h | 491
thirdparty/snappy/snappy-stubs-public.h | 98
thirdparty/snappy/snappy-stubs-public.h.in | 98
thirdparty/snappy/snappy-test.cc | 606 -
thirdparty/snappy/snappy-test.h | 582
thirdparty/snappy/snappy.cc | 1306 --
thirdparty/snappy/snappy.h | 184
thirdparty/snappy/snappy_unittest.cc | 1355 --
wrappers/CMakeLists.txt | 86
wrappers/assert.cpp | 4
wrappers/config.cpp | 1
wrappers/d2d1trace.py | 2
wrappers/d3d9.def | 2
wrappers/d3d9trace.py | 42
wrappers/dlltrace.hpp | 69
wrappers/dlltrace.py | 24
wrappers/dxgitrace.def | 2
wrappers/dxgitrace.hpp | 129
wrappers/dxgitrace.py | 80
wrappers/egltrace.py | 10
wrappers/glcaps.cpp | 15
wrappers/gltrace.hpp | 90
wrappers/gltrace.py | 453
wrappers/gltrace_arrays.cpp | 193
wrappers/gltrace_arrays.hpp | 97
wrappers/gltrace_state.cpp | 13
wrappers/memtrace.cpp | 244
wrappers/memtrace.hpp | 63
wrappers/trace.py | 88
wrappers/wgltrace.py | 145
479 files changed, 91305 insertions(+), 29947 deletions(-)
New commits:
commit 2d78bef000ebcca662ce074ee20257d3b7337be9
Author: Jose Fonseca <jfonseca@vmware.com>
Date: Thu May 19 15:10:23 2016 +0100
dxgiretrace: Handle ID3D11VideoContext properly.
Essentially do the same thing done for DXVA's IDirectXVideoDecoder interface.
diff --git a/retrace/dxgiretrace.py b/retrace/dxgiretrace.py
index 2321078..12b4ff3 100755
--- a/retrace/dxgiretrace.py
+++ b/retrace/dxgiretrace.py
@@ -166,6 +166,16 @@ class D3DRetracer(Retracer):
print r' Software = NULL;'
print r' }'
+ def doInvokeInterfaceMethod(self, interface, method):
+ Retracer.doInvokeInterfaceMethod(self, interface, method)
+
+ # Keep retrying ID3D11VideoContext::DecoderBeginFrame when returns E_PENDING
+ if interface.name == 'ID3D11VideoContext' and method.name == 'DecoderBeginFrame':
+ print r' while (_result == D3DERR_WASSTILLDRAWING || _result == E_PENDING) {'
+ print r' Sleep(1);'
+ Retracer.doInvokeInterfaceMethod(self, interface, method)
+ print r' }'
+
def invokeInterfaceMethod(self, interface, method):
# keep track of the last used device for state dumping
if interface.name in ('ID3D10Device', 'ID3D10Device1'):
@@ -360,6 +370,19 @@ class D3DRetracer(Retracer):
print ' _pbData = 0;'
print ' }'
+ if interface.name.startswith('ID3D11VideoContext'):
+ if method.name == 'GetDecoderBuffer':
+ print ' if (*ppBuffer && *pBufferSize) {'
+ print ' g_Maps[nullptr][SubresourceKey(_this, Type)] = *ppBuffer;'
+ print ' }'
+ if method.name == 'ReleaseDecoderBuffer':
+ print ' SubresourceKey _mappingKey(_this, Type);'
+ print ' void *_pBuffer = g_Maps[nullptr][_mappingKey];'
+ print ' if (_pBuffer) {'
+ print ' retrace::delRegionByPointer(_pBuffer);'
+ print ' g_Maps[nullptr][_mappingKey] = 0;'
+ print ' }'
+
# Attach shader byte code for lookup
if 'pShaderBytecode' in method.argNames():
ppShader = method.args[-1]
commit 91403b6268d37cfdc6148171082457bedfa01bca
Author: Jose Fonseca <jfonseca@vmware.com>
Date: Thu May 19 15:10:03 2016 +0100
dxgitrace: Handle ID3D11VideoContext::Get/ReleaseDecoderBuffer properly.
Essentially do the same thing done for DXVA's
IDirectXVideoDecoder::Get/ReleaseBuffer methods.
Untested, but it should fare no worse than it does now.
diff --git a/specs/d3d11.py b/specs/d3d11.py
index 3313f21..2fc2771 100644
--- a/specs/d3d11.py
+++ b/specs/d3d11.py
@@ -2117,11 +2117,11 @@ ID3D11VideoProcessorOutputView.methods += [
ID3D11VideoContext = Interface("ID3D11VideoContext", ID3D11DeviceChild)
ID3D11VideoContext.methods += [
- StdMethod(HRESULT, "GetDecoderBuffer", [(ObjPointer(ID3D11VideoDecoder), "pDecoder"), (D3D11_VIDEO_DECODER_BUFFER_TYPE, "Type"), Out(Pointer(UINT), "pBufferSize"), Out(Pointer(OpaqueBlob(Void, "*pBufferSize")), "ppBuffer")]),
+ StdMethod(HRESULT, "GetDecoderBuffer", [(ObjPointer(ID3D11VideoDecoder), "pDecoder"), (D3D11_VIDEO_DECODER_BUFFER_TYPE, "Type"), Out(Pointer(UINT), "pBufferSize"), Out(Pointer(LinearPointer(Void, "*pBufferSize")), "ppBuffer")]),
StdMethod(HRESULT, "ReleaseDecoderBuffer", [(ObjPointer(ID3D11VideoDecoder), "pDecoder"), (D3D11_VIDEO_DECODER_BUFFER_TYPE, "Type")]),
StdMethod(HRESULT, "DecoderBeginFrame", [(ObjPointer(ID3D11VideoDecoder), "pDecoder"), (ObjPointer(ID3D11VideoDecoderOutputView), "pView"), (UINT, "ContentKeySize"), (Blob(Const(Void), "ContentKeySize"), "pContentKey")]),
StdMethod(HRESULT, "DecoderEndFrame", [(ObjPointer(ID3D11VideoDecoder), "pDecoder")]),
- StdMethod(HRESULT, "SubmitDecoderBuffers", [(ObjPointer(ID3D11VideoDecoder), "pDecoder"), (UINT, "NumBuffers"), (Pointer(Const(D3D11_VIDEO_DECODER_BUFFER_DESC)), "pBufferDesc")]),
+ StdMethod(HRESULT, "SubmitDecoderBuffers", [(ObjPointer(ID3D11VideoDecoder), "pDecoder"), (UINT, "NumBuffers"), (Array(Const(D3D11_VIDEO_DECODER_BUFFER_DESC), "NumBuffers"), "pBufferDesc")]),
StdMethod(HRESULT, "DecoderExtension", [(ObjPointer(ID3D11VideoDecoder), "pDecoder"), (Pointer(Const(D3D11_VIDEO_DECODER_EXTENSION)), "pExtensionData")]),
StdMethod(Void, "VideoProcessorSetOutputTargetRect", [(ObjPointer(ID3D11VideoProcessor), "pVideoProcessor"), (BOOL, "Enable"), (Pointer(Const(RECT)), "pRect")]),
StdMethod(Void, "VideoProcessorSetOutputBackgroundColor", [(ObjPointer(ID3D11VideoProcessor), "pVideoProcessor"), (BOOL, "YCbCr"), (Pointer(Const(D3D11_VIDEO_COLOR)), "pColor")]),
diff --git a/wrappers/dxgitrace.py b/wrappers/dxgitrace.py
index f3ea82d..476d0a3 100644
--- a/wrappers/dxgitrace.py
+++ b/wrappers/dxgitrace.py
@@ -106,6 +106,10 @@ class D3DCommonTracer(DllTracer):
('std::map< std::pair<ID3D11Resource *, UINT>, _MAP_DESC >', 'm_MapDescs', None),
('std::map< std::pair<ID3D11Resource *, UINT>, MemoryShadow >', 'm_MapShadows', None),
]
+ if interface.hasBase(d3d11.ID3D11VideoContext):
+ variables += [
+ ('std::map<UINT, std::pair<void *, UINT> >', 'm_MapDesc', None),
+ ]
return variables
@@ -136,6 +140,14 @@ class D3DCommonTracer(DllTracer):
print ' }'
print ' }'
+ if interface.hasBase(d3d11.ID3D11VideoContext) and \
+ method.name == 'ReleaseDecoderBuffer':
+ print ' std::map<UINT, std::pair<void *, UINT> >::iterator it = m_MapDesc.find(Type);'
+ print ' if (it != m_MapDesc.end()) {'
+ self.emit_memcpy('it->second.first', 'it->second.second')
+ print ' m_MapDesc.erase(it);'
+ print ' }'
+
DllTracer.implementWrapperInterfaceMethodBody(self, interface, base, method)
if method.name == 'Map':
@@ -154,6 +166,14 @@ class D3DCommonTracer(DllTracer):
print ' _MapDesc.Size = 0;'
print ' }'
+ if interface.hasBase(d3d11.ID3D11VideoContext) and \
+ method.name == 'GetDecoderBuffer':
+ print ' if (SUCCEEDED(_result)) {'
+ print ' m_MapDesc[Type] = std::make_pair(*ppBuffer, *pBufferSize);'
+ print ' } else {'
+ print ' m_MapDesc[Type] = std::make_pair(nullptr, 0);'
+ print ' }'
+
def invokeMethod(self, interface, base, method):
DllTracer.invokeMethod(self, interface, base, method)
commit 8a4c9af839e466e927aa92654d8815dadaa7d37e
Author: Jose Fonseca <jfonseca@vmware.com>
Date: Wed May 18 16:25:35 2016 +0100
specs: Standardize on EnumFlags.
diff --git a/specs/d2d1.py b/specs/d2d1.py
index 815a121..39375ab 100644
--- a/specs/d2d1.py
+++ b/specs/d2d1.py
@@ -231,7 +231,7 @@ D2D1_BITMAP_INTERPOLATION_MODE = Enum("D2D1_BITMAP_INTERPOLATION_MODE", [
"D2D1_BITMAP_INTERPOLATION_MODE_LINEAR",
])
-D2D1_DRAW_TEXT_OPTIONS = EnumFlag("D2D1_DRAW_TEXT_OPTIONS", [
+D2D1_DRAW_TEXT_OPTIONS = EnumFlags("D2D1_DRAW_TEXT_OPTIONS", [
"D2D1_DRAW_TEXT_OPTIONS_NONE",
"D2D1_DRAW_TEXT_OPTIONS_NO_SNAP",
"D2D1_DRAW_TEXT_OPTIONS_CLIP",
@@ -355,7 +355,7 @@ D2D1_TRIANGLE = Struct("D2D1_TRIANGLE", [
(D2D1_POINT_2F, "point3"),
])
-D2D1_PATH_SEGMENT = EnumFlag("D2D1_PATH_SEGMENT", [
+D2D1_PATH_SEGMENT = EnumFlags("D2D1_PATH_SEGMENT", [
"D2D1_PATH_SEGMENT_NONE",
"D2D1_PATH_SEGMENT_FORCE_UNSTROKED",
"D2D1_PATH_SEGMENT_FORCE_ROUND_LINE_JOIN",
@@ -406,7 +406,7 @@ D2D1_STROKE_STYLE_PROPERTIES = Struct("D2D1_STROKE_STYLE_PROPERTIES", [
(FLOAT, "dashOffset"),
])
-D2D1_LAYER_OPTIONS = EnumFlag("D2D1_LAYER_OPTIONS", [
+D2D1_LAYER_OPTIONS = EnumFlags("D2D1_LAYER_OPTIONS", [
"D2D1_LAYER_OPTIONS_NONE",
"D2D1_LAYER_OPTIONS_INITIALIZE_FOR_CLEARTYPE",
])
@@ -421,7 +421,7 @@ D2D1_LAYER_PARAMETERS = Struct("D2D1_LAYER_PARAMETERS", [
(D2D1_LAYER_OPTIONS, "layerOptions"),
])
-D2D1_WINDOW_STATE = EnumFlag("D2D1_WINDOW_STATE", [
+D2D1_WINDOW_STATE = EnumFlags("D2D1_WINDOW_STATE", [
"D2D1_WINDOW_STATE_NONE",
"D2D1_WINDOW_STATE_OCCLUDED",
])
@@ -438,13 +438,13 @@ D2D1_FEATURE_LEVEL = Enum("D2D1_FEATURE_LEVEL", [
"D2D1_FEATURE_LEVEL_10",
])
-D2D1_RENDER_TARGET_USAGE = EnumFlag("D2D1_RENDER_TARGET_USAGE", [
+D2D1_RENDER_TARGET_USAGE = EnumFlags("D2D1_RENDER_TARGET_USAGE", [
"D2D1_RENDER_TARGET_USAGE_NONE",
"D2D1_RENDER_TARGET_USAGE_FORCE_BITMAP_REMOTING",
"D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE",
])
-D2D1_PRESENT_OPTIONS = EnumFlag("D2D1_PRESENT_OPTIONS", [
+D2D1_PRESENT_OPTIONS = EnumFlags("D2D1_PRESENT_OPTIONS", [
"D2D1_PRESENT_OPTIONS_NONE",
"D2D1_PRESENT_OPTIONS_RETAIN_CONTENTS",
"D2D1_PRESENT_OPTIONS_IMMEDIATELY",
@@ -465,7 +465,7 @@ D2D1_HWND_RENDER_TARGET_PROPERTIES = Struct("D2D1_HWND_RENDER_TARGET_PROPERTIES"
(D2D1_PRESENT_OPTIONS, "presentOptions"),
])
-D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS = EnumFlag("D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS", [
+D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS = EnumFlags("D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS", [
"D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE",
"D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_GDI_COMPATIBLE",
])
diff --git a/specs/dwrite.py b/specs/dwrite.py
index 60e5034..5d8d211 100644
--- a/specs/dwrite.py
+++ b/specs/dwrite.py
@@ -60,10 +60,6 @@ IDWriteGlyphRunAnalysis = Interface("IDWriteGlyphRunAnalysis", IUnknown)
IDWriteFactory = Interface("IDWriteFactory", IUnknown)
-def EnumFlag(expr, values):
- return Flags(Alias(expr, DWORD), values)
-
-
DWRITE_FONT_FILE_TYPE = Enum("DWRITE_FONT_FILE_TYPE", [
"DWRITE_FONT_FILE_TYPE_UNKNOWN",
"DWRITE_FONT_FILE_TYPE_CFF",
@@ -85,7 +81,7 @@ DWRITE_FONT_FACE_TYPE = Enum("DWRITE_FONT_FACE_TYPE", [
"DWRITE_FONT_FACE_TYPE_UNKNOWN",
])
-DWRITE_FONT_SIMULATIONS = EnumFlag("DWRITE_FONT_SIMULATIONS", [
+DWRITE_FONT_SIMULATIONS = EnumFlags("DWRITE_FONT_SIMULATIONS", [
"DWRITE_FONT_SIMULATIONS_NONE",
"DWRITE_FONT_SIMULATIONS_BOLD",
"DWRITE_FONT_SIMULATIONS_OBLIQUE",
@@ -481,7 +477,7 @@ IDWriteTypography.methods += [
StdMethod(HRESULT, "GetFontFeature", [(UINT32, "fontFeatureIndex"), Out(Pointer(DWRITE_FONT_FEATURE), "fontFeature")]),
]
-DWRITE_SCRIPT_SHAPES = EnumFlag("DWRITE_SCRIPT_SHAPES", [
+DWRITE_SCRIPT_SHAPES = EnumFlags("DWRITE_SCRIPT_SHAPES", [
"DWRITE_SCRIPT_SHAPES_DEFAULT",
"DWRITE_SCRIPT_SHAPES_NO_VISUAL",
])
commit f92ea422795fbaf251545a28e9162f148aa4c999
Author: Jose Fonseca <jfonseca@vmware.com>
Date: Wed May 18 16:16:18 2016 +0100
specs: Add EnumFlags helper.
For enums with flags.
diff --git a/specs/stdapi.py b/specs/stdapi.py
index de0cc93..f36c4e2 100644
--- a/specs/stdapi.py
+++ b/specs/stdapi.py
@@ -268,6 +268,10 @@ class Bitmask(Type):
Flags = Bitmask
+def EnumFlags(name, values):
+ return Flags(Alias(name, UInt), values)
+
+
class Array(Type):
def __init__(self, type_, length):
commit e82b4a137f6333cb3ded51a67266359957ba7a50
Author: Jose Fonseca <jfonseca@vmware.com>
Date: Wed May 18 15:23:41 2016 +0100
dxgitrace: Handle ID3D11Device3::WriteToSubresource correctly.
diff --git a/specs/d3d11.py b/specs/d3d11.py
index f704b06..3313f21 100644
--- a/specs/d3d11.py
+++ b/specs/d3d11.py
@@ -2642,7 +2642,7 @@ ID3D11Device3.methods += [
StdMethod(HRESULT, "CreateQuery1", [(Pointer(Const(D3D11_QUERY_DESC1)), "pQueryDesc1"), Out(Pointer(ObjPointer(ID3D11Query1)), "ppQuery1")]),
StdMethod(Void, "GetImmediateContext3", [Out(Pointer(ObjPointer(ID3D11DeviceContext3)), "ppImmediateContext")]),
StdMethod(HRESULT, "CreateDeferredContext3", [(UINT, "ContextFlags"), Out(Pointer(ObjPointer(ID3D11DeviceContext3)), "ppDeferredContext")]),
- StdMethod(Void, "WriteToSubresource", [(ObjPointer(ID3D11Resource), "pDstResource"), (UINT, "DstSubresource"), (Pointer(Const(D3D11_BOX)), "pDstBox"), (OpaquePointer(Const(Void)), "pSrcData"), (UINT, "SrcRowPitch"), (UINT, "SrcDepthPitch")]), # FIXME
+ StdMethod(Void, "WriteToSubresource", [(ObjPointer(ID3D11Resource), "pDstResource"), (UINT, "DstSubresource"), (Pointer(Const(D3D11_BOX)), "pDstBox"), (Blob(Const(Void), '_calcSubresourceSize(pDstResource, DstSubresource, pDstBox, SrcRowPitch, SrcDepthPitch)'), "pSrcData"), (UINT, "SrcRowPitch"), (UINT, "SrcDepthPitch")]),
StdMethod(Void, "ReadFromSubresource", [Out(OpaquePointer(Void), "pDstData"), (UINT, "DstRowPitch"), (UINT, "DstDepthPitch"), (ObjPointer(ID3D11Resource), "pSrcResource"), (UINT, "SrcSubresource"), (Pointer(Const(D3D11_BOX)), "pSrcBox")], sideeffects=False), # FIXME
]
commit 5c881ed0854317794c97c3abf8f1ce394031f61d
Author: Jose Fonseca <jfonseca@vmware.com>
Date: Wed May 18 14:55:02 2016 +0100
specs/scripts: Several improvements to enable parsing d3d12 headers.
diff --git a/specs/scripts/cxx2api.py b/specs/scripts/cxx2api.py
index fcad15c..95986eb 100755
--- a/specs/scripts/cxx2api.py
+++ b/specs/scripts/cxx2api.py
@@ -151,7 +151,13 @@ class type_dumper_t(type_visitor.type_visitor_t):
self.result = "Double"
def visit_array(self):
- raise NotImplementedError
+ base_type = dump_type(self.type.base)
+ length = self.type.size
+ try:
+ int(length)
+ except ValueError:
+ length = '"%s"' % length
+ self.result = 'Array(%s, %s)' % (base_type, length)
def visit_pointer(self):
base_type = dump_type(self.type.base)
@@ -176,7 +182,13 @@ class type_dumper_t(type_visitor.type_visitor_t):
self.result = 'Pointer(%s)' % base_type
def visit_reference(self):
- self.result = 'Reference(%s)' % dump_type(self.type.base)
+ base_type = dump_type(self.type.base)
+ if base_type == 'Const(IID)':
+ self.result = 'REFIID'
+ elif base_type == 'Const(GUID)':
+ self.result = 'REFGUID'
+ else:
+ self.result = 'Reference(%s)' % base_type
def visit_const(self):
self.result = 'Const(%s)' % dump_type(self.type.base)
@@ -185,6 +197,9 @@ class type_dumper_t(type_visitor.type_visitor_t):
decl = self.type.declaration
self.result = dump_decl(decl)
+ def visit_free_function_type(self):
+ self.result = 'Opaque("%s")' % self.type
+
def dump_type(type):
visitor = type_dumper_t(type)
@@ -251,7 +266,7 @@ class decl2_dumper_t(decl_visitor.decl_visitor_t):
def visit_struct(self, decl_name, decl):
struct = decl
print(r'%s = Struct(%r, [' % (decl_name, decl_name))
- for variable in struct.variables():
+ for variable in struct.variables(allow_empty=True):
var_type = dump_type(variable.type)
print(r' (%s, %r),' % (var_type, variable.name))
print(r'])')
@@ -335,6 +350,9 @@ class decl2_dumper_t(decl_visitor.decl_visitor_t):
arg_types = self.convert_args(function.arguments)
s.write(' StdFunction(%s, %r, [%s]),\n' % (ret_type, function.name, arg_types))
+ def visit_free_operator(self):
+ pass
+
def main():
defines = []
@@ -393,6 +411,8 @@ def main():
'_WIN32_WINNT=0x%04X' % winver,
'WINVER=0x%04X' % winver,
'NTDDI_VERSION=0x%04X0000' % winver,
+ # Prevent headers from requiring a rpcndr.h version beyond MinGW's
+ '__REQUIRED_RPCNDR_H_VERSION__=475',
# Avoid C++ helper classes
'D3D10_NO_HELPERS',
'D3D11_NO_HELPERS',
@@ -455,6 +475,10 @@ def main():
for decl in global_ns.declarations:
if not decl_filter(decl):
continue
+
+ if sys.stdout.isatty():
+ print('# ' + str(decl))
+
visitor.decl = decl
algorithm.apply_visitor(visitor, decl)
visitor.finish()
commit c0cfbd20bd5a24bc62acb06f35320b2c667b392b
Author: Jose Fonseca <jfonseca@vmware.com>
Date: Wed May 18 11:05:35 2016 +0100
specs/scripts: Use print function in cxx2api.
diff --git a/specs/scripts/cxx2api.py b/specs/scripts/cxx2api.py
index fa9a9d6..fcad15c 100755
--- a/specs/scripts/cxx2api.py
+++ b/specs/scripts/cxx2api.py
@@ -1,4 +1,7 @@
#!/usr/bin/env python
+
+from __future__ import print_function
+
copyright = '''
##########################################################################
#
@@ -156,7 +159,7 @@ class type_dumper_t(type_visitor.type_visitor_t):
#if isinstance(self.type.base, declarations.cpptypes.declarated_t):
# decl = self.type.base.declaration
# if isinstance(decl, declarations.typedef.typedef_t):
- # print decl.type, type(decl.type)
+ # print(decl.type, type(decl.type))
# if isinstance(decl, declarations.class_declaration.class_t):
# if decl.public_members:
# self.result = 'ObjPointer(%s)' % decl.name
@@ -216,11 +219,11 @@ class decl2_dumper_t(decl_visitor.decl_visitor_t):
self.functions = StringIO.StringIO()
def start(self):
- print copyright.strip()
- print
- print
- print r'from winapi import *'
- print
+ print(copyright.strip())
+ print()
+ print()
+ print(r'from winapi import *')
+ print()
def finish(self):
sys.stdout.write(self.interfaces.getvalue())
@@ -247,12 +250,12 @@ class decl2_dumper_t(decl_visitor.decl_visitor_t):
def visit_struct(self, decl_name, decl):
struct = decl
- print r'%s = Struct(%r, [' % (decl_name, decl_name)
+ print(r'%s = Struct(%r, [' % (decl_name, decl_name))
for variable in struct.variables():
var_type = dump_type(variable.type)
- print r' (%s, %r),' % (var_type, variable.name)
- print r'])'
- print
+ print(r' (%s, %r),' % (var_type, variable.name))
+ print(r'])')
+ print()
def visit_interface(self):
class_ = self.decl
@@ -308,16 +311,16 @@ class decl2_dumper_t(decl_visitor.decl_visitor_t):
base_decl = typedef.type.declaration
self.visit_struct(typedef.name, base_decl)
return
- print r'%s = Alias(%r, %s)' % (typedef.name, typedef.name, base_type)
- print
+ print(r'%s = Alias(%r, %s)' % (typedef.name, typedef.name, base_type))
+ print()
def visit_enumeration(self):
enum = self.decl
- print r'%s = Enum(%r, [' % (enum.name, enum.name)
+ print(r'%s = Enum(%r, [' % (enum.name, enum.name))
for name, value in enum.values:
- print r' %r,' % (name,)
- print r'])'
- print
+ print(r' %r,' % (name,))
+ print(r'])')
+ print()
def visit_variable(self):
pass
commit fe66fc08bdc5b9bc9b5acb04ca19122650314656
Author: Jose Fonseca <jfonseca@vmware.com>
Date: Wed May 18 11:00:03 2016 +0100
specs/scripts: Make cxx2api agnostic to MinGW compiler version.
diff --git a/specs/scripts/cxx2api.py b/specs/scripts/cxx2api.py
index 6a97934..fa9a9d6 100755
--- a/specs/scripts/cxx2api.py
+++ b/specs/scripts/cxx2api.py
@@ -359,37 +359,21 @@ def main():
winsdk = True
if winsdk:
# Set up Clang compiler flags to use MinGW runtime
- if 0:
- # XXX: This doesn't work
- # http://stackoverflow.com/a/19839946
- p = subprocess.Popen(
- ["x86_64-w64-mingw32-g++", "-x", "c++", "-E", "-Wp,-v", '-', '-fsyntax-only'],
- stdin = open(os.devnull, 'rt'),
- stdout = open(os.devnull, 'wt'),
- stderr=subprocess.PIPE)
- includes.append('/usr/share/castxml/clang/include')
- for line in p.stderr:
- if line.startswith(' '):
- include = line.strip()
- if os.path.isdir(include):
- includes.append(os.path.normpath(include))
- elif 0:
- # XXX: This matches what wclang does, but doensn't work neither
- cxxflags += [
- "-target", "x86_64-w64-mingw32",
- "-nostdinc",
- "-isystem", "/usr/lib/clang/3.6.0/include",
- "-isystem", "/usr/x86_64-w64-mingw32/include",
- "-isystem", "/usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/include/c++",
- "-isystem", "/usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/include/c++/x86_64-w64-mingw32",
- ]
- else:
- # This works somehow, but seems brittle
- includes += [
- '/usr/x86_64-w64-mingw32/include',
- '/usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/include/c++',
- '/usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/include/c++/x86_64-w64-mingw32',
- ]
+ # http://stackoverflow.com/a/19839946
+ p = subprocess.Popen(
+ ["x86_64-w64-mingw32-g++", "-x", "c++", "-E", "-Wp,-v", '-', '-fsyntax-only'],
+ stdin=open(os.devnull, 'rt'),
+ stdout=open(os.devnull, 'wt'),
+ stderr=subprocess.PIPE)
+ includes.append('/usr/share/castxml/clang/include')
+ for line in p.stderr:
+ if line.startswith(' '):
+ include = line.strip()
+ if os.path.isdir(include):
+ if os.path.exists(os.path.join(include, 'ia32intrin.h')):
+ # XXX: We must use Clang's intrinsic headers
+ continue
+ includes.append(os.path.normpath(include))
winver = 0x0602
commit 2e29588754727a264bcfa4c2c27df59239c97f04
Author: Jose Fonseca <jfonseca@vmware.com>
Date: Mon May 16 14:20:39 2016 +0100
d3dretrace: Ensure DXVA2_DecodeExecuteParams::pExtensionData is allocated.
Reply to: