Add a performance counter selection dialog.

This commit is contained in:
Matthäus G. Chajdas authored and baldurk committed 2017-08-24 13:21:01 +01:00
1 parent 40a0272a3e
commit 29376f34cc
13 files changed
+436 -6

No files matched your search

+3
View File
@@ -891,6 +891,9 @@ struct CounterDescription
DOCUMENT("A short human-readable name for the counter.");
rdctype::str name;
DOCUMENT("The counter category. Can be empty for uncategorized counters.");
rdctype::str category;
DOCUMENT("If available, a longer human-readable description of the value this counter measures.");
rdctype::str description;
+2 -1
View File
@@ -1593,8 +1593,9 @@ void Serialiser::Serialise(const char *name, CounterDescription &el)
Serialise("", el.resultType);
Serialise("", el.resultByteWidth);
Serialise("", el.unit);
Serialise("", el.category);
SIZE_CHECK(56);
SIZE_CHECK(72);
}
template <>
@@ -90,6 +90,8 @@ void D3D11DebugManager::DescribeCounter(GPUCounter counterID, CounterDescription
}
}
desc.category = "D3D11";
switch(counterID)
{
case GPUCounter::EventGPUDuration:
+30 -2
View File
@@ -219,7 +219,7 @@ vector<AMDCounters::InternalCounterDescription> AMDCounters::EnumerateCounters()
internalDesc.desc = InternalGetCounterDescription(i);
// We ignore any D3D11 counters, as those are handled elsewhere
if(strncmp(internalDesc.desc.description.c_str(), "#D3D11#", 7) == 0)
if(strncmp(internalDesc.desc.category.c_str(), "D3D11", 5) == 0)
{
continue;
}
@@ -249,7 +249,35 @@ CounterDescription AMDCounters::InternalGetCounterDescription(uint32_t internalI
m_pGPUPerfAPI->getCounterName(internalIndex, &tmp);
desc.name = tmp;
m_pGPUPerfAPI->getCounterDescription(internalIndex, &tmp);
desc.description = tmp;
std::vector<char> descCopy;
int separator = -1;
int sharpFound = 0;
const char *c = tmp;
while(*c)
{
if(*c == '#')
{
++sharpFound;
descCopy.push_back('\0');
if(sharpFound == 2)
{
separator = (int32_t)(c - tmp);
}
}
else
{
descCopy.push_back(*c);
}
++c;
}
descCopy.push_back('\0');
desc.category = descCopy.data() + 1;
desc.description = descCopy.data() + separator + 1;
GPA_Usage_Type usageType;