From 592cf968e3d6d46b312460aec8ef8bf9b184070b Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 18 Jun 2020 11:34:52 +0100 Subject: [PATCH] Add a new analytics tracking flag for "has any capture used DXIL" --- qrenderdoc/Code/CaptureContext.cpp | 2 ++ qrenderdoc/Code/Interface/Analytics.cpp | 4 +++- qrenderdoc/Code/Interface/Analytics.h | 1 + renderdoc/api/replay/data_types.h | 1 + renderdoc/driver/d3d12/d3d12_device.cpp | 2 +- renderdoc/replay/renderdoc_serialise.inl | 1 + 6 files changed, 9 insertions(+), 2 deletions(-) diff --git a/qrenderdoc/Code/CaptureContext.cpp b/qrenderdoc/Code/CaptureContext.cpp index f68011e4a..c3e2ee7dc 100644 --- a/qrenderdoc/Code/CaptureContext.cpp +++ b/qrenderdoc/Code/CaptureContext.cpp @@ -727,6 +727,8 @@ void CaptureContext::LoadCapture(const rdcstr &captureFile, const ReplayOptions ANALYTIC_SET(CaptureFeatures.MultiGPU, true); if(m_APIProps.D3D12Bundle) ANALYTIC_SET(CaptureFeatures.D3D12Bundle, true); + if(m_APIProps.DXILShaders) + ANALYTIC_SET(CaptureFeatures.DXILShaders, true); if(m_APIProps.vendor != GPUVendor::Unknown) { diff --git a/qrenderdoc/Code/Interface/Analytics.cpp b/qrenderdoc/Code/Interface/Analytics.cpp index 9a297f74f..6423eced7 100644 --- a/qrenderdoc/Code/Interface/Analytics.cpp +++ b/qrenderdoc/Code/Interface/Analytics.cpp @@ -313,6 +313,7 @@ static struct AnalyticsDocumentation DOCUMENT_ANALYTIC(SparseResources, "Did any capture use sparse aka tiled resources?"); DOCUMENT_ANALYTIC(MultiGPU, "Did any capture make use of multiple GPUs?"); DOCUMENT_ANALYTIC(D3D12Bundle, "Did any D3D12 capture use bundles?"); + DOCUMENT_ANALYTIC(DXILShaders, "Did any D3D12 capture use DXIL shaders?"); } DOCUMENT_ANALYTIC_SECTION(CaptureFeatures, "Capture API Usage"); } docs; @@ -322,7 +323,7 @@ void AnalyticsSerialise(Analytics &serdb, QVariantMap &values, AnalyticsSerialis // only check this on 64-bit as it is different on 32-bit #if QT_POINTER_SIZE == 8 && defined(Q_OS_WIN32) - static_assert(sizeof(Analytics) == 147, "Sizeof Analytics has changed - update serialisation."); + static_assert(sizeof(Analytics) == 148, "Sizeof Analytics has changed - update serialisation."); #endif QString doc; @@ -430,6 +431,7 @@ void AnalyticsSerialise(Analytics &serdb, QVariantMap &values, AnalyticsSerialis ANALYTIC_SERIALISE(CaptureFeatures.SparseResources); ANALYTIC_SERIALISE(CaptureFeatures.MultiGPU); ANALYTIC_SERIALISE(CaptureFeatures.D3D12Bundle); + ANALYTIC_SERIALISE(CaptureFeatures.DXILShaders); } if(type == AnalyticsSerialiseType::Documenting) diff --git a/qrenderdoc/Code/Interface/Analytics.h b/qrenderdoc/Code/Interface/Analytics.h index 2eac2c2b5..ffea1b98e 100644 --- a/qrenderdoc/Code/Interface/Analytics.h +++ b/qrenderdoc/Code/Interface/Analytics.h @@ -241,6 +241,7 @@ struct Analytics bool SparseResources = false; bool MultiGPU = false; bool D3D12Bundle = false; + bool DXILShaders = false; } CaptureFeatures; }; diff --git a/renderdoc/api/replay/data_types.h b/renderdoc/api/replay/data_types.h index 75b4e0a06..6db47409f 100644 --- a/renderdoc/api/replay/data_types.h +++ b/renderdoc/api/replay/data_types.h @@ -1533,6 +1533,7 @@ worked around by re-sorting bindings. bool SparseResources = false; bool MultiGPU = false; bool D3D12Bundle = false; + bool DXILShaders = false; #endif }; diff --git a/renderdoc/driver/d3d12/d3d12_device.cpp b/renderdoc/driver/d3d12/d3d12_device.cpp index 5c0cb79a4..ad9919abc 100644 --- a/renderdoc/driver/d3d12/d3d12_device.cpp +++ b/renderdoc/driver/d3d12/d3d12_device.cpp @@ -3245,7 +3245,7 @@ ReplayStatus WrappedID3D12Device::ReadLogInitialisation(RDCFile *rdc, bool store ReadSerialiser ser(reader, Ownership::Stream); - m_UsedDXIL = m_InitParams.usedDXIL; + APIProps.DXILShaders = m_UsedDXIL = m_InitParams.usedDXIL; ser.SetStringDatabase(&m_StringDB); ser.SetUserData(GetResourceManager()); diff --git a/renderdoc/replay/renderdoc_serialise.inl b/renderdoc/replay/renderdoc_serialise.inl index 3b5e70c25..001a6674d 100644 --- a/renderdoc/replay/renderdoc_serialise.inl +++ b/renderdoc/replay/renderdoc_serialise.inl @@ -504,6 +504,7 @@ void DoSerialise(SerialiserType &ser, APIProperties &el) SERIALISE_MEMBER(SparseResources); SERIALISE_MEMBER(MultiGPU); SERIALISE_MEMBER(D3D12Bundle); + SERIALISE_MEMBER(DXILShaders); SIZE_CHECK(24); }