Friday, April 22, 2011

Pipeline Statistics

This tutorial will demonstrate the use of pipeline statistics query to retrieve the information about graphics-pipeline activity. It can be done so by creating a query of type D3D11_QUERY_PIPELINE_STATISTICS

Code:


D3D11_QUERY_DESC oD3DQueryDesc;
::memset(&oD3DQueryDesc, 0, sizeof(D3D11_QUERY_DESC));


// Pipeline statistics query
oD3DQueryDesc.Query = D3D11_QUERY_PIPELINE_STATISTICS;
CHECK_COM(m_pD3DDevice->CreateQuery(&oD3DQueryDesc, &m_pD3DPipelineStatsQuery));

D3D11_QUERY_DATA_PIPELINE_STATISTICS oD3DQueryDataPipelineStats;
m_pD3DImmDevContext->GetData(m_pD3DPipelineStatsQuery, reinterpret_cast<void *>(&oD3DQueryDataPipelineStats), sizeof(D3D11_QUERY_DATA_PIPELINE_STATISTICS), 0);

Now, 'oD3DQueryDataPipelineStats' should be populated with the pipeline statistics

No comments:

Post a Comment