Performance Counters: gen12 support

Change-Id: I40ccf4958636fc9ffa9778c7abd9e1663c4bb7e4
This commit is contained in:
Piotr Maciejewski
2019-11-13 14:48:44 +01:00
committed by sys_ocldev
parent 13921f698e
commit f2d0606301
9 changed files with 71 additions and 32 deletions

View File

@@ -152,6 +152,7 @@ QueryHandle_1_0 PerformanceCounters::getQueryHandle() {
// PerformanceCounters::getGpuCommandsSize
//////////////////////////////////////////////////////
uint32_t PerformanceCounters::getGpuCommandsSize(
const MetricsLibraryApi::GpuCommandBufferType commandBufferType,
const bool begin) {
CommandBufferData_1_0 bufferData = {};
CommandBufferSize_1_0 bufferSize = {};
@@ -165,8 +166,8 @@ uint32_t PerformanceCounters::getGpuCommandsSize(
}
bufferData.HandleContext = context;
bufferData.Type = GpuCommandBufferType::Render;
bufferData.CommandsType = ObjectType::QueryHwCounters;
bufferData.Type = commandBufferType;
bufferData.QueryHwCounters.Begin = begin;
bufferData.QueryHwCounters.Handle = getQueryHandle();
@@ -181,17 +182,19 @@ uint32_t PerformanceCounters::getGpuCommandsSize(
// PerformanceCounters::getGpuCommands
//////////////////////////////////////////////////////
bool PerformanceCounters::getGpuCommands(
const MetricsLibraryApi::GpuCommandBufferType commandBufferType,
TagNode<HwPerfCounter> &performanceCounters,
const bool begin,
const uint32_t bufferSize,
void *pBuffer) {
// Command Buffer data.
CommandBufferData_1_0 bufferData = {};
bufferData.HandleContext = context;
bufferData.Type = GpuCommandBufferType::Render;
bufferData.CommandsType = ObjectType::QueryHwCounters;
bufferData.Data = pBuffer;
bufferData.Size = bufferSize;
bufferData.Type = commandBufferType;
// Gpu memory allocation for query hw counters.
bufferData.Allocation.CpuAddress = reinterpret_cast<uint8_t *>(performanceCounters.tagForCpuAccess);