From 8ebdc7a7f3761313dcedbfcebcf768e9fcc92515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 22 Aug 2014 14:27:41 +0100 Subject: [PATCH] apps/d3d1[01]: More comprehensive map tests. --- apps/d3d10/CMakeLists.txt | 11 +- .../{map_no_overwrite.cpp => map_buffer.cpp} | 77 ++++++++-- apps/d3d10/map_buffer_no_overwrite.ref.txt | 136 ++++++++++++++++++ apps/d3d10/map_buffer_staging.ref.txt | 136 ++++++++++++++++++ apps/d3d10/map_no_overwrite.ref.txt | 32 ----- apps/d3d10/tri.ref.txt | 1 + apps/d3d11/CMakeLists.txt | 11 +- .../{map_no_overwrite.cpp => map_buffer.cpp} | 80 +++++++++-- apps/d3d11/map_buffer_no_overwrite.ref.txt | 133 +++++++++++++++++ apps/d3d11/map_buffer_staging.ref.txt | 133 +++++++++++++++++ apps/d3d11/map_no_overwrite.ref.txt | 29 ---- apps/d3d11/tri.ref.txt | 1 + apps/d3d11_1/tri.cpp | 33 ++++- apps/d3dcommon/com_ptr.hpp | 15 ++ apps/gl/tri.ref.flush.png | Bin 5274 -> 0 bytes 15 files changed, 719 insertions(+), 109 deletions(-) rename apps/d3d10/{map_no_overwrite.cpp => map_buffer.cpp} (59%) create mode 100644 apps/d3d10/map_buffer_no_overwrite.ref.txt create mode 100644 apps/d3d10/map_buffer_staging.ref.txt delete mode 100644 apps/d3d10/map_no_overwrite.ref.txt rename apps/d3d11/{map_no_overwrite.cpp => map_buffer.cpp} (59%) create mode 100644 apps/d3d11/map_buffer_no_overwrite.ref.txt create mode 100644 apps/d3d11/map_buffer_staging.ref.txt delete mode 100644 apps/d3d11/map_no_overwrite.ref.txt delete mode 100644 apps/gl/tri.ref.flush.png diff --git a/apps/d3d10/CMakeLists.txt b/apps/d3d10/CMakeLists.txt index e678518..edf15b1 100644 --- a/apps/d3d10/CMakeLists.txt +++ b/apps/d3d10/CMakeLists.txt @@ -12,19 +12,12 @@ set (api d3d10) set (targets tri - map_no_overwrite + map_buffer ) foreach (target ${targets}) add_executable (${api}_${target} ${target}.cpp) set_target_properties (${api}_${target} PROPERTIES OUTPUT_NAME ${target}) - - if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${target}.ref.txt) - add_app_test( - NAME ${api}_${target} - TARGET ${api}_${target} - REF ${target}.ref.txt - ) - endif () endforeach (target) +add_app_tests () diff --git a/apps/d3d10/map_no_overwrite.cpp b/apps/d3d10/map_buffer.cpp similarity index 59% rename from apps/d3d10/map_no_overwrite.cpp rename to apps/d3d10/map_buffer.cpp index 5c5b3d6..99ae369 100644 --- a/apps/d3d10/map_no_overwrite.cpp +++ b/apps/d3d10/map_buffer.cpp @@ -48,6 +48,19 @@ main(int argc, char *argv[]) { HRESULT hr; + D3D10_USAGE Usage = D3D10_USAGE_DYNAMIC; + for (int i = 1; i < argc; ++i) { + const char *arg = argv[i]; + if (strcmp(arg, "-dynamic") == 0) { + Usage = D3D10_USAGE_DYNAMIC; + } else if (strcmp(arg, "-staging") == 0) { + Usage = D3D10_USAGE_STAGING; + } else { + fprintf(stderr, "error: unknown arg %s\n", arg); + exit(1); + } + } + com_ptr pFactory; hr = CreateDXGIFactory(IID_IDXGIFactory, (void**)&pFactory); if (FAILED(hr)) { @@ -76,35 +89,71 @@ main(int argc, char *argv[]) return 1; } + UINT NumBuffers = 4; UINT NumSegments = 8; UINT SegmentSize = 512; D3D10_BUFFER_DESC BufferDesc; ZeroMemory(&BufferDesc, sizeof BufferDesc); - BufferDesc.Usage = D3D10_USAGE_DYNAMIC; BufferDesc.ByteWidth = NumSegments * SegmentSize; - BufferDesc.BindFlags = D3D10_BIND_VERTEX_BUFFER; BufferDesc.CPUAccessFlags = D3D10_CPU_ACCESS_WRITE; BufferDesc.MiscFlags = 0; - - com_ptr pVertexBuffer; - hr = pDevice->CreateBuffer(&BufferDesc, NULL, &pVertexBuffer); - if (FAILED(hr)) { - return 1; + BufferDesc.Usage = Usage; + if (Usage == D3D10_USAGE_STAGING) { + BufferDesc.BindFlags = 0; + } else { + BufferDesc.BindFlags = D3D10_BIND_VERTEX_BUFFER; } - for (UINT j = 0; j < NumSegments; ++j) { - D3D10_MAP MapType = j == 0 ? D3D10_MAP_WRITE_DISCARD : D3D10_MAP_WRITE_NO_OVERWRITE; - BYTE *pMap = NULL; - hr = pVertexBuffer->Map(MapType, 0, (void **)&pMap); + D3D10_MAP MapType = D3D10_MAP_WRITE; + for (UINT i = 0; i < NumBuffers; ++i) { + com_ptr pVertexBuffer; + hr = pDevice->CreateBuffer(&BufferDesc, NULL, &pVertexBuffer); + if (FAILED(hr)) { + return 1; + } + + if (Usage == D3D10_USAGE_DYNAMIC) { + MapType = D3D10_MAP_WRITE_DISCARD; + } + + for (UINT j = 0; j < NumSegments; ++j) { + BYTE *pMap = NULL; + hr = pVertexBuffer->Map(MapType, 0, (void **)&pMap); + if (FAILED(hr)) { + return 1; + } + + int c = (j % 255) + 1; + memset(pMap + j*SegmentSize, c, SegmentSize); + + pVertexBuffer->Unmap(); + + if (Usage == D3D10_USAGE_DYNAMIC) { + MapType = D3D10_MAP_WRITE_NO_OVERWRITE; + } + } + + pDevice->Flush(); + + D3D10_QUERY_DESC QueryDesc; + QueryDesc.Query = D3D10_QUERY_EVENT; + QueryDesc.MiscFlags = 0; + com_ptr pQuery; + hr = pDevice->CreateQuery(&QueryDesc, &pQuery); if (FAILED(hr)) { return 1; } + + pQuery->End(); - int c = (j % 255) + 1; - memset(pMap + j*SegmentSize, c, SegmentSize); + do { + hr = pQuery->GetData(NULL, 0, 0); + } while (hr == S_FALSE); + if (FAILED(hr)) { + return 1; + } - pVertexBuffer->Unmap(); } return 0; diff --git a/apps/d3d10/map_buffer_no_overwrite.ref.txt b/apps/d3d10/map_buffer_no_overwrite.ref.txt new file mode 100644 index 0000000..1e95574 --- /dev/null +++ b/apps/d3d10/map_buffer_no_overwrite.ref.txt @@ -0,0 +1,136 @@ +//!map_buffer -dynamic +CreateDXGIFactory(riid = {Data1 = 2071029484, Data2 = 8647, Data3 = 17582, Data4 = {178, 26, 201, 174, 50, 26, 227, 105}}, ppFactory = &) = S_OK +IDXGIFactory::EnumAdapters(this = , Adapter = 0, ppAdapter = &) = S_OK +D3D10CreateDevice(pAdapter = , DriverType = D3D10_DRIVER_TYPE_HARDWARE, Software = NULL, Flags = <>, SDKVersion = 29, ppDevice = &) = S_OK + +ID3D10Device::CreateBuffer(this = , pDesc = &{ByteWidth = 4096, Usage = D3D10_USAGE_DYNAMIC, BindFlags = D3D10_BIND_VERTEX_BUFFER, CPUAccessFlags = D3D10_CPU_ACCESS_WRITE, MiscFlags = 0x0}, pInitialData = NULL, ppBuffer = &) = S_OK +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_DISCARD, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Device::Flush(this = ) +ID3D10Device::CreateQuery(this = , pQueryDesc = &{Query = D3D10_QUERY_EVENT, MiscFlags = 0x0}, ppQuery = &) = S_OK +ID3D10Query::End(this = ) +ID3D10Query::GetData(this = , pData = NULL, DataSize = 0, GetDataFlags = 0x0) = S_OK +ID3D10Query::Release(this = ) = 0 +ID3D10Buffer::Release(this = ) = 0 + +ID3D10Device::CreateBuffer(this = , pDesc = &{ByteWidth = 4096, Usage = D3D10_USAGE_DYNAMIC, BindFlags = D3D10_BIND_VERTEX_BUFFER, CPUAccessFlags = D3D10_CPU_ACCESS_WRITE, MiscFlags = 0x0}, pInitialData = NULL, ppBuffer = &) = S_OK +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_DISCARD, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Device::Flush(this = ) +ID3D10Device::CreateQuery(this = , pQueryDesc = &{Query = D3D10_QUERY_EVENT, MiscFlags = 0x0}, ppQuery = &) = S_OK +ID3D10Query::End(this = ) +ID3D10Query::GetData(this = , pData = NULL, DataSize = 0, GetDataFlags = 0x0) = S_OK +ID3D10Query::Release(this = ) = 0 +ID3D10Buffer::Release(this = ) = 0 + +ID3D10Device::CreateBuffer(this = , pDesc = &{ByteWidth = 4096, Usage = D3D10_USAGE_DYNAMIC, BindFlags = D3D10_BIND_VERTEX_BUFFER, CPUAccessFlags = D3D10_CPU_ACCESS_WRITE, MiscFlags = 0x0}, pInitialData = NULL, ppBuffer = &) = S_OK +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_DISCARD, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Device::Flush(this = ) +ID3D10Device::CreateQuery(this = , pQueryDesc = &{Query = D3D10_QUERY_EVENT, MiscFlags = 0x0}, ppQuery = &) = S_OK +ID3D10Query::End(this = ) +ID3D10Query::GetData(this = , pData = NULL, DataSize = 0, GetDataFlags = 0x0) = S_OK +ID3D10Query::Release(this = ) = 0 +ID3D10Buffer::Release(this = ) = 0 + +ID3D10Device::CreateBuffer(this = , pDesc = &{ByteWidth = 4096, Usage = D3D10_USAGE_DYNAMIC, BindFlags = D3D10_BIND_VERTEX_BUFFER, CPUAccessFlags = D3D10_CPU_ACCESS_WRITE, MiscFlags = 0x0}, pInitialData = NULL, ppBuffer = &) = S_OK +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_DISCARD, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Device::Flush(this = ) +ID3D10Device::CreateQuery(this = , pQueryDesc = &{Query = D3D10_QUERY_EVENT, MiscFlags = 0x0}, ppQuery = &) = S_OK +ID3D10Query::End(this = ) +ID3D10Query::GetData(this = , pData = NULL, DataSize = 0, GetDataFlags = 0x0) = S_OK +ID3D10Query::Release(this = ) = 0 +ID3D10Buffer::Release(this = ) = 0 + +ID3D10Device::Release(this = ) = 0 +IDXGIAdapter::Release(this = ) = 0 +IDXGIFactory::Release(this = ) = 0 diff --git a/apps/d3d10/map_buffer_staging.ref.txt b/apps/d3d10/map_buffer_staging.ref.txt new file mode 100644 index 0000000..368edfd --- /dev/null +++ b/apps/d3d10/map_buffer_staging.ref.txt @@ -0,0 +1,136 @@ +//!map_buffer -staging +CreateDXGIFactory(riid = {Data1 = 2071029484, Data2 = 8647, Data3 = 17582, Data4 = {178, 26, 201, 174, 50, 26, 227, 105}}, ppFactory = &) = S_OK +IDXGIFactory::EnumAdapters(this = , Adapter = 0, ppAdapter = &) = S_OK +D3D10CreateDevice(pAdapter = , DriverType = D3D10_DRIVER_TYPE_HARDWARE, Software = NULL, Flags = <>, SDKVersion = 29, ppDevice = &) = S_OK + +ID3D10Device::CreateBuffer(this = , pDesc = &{ByteWidth = 4096, Usage = D3D10_USAGE_STAGING, BindFlags = 0, CPUAccessFlags = D3D10_CPU_ACCESS_WRITE, MiscFlags = 0x0}, pInitialData = NULL, ppBuffer = &) = S_OK +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Device::Flush(this = ) +ID3D10Device::CreateQuery(this = , pQueryDesc = &{Query = D3D10_QUERY_EVENT, MiscFlags = 0x0}, ppQuery = &) = S_OK +ID3D10Query::End(this = ) +ID3D10Query::GetData(this = , pData = NULL, DataSize = 0, GetDataFlags = 0x0) = S_OK +ID3D10Query::Release(this = ) = 0 +ID3D10Buffer::Release(this = ) = 0 + +ID3D10Device::CreateBuffer(this = , pDesc = &{ByteWidth = 4096, Usage = D3D10_USAGE_STAGING, BindFlags = 0, CPUAccessFlags = D3D10_CPU_ACCESS_WRITE, MiscFlags = 0x0}, pInitialData = NULL, ppBuffer = &) = S_OK +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Device::Flush(this = ) +ID3D10Device::CreateQuery(this = , pQueryDesc = &{Query = D3D10_QUERY_EVENT, MiscFlags = 0x0}, ppQuery = &) = S_OK +ID3D10Query::End(this = ) +ID3D10Query::GetData(this = , pData = NULL, DataSize = 0, GetDataFlags = 0x0) = S_OK +ID3D10Query::Release(this = ) = 0 +ID3D10Buffer::Release(this = ) = 0 + +ID3D10Device::CreateBuffer(this = , pDesc = &{ByteWidth = 4096, Usage = D3D10_USAGE_STAGING, BindFlags = 0, CPUAccessFlags = D3D10_CPU_ACCESS_WRITE, MiscFlags = 0x0}, pInitialData = NULL, ppBuffer = &) = S_OK +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Device::Flush(this = ) +ID3D10Device::CreateQuery(this = , pQueryDesc = &{Query = D3D10_QUERY_EVENT, MiscFlags = 0x0}, ppQuery = &) = S_OK +ID3D10Query::End(this = ) +ID3D10Query::GetData(this = , pData = NULL, DataSize = 0, GetDataFlags = 0x0) = S_OK +ID3D10Query::Release(this = ) = 0 +ID3D10Buffer::Release(this = ) = 0 + +ID3D10Device::CreateBuffer(this = , pDesc = &{ByteWidth = 4096, Usage = D3D10_USAGE_STAGING, BindFlags = 0, CPUAccessFlags = D3D10_CPU_ACCESS_WRITE, MiscFlags = 0x0}, pInitialData = NULL, ppBuffer = &) = S_OK +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE, MapFlags = 0x0, ppData = &) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D10Buffer::Unmap(this = ) +ID3D10Device::Flush(this = ) +ID3D10Device::CreateQuery(this = , pQueryDesc = &{Query = D3D10_QUERY_EVENT, MiscFlags = 0x0}, ppQuery = &) = S_OK +ID3D10Query::End(this = ) +ID3D10Query::GetData(this = , pData = NULL, DataSize = 0, GetDataFlags = 0x0) = S_OK +ID3D10Query::Release(this = ) = 0 +ID3D10Buffer::Release(this = ) = 0 + +ID3D10Device::Release(this = ) = 0 +IDXGIAdapter::Release(this = ) = 0 +IDXGIFactory::Release(this = ) = 0 diff --git a/apps/d3d10/map_no_overwrite.ref.txt b/apps/d3d10/map_no_overwrite.ref.txt deleted file mode 100644 index b507e39..0000000 --- a/apps/d3d10/map_no_overwrite.ref.txt +++ /dev/null @@ -1,32 +0,0 @@ -CreateDXGIFactory(riid = {Data1 = 2071029484, Data2 = 8647, Data3 = 17582, Data4 = {178, 26, 201, 174, 50, 26, 227, 105}}, ppFactory = &) = S_OK -IDXGIFactory::EnumAdapters(this = , Adapter = 0, ppAdapter = &) = S_OK -D3D10CreateDevice(pAdapter = , DriverType = D3D10_DRIVER_TYPE_HARDWARE, Software = NULL, Flags = <>, SDKVersion = 29, ppDevice = &) = S_OK -ID3D10Device::CreateBuffer(this = , pDesc = &{ByteWidth = 4096, Usage = D3D10_USAGE_DYNAMIC, BindFlags = D3D10_BIND_VERTEX_BUFFER, CPUAccessFlags = D3D10_CPU_ACCESS_WRITE, MiscFlags = 0x0}, pInitialData = NULL, ppBuffer = &) = S_OK -ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_DISCARD, MapFlags = 0x0, ppData = &) = S_OK -memcpy(dest = , src = blob(4096), n = 4096) -ID3D10Buffer::Unmap(this = ) -ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK -memcpy(dest = , src = blob(4096), n = 4096) -ID3D10Buffer::Unmap(this = ) -ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK -memcpy(dest = , src = blob(4096), n = 4096) -ID3D10Buffer::Unmap(this = ) -ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK -memcpy(dest = , src = blob(4096), n = 4096) -ID3D10Buffer::Unmap(this = ) -ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK -memcpy(dest = , src = blob(4096), n = 4096) -ID3D10Buffer::Unmap(this = ) -ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK -memcpy(dest = , src = blob(4096), n = 4096) -ID3D10Buffer::Unmap(this = ) -ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK -memcpy(dest = , src = blob(4096), n = 4096) -ID3D10Buffer::Unmap(this = ) -ID3D10Buffer::Map(this = , MapType = D3D10_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, ppData = &) = S_OK -memcpy(dest = , src = blob(4096), n = 4096) -ID3D10Buffer::Unmap(this = ) -ID3D10Buffer::Release(this = ) = 0 -ID3D10Device::Release(this = ) = 0 -IDXGIAdapter::Release(this = ) = 0 -IDXGIFactory::Release(this = ) = 0 diff --git a/apps/d3d10/tri.ref.txt b/apps/d3d10/tri.ref.txt index 95f8f1e..c26239e 100644 --- a/apps/d3d10/tri.ref.txt +++ b/apps/d3d10/tri.ref.txt @@ -1,3 +1,4 @@ +//!tri CreateDXGIFactory(riid = {Data1 = 2071029484, Data2 = 8647, Data3 = 17582, Data4 = {178, 26, 201, 174, 50, 26, 227, 105}}, ppFactory = &) = S_OK IDXGIFactory::EnumAdapters(this = , Adapter = 0, ppAdapter = &) = S_OK D3D10CreateDevice(pAdapter = , DriverType = D3D10_DRIVER_TYPE_HARDWARE, Software = NULL, Flags = <>, SDKVersion = 29, ppDevice = &) = S_OK diff --git a/apps/d3d11/CMakeLists.txt b/apps/d3d11/CMakeLists.txt index a2b0bc1..f30db49 100644 --- a/apps/d3d11/CMakeLists.txt +++ b/apps/d3d11/CMakeLists.txt @@ -11,19 +11,12 @@ set (api d3d11) set (targets tri - map_no_overwrite + map_buffer ) foreach (target ${targets}) add_executable (${api}_${target} ${target}.cpp) set_target_properties (${api}_${target} PROPERTIES OUTPUT_NAME ${target}) - - if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${target}.ref.txt) - add_app_test( - NAME ${api}_${target} - TARGET ${api}_${target} - REF ${target}.ref.txt - ) - endif () endforeach (target) +add_app_tests () diff --git a/apps/d3d11/map_no_overwrite.cpp b/apps/d3d11/map_buffer.cpp similarity index 59% rename from apps/d3d11/map_no_overwrite.cpp rename to apps/d3d11/map_buffer.cpp index d15946e..26f5ed2 100644 --- a/apps/d3d11/map_no_overwrite.cpp +++ b/apps/d3d11/map_buffer.cpp @@ -48,6 +48,19 @@ main(int argc, char *argv[]) { HRESULT hr; + D3D11_USAGE Usage = D3D11_USAGE_DYNAMIC; + for (int i = 1; i < argc; ++i) { + const char *arg = argv[i]; + if (strcmp(arg, "-dynamic") == 0) { + Usage = D3D11_USAGE_DYNAMIC; + } else if (strcmp(arg, "-staging") == 0) { + Usage = D3D11_USAGE_STAGING; + } else { + fprintf(stderr, "error: unknown arg %s\n", arg); + exit(1); + } + } + UINT Flags = 0; if (LoadLibraryA("d3d11sdklayers")) { Flags |= D3D11_CREATE_DEVICE_DEBUG; @@ -75,37 +88,74 @@ main(int argc, char *argv[]) return 1; } + UINT NumBuffers = 4; UINT NumSegments = 8; UINT SegmentSize = 512; D3D11_BUFFER_DESC BufferDesc; ZeroMemory(&BufferDesc, sizeof BufferDesc); - BufferDesc.Usage = D3D11_USAGE_DYNAMIC; BufferDesc.ByteWidth = NumSegments * SegmentSize; - BufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; BufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; BufferDesc.MiscFlags = 0; - - com_ptr pVertexBuffer; - hr = pDevice->CreateBuffer(&BufferDesc, NULL, &pVertexBuffer); - if (FAILED(hr)) { - return 1; + BufferDesc.Usage = Usage; + if (Usage == D3D11_USAGE_STAGING) { + BufferDesc.BindFlags = 0; + } else { + BufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; } - for (UINT j = 0; j < NumSegments; ++j) { - D3D11_MAP MapType = j == 0 ? D3D11_MAP_WRITE_DISCARD : D3D11_MAP_WRITE_NO_OVERWRITE; - D3D11_MAPPED_SUBRESOURCE MappedResource; - hr = pDeviceContext->Map(pVertexBuffer, 0, MapType, 0, &MappedResource); + D3D11_MAP MapType = D3D11_MAP_WRITE; + for (UINT i = 0; i < NumBuffers; ++i) { + com_ptr pVertexBuffer; + hr = pDevice->CreateBuffer(&BufferDesc, NULL, &pVertexBuffer); + if (FAILED(hr)) { + return 1; + } + + if (Usage == D3D11_USAGE_DYNAMIC) { + MapType = D3D11_MAP_WRITE_DISCARD; + } + + for (UINT j = 0; j < NumSegments; ++j) { + D3D11_MAPPED_SUBRESOURCE MappedResource; + + hr = pDeviceContext->Map(pVertexBuffer, 0, MapType, 0, &MappedResource); + if (FAILED(hr)) { + return 1; + } + + BYTE *pMap = (BYTE *)MappedResource.pData; + + int c = (j % 255) + 1; + memset(pMap + j*SegmentSize, c, SegmentSize); + + pDeviceContext->Unmap(pVertexBuffer, 0); + + if (Usage == D3D11_USAGE_DYNAMIC) { + MapType = D3D11_MAP_WRITE_NO_OVERWRITE; + } + } + + pDeviceContext->Flush(); + + D3D11_QUERY_DESC QueryDesc; + QueryDesc.Query = D3D11_QUERY_EVENT; + QueryDesc.MiscFlags = 0; + com_ptr pQuery; + hr = pDevice->CreateQuery(&QueryDesc, &pQuery); if (FAILED(hr)) { return 1; } - BYTE *pMap = (BYTE *)MappedResource.pData; + pDeviceContext->End(pQuery); - int c = (j % 255) + 1; - memset(pMap + j*SegmentSize, c, SegmentSize); + do { + hr = pDeviceContext->GetData(pQuery, NULL, 0, 0); + } while (hr == S_FALSE); + if (FAILED(hr)) { + return 1; + } - pDeviceContext->Unmap(pVertexBuffer, 0); } return 0; diff --git a/apps/d3d11/map_buffer_no_overwrite.ref.txt b/apps/d3d11/map_buffer_no_overwrite.ref.txt new file mode 100644 index 0000000..81bd7d2 --- /dev/null +++ b/apps/d3d11/map_buffer_no_overwrite.ref.txt @@ -0,0 +1,133 @@ +//!map_buffer -dynamic +D3D11CreateDevice(pAdapter = NULL, DriverType = D3D_DRIVER_TYPE_HARDWARE, Software = NULL, Flags = <>, pFeatureLevels = {D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_10_0}, FeatureLevels = 3, SDKVersion = 7, ppDevice = &, pFeatureLevel = NULL, ppImmediateContext = &) = S_OK + +ID3D11Device::CreateBuffer(this = , pDesc = &{ByteWidth = 4096, Usage = D3D11_USAGE_DYNAMIC, BindFlags = D3D11_BIND_VERTEX_BUFFER, CPUAccessFlags = D3D11_CPU_ACCESS_WRITE, MiscFlags = 0x0, StructureByteStride = 0}, pInitialData = NULL, ppBuffer = &) = S_OK +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_DISCARD, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Flush(this = ) +ID3D11Device::CreateQuery(this = , pQueryDesc = &{Query = D3D11_QUERY_EVENT, MiscFlags = 0x0}, ppQuery = &) = S_OK +ID3D11DeviceContext::End(this = , pAsync = ) +ID3D11DeviceContext::GetData(this = , pAsync = , pData = NULL, DataSize = 0, GetDataFlags = 0x0) = S_OK +ID3D11Query::Release(this = ) = 0 +ID3D11Buffer::Release(this = ) = 0 + +ID3D11Device::CreateBuffer(this = , pDesc = &{ByteWidth = 4096, Usage = D3D11_USAGE_DYNAMIC, BindFlags = D3D11_BIND_VERTEX_BUFFER, CPUAccessFlags = D3D11_CPU_ACCESS_WRITE, MiscFlags = 0x0, StructureByteStride = 0}, pInitialData = NULL, ppBuffer = &) = S_OK +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_DISCARD, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Flush(this = ) +ID3D11Device::CreateQuery(this = , pQueryDesc = &{Query = D3D11_QUERY_EVENT, MiscFlags = 0x0}, ppQuery = &) = S_OK +ID3D11DeviceContext::End(this = , pAsync = ) +ID3D11DeviceContext::GetData(this = , pAsync = , pData = NULL, DataSize = 0, GetDataFlags = 0x0) = S_OK +ID3D11Query::Release(this = ) = 0 +ID3D11Buffer::Release(this = ) = 0 + +ID3D11Device::CreateBuffer(this = , pDesc = &{ByteWidth = 4096, Usage = D3D11_USAGE_DYNAMIC, BindFlags = D3D11_BIND_VERTEX_BUFFER, CPUAccessFlags = D3D11_CPU_ACCESS_WRITE, MiscFlags = 0x0, StructureByteStride = 0}, pInitialData = NULL, ppBuffer = &) = S_OK +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_DISCARD, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Flush(this = ) +ID3D11Device::CreateQuery(this = , pQueryDesc = &{Query = D3D11_QUERY_EVENT, MiscFlags = 0x0}, ppQuery = &) = S_OK +ID3D11DeviceContext::End(this = , pAsync = ) +ID3D11DeviceContext::GetData(this = , pAsync = , pData = NULL, DataSize = 0, GetDataFlags = 0x0) = S_OK +ID3D11Query::Release(this = ) = 0 +ID3D11Buffer::Release(this = ) = 0 + +ID3D11Device::CreateBuffer(this = , pDesc = &{ByteWidth = 4096, Usage = D3D11_USAGE_DYNAMIC, BindFlags = D3D11_BIND_VERTEX_BUFFER, CPUAccessFlags = D3D11_CPU_ACCESS_WRITE, MiscFlags = 0x0, StructureByteStride = 0}, pInitialData = NULL, ppBuffer = &) = S_OK +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_DISCARD, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Flush(this = ) +ID3D11Device::CreateQuery(this = , pQueryDesc = &{Query = D3D11_QUERY_EVENT, MiscFlags = 0x0}, ppQuery = &) = S_OK +ID3D11DeviceContext::End(this = , pAsync = ) +ID3D11DeviceContext::GetData(this = , pAsync = , pData = NULL, DataSize = 0, GetDataFlags = 0x0) = S_OK +ID3D11Query::Release(this = ) = 0 +ID3D11Buffer::Release(this = ) = 0 + +ID3D11DeviceContext::Release(this = ) = 0 +ID3D11Device::Release(this = ) = 0 diff --git a/apps/d3d11/map_buffer_staging.ref.txt b/apps/d3d11/map_buffer_staging.ref.txt new file mode 100644 index 0000000..ba85a78 --- /dev/null +++ b/apps/d3d11/map_buffer_staging.ref.txt @@ -0,0 +1,133 @@ +//!map_buffer -staging +D3D11CreateDevice(pAdapter = NULL, DriverType = D3D_DRIVER_TYPE_HARDWARE, Software = NULL, Flags = <>, pFeatureLevels = {D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_10_0}, FeatureLevels = 3, SDKVersion = 7, ppDevice = &, pFeatureLevel = NULL, ppImmediateContext = &) = S_OK + +ID3D11Device::CreateBuffer(this = , pDesc = &{ByteWidth = 4096, Usage = D3D11_USAGE_STAGING, BindFlags = 0, CPUAccessFlags = D3D11_CPU_ACCESS_WRITE, MiscFlags = 0x0, StructureByteStride = 0}, pInitialData = NULL, ppBuffer = &) = S_OK +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Flush(this = ) +ID3D11Device::CreateQuery(this = , pQueryDesc = &{Query = D3D11_QUERY_EVENT, MiscFlags = 0x0}, ppQuery = &) = S_OK +ID3D11DeviceContext::End(this = , pAsync = ) +ID3D11DeviceContext::GetData(this = , pAsync = , pData = NULL, DataSize = 0, GetDataFlags = 0x0) = S_OK +ID3D11Query::Release(this = ) = 0 +ID3D11Buffer::Release(this = ) = 0 + +ID3D11Device::CreateBuffer(this = , pDesc = &{ByteWidth = 4096, Usage = D3D11_USAGE_STAGING, BindFlags = 0, CPUAccessFlags = D3D11_CPU_ACCESS_WRITE, MiscFlags = 0x0, StructureByteStride = 0}, pInitialData = NULL, ppBuffer = &) = S_OK +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Flush(this = ) +ID3D11Device::CreateQuery(this = , pQueryDesc = &{Query = D3D11_QUERY_EVENT, MiscFlags = 0x0}, ppQuery = &) = S_OK +ID3D11DeviceContext::End(this = , pAsync = ) +ID3D11DeviceContext::GetData(this = , pAsync = , pData = NULL, DataSize = 0, GetDataFlags = 0x0) = S_OK +ID3D11Query::Release(this = ) = 0 +ID3D11Buffer::Release(this = ) = 0 + +ID3D11Device::CreateBuffer(this = , pDesc = &{ByteWidth = 4096, Usage = D3D11_USAGE_STAGING, BindFlags = 0, CPUAccessFlags = D3D11_CPU_ACCESS_WRITE, MiscFlags = 0x0, StructureByteStride = 0}, pInitialData = NULL, ppBuffer = &) = S_OK +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Flush(this = ) +ID3D11Device::CreateQuery(this = , pQueryDesc = &{Query = D3D11_QUERY_EVENT, MiscFlags = 0x0}, ppQuery = &) = S_OK +ID3D11DeviceContext::End(this = , pAsync = ) +ID3D11DeviceContext::GetData(this = , pAsync = , pData = NULL, DataSize = 0, GetDataFlags = 0x0) = S_OK +ID3D11Query::Release(this = ) = 0 +ID3D11Buffer::Release(this = ) = 0 + +ID3D11Device::CreateBuffer(this = , pDesc = &{ByteWidth = 4096, Usage = D3D11_USAGE_STAGING, BindFlags = 0, CPUAccessFlags = D3D11_CPU_ACCESS_WRITE, MiscFlags = 0x0, StructureByteStride = 0}, pInitialData = NULL, ppBuffer = &) = S_OK +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK +memcpy(dest = , src = blob(4096), n = 4096) +ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) +ID3D11DeviceContext::Flush(this = ) +ID3D11Device::CreateQuery(this = , pQueryDesc = &{Query = D3D11_QUERY_EVENT, MiscFlags = 0x0}, ppQuery = &) = S_OK +ID3D11DeviceContext::End(this = , pAsync = ) +ID3D11DeviceContext::GetData(this = , pAsync = , pData = NULL, DataSize = 0, GetDataFlags = 0x0) = S_OK +ID3D11Query::Release(this = ) = 0 +ID3D11Buffer::Release(this = ) = 0 + +ID3D11DeviceContext::Release(this = ) = 0 +ID3D11Device::Release(this = ) = 0 diff --git a/apps/d3d11/map_no_overwrite.ref.txt b/apps/d3d11/map_no_overwrite.ref.txt deleted file mode 100644 index cc52aab..0000000 --- a/apps/d3d11/map_no_overwrite.ref.txt +++ /dev/null @@ -1,29 +0,0 @@ -D3D11CreateDevice(pAdapter = NULL, DriverType = D3D_DRIVER_TYPE_HARDWARE, Software = NULL, Flags = <>, pFeatureLevels = {D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_10_0}, FeatureLevels = 3, SDKVersion = 7, ppDevice = &, pFeatureLevel = NULL, ppImmediateContext = &) = S_OK -ID3D11Device::CreateBuffer(this = , pDesc = &{ByteWidth = 4096, Usage = D3D11_USAGE_DYNAMIC, BindFlags = D3D11_BIND_VERTEX_BUFFER, CPUAccessFlags = D3D11_CPU_ACCESS_WRITE, MiscFlags = 0x0, StructureByteStride = 0}, pInitialData = NULL, ppBuffer = &) = S_OK -ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_DISCARD, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK -memcpy(dest = , src = blob(4096), n = 4096) -ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) -ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK -memcpy(dest = , src = blob(4096), n = 4096) -ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) -ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK -memcpy(dest = , src = blob(4096), n = 4096) -ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) -ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK -memcpy(dest = , src = blob(4096), n = 4096) -ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) -ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK -memcpy(dest = , src = blob(4096), n = 4096) -ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) -ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK -memcpy(dest = , src = blob(4096), n = 4096) -ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) -ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK -memcpy(dest = , src = blob(4096), n = 4096) -ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) -ID3D11DeviceContext::Map(this = , pResource = , Subresource = 0, MapType = D3D11_MAP_WRITE_NO_OVERWRITE, MapFlags = 0x0, pMappedResource = &{pData = , RowPitch = 4096, DepthPitch = 4096}) = S_OK -memcpy(dest = , src = blob(4096), n = 4096) -ID3D11DeviceContext::Unmap(this = , pResource = , Subresource = 0) -ID3D11Buffer::Release(this = ) = 0 -ID3D11DeviceContext::Release(this = ) = 0 -ID3D11Device::Release(this = ) = 0 diff --git a/apps/d3d11/tri.ref.txt b/apps/d3d11/tri.ref.txt index 7d969b9..b290538 100644 --- a/apps/d3d11/tri.ref.txt +++ b/apps/d3d11/tri.ref.txt @@ -1,3 +1,4 @@ +//!tri D3D11CreateDeviceAndSwapChain(pAdapter = NULL, DriverType = D3D_DRIVER_TYPE_HARDWARE, Software = NULL, Flags = <>, pFeatureLevels = {D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_10_0}, FeatureLevels = 3, SDKVersion = 7, pSwapChainDesc = &{BufferDesc = {Width = 250, Height = 250, RefreshRate = {Numerator = 60, Denominator = 1}, Format = DXGI_FORMAT_R8G8B8A8_UNORM, ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED, Scaling = DXGI_MODE_SCALING_UNSPECIFIED}, SampleDesc = {Count = 1, Quality = 0}, BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT, BufferCount = 2, OutputWindow = , Windowed = TRUE, SwapEffect = DXGI_SWAP_EFFECT_DISCARD, Flags = 0x0}, ppSwapChain = &, ppDevice = &, pFeatureLevel = NULL, ppImmediateContext = &) = S_OK IDXGISwapChain::GetBuffer(this = , Buffer = 0, riid = {Data1 = 1863690994, Data2 = 53768, Data3 = 20105, Data4 = {154, 180, 72, 149, 53, 211, 79, 156}}, ppSurface = &) = S_OK ID3D11Device::CreateRenderTargetView(this = , pResource = , pDesc = &{Format = DXGI_FORMAT_R8G8B8A8_UNORM, ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D, Texture2D = {MipSlice = 0}}, ppRTView = &) = S_OK diff --git a/apps/d3d11_1/tri.cpp b/apps/d3d11_1/tri.cpp index f3d19df..9f61425 100644 --- a/apps/d3d11_1/tri.cpp +++ b/apps/d3d11_1/tri.cpp @@ -24,6 +24,7 @@ **************************************************************************/ +#include #include #include @@ -38,6 +39,30 @@ #include "tri_ps_4_0.h" +static void +_dumpObjInfo(const char *szExpr, void *pvObj) { + void * lpVtbl = *(void **)pvObj; + + fprintf(stderr, "%s, pvObj = %p, lpVtbl = %p", + szExpr, pvObj, lpVtbl); + + HMODULE hModule = 0; + BOOL bRet = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, + (LPCTSTR)lpVtbl, + &hModule); + if (bRet) { + char szModule[256]; + DWORD dwRet = GetModuleFileNameA(hModule, szModule, sizeof szModule); + assert(dwRet); + fprintf(stderr, " (%s!+0x%0lx)", + szModule, (DWORD)((UINT_PTR)lpVtbl - (UINT_PTR)hModule)); + } + fprintf(stderr, "\n"); +} + +#define dumpObjInfo(_p) _dumpObjInfo(#_p, _p) + + static IDXGISwapChain* g_pSwapChain = NULL; static ID3D11Device * g_pDevice = NULL; static ID3D11DeviceContext * g_pDeviceContext = NULL; @@ -95,7 +120,7 @@ main(int argc, char *argv[]) UINT Flags = 0; if (LoadLibraryA("d3d11sdklayers")) { - Flags |= D3D11_CREATE_DEVICE_DEBUG; + //Flags |= D3D11_CREATE_DEVICE_DEBUG; } DXGI_SWAP_CHAIN_DESC SwapChainDesc; @@ -143,6 +168,10 @@ main(int argc, char *argv[]) return 1; } + dumpObjInfo(g_pDevice); + dumpObjInfo(g_pDevice1); + dumpObjInfo(g_pDeviceContext1); + ID3D11RenderTargetView *pRenderTargetView = NULL; ID3D11Texture2D* pBackBuffer; hr = g_pSwapChain->GetBuffer(0, IID_ID3D11Texture2D, (void **)&pBackBuffer); @@ -297,6 +326,8 @@ main(int argc, char *argv[]) DestroyWindow(hWnd); + getchar(); + return 0; } diff --git a/apps/d3dcommon/com_ptr.hpp b/apps/d3dcommon/com_ptr.hpp index 5506270..83384f7 100644 --- a/apps/d3dcommon/com_ptr.hpp +++ b/apps/d3dcommon/com_ptr.hpp @@ -67,6 +67,21 @@ class com_ptr operator -> () const { return p; } + + T * + operator = (T *q) { + if (p) { + p->Release(); + } + if (q) { + q->AddRef(); + } + return p = q; + } + +private: + com_ptr(const com_ptr &); + com_ptr & operator= (const com_ptr &); }; diff --git a/apps/gl/tri.ref.flush.png b/apps/gl/tri.ref.flush.png deleted file mode 100644 index c89183ba9de557ad6c201fd2652887e8a766b4e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5274 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 T20VZlhag)^M~iy%D{21$BY;GB