Bug 934783 - Fix GPU memory reporter for win7 and reenable. r=njn

This commit is contained in:
Hugh Nougher 2014-04-26 21:36:00 -04:00
parent 688711cb03
commit f159281314
2 changed files with 18 additions and 11 deletions

View File

@ -104,7 +104,15 @@ typedef struct _D3DKMTQS_PROCESS_INFO
typedef struct _D3DKMTQS_PROCESS_SEGMENT_INFO
{
ULONGLONG BytesCommitted;
union {
struct {
ULONGLONG BytesCommitted;
} Win8;
struct {
ULONG BytesCommitted;
ULONG UnknownRandomness;
} Win7;
};
ULONGLONG Filler[2];
ULONG Filler2;

View File

@ -239,14 +239,15 @@ public:
queryStatistics.hProcess = ProcessHandle;
queryStatistics.QueryProcessSegment.SegmentId = i;
if (NT_SUCCESS(queryD3DKMTStatistics(&queryStatistics))) {
if (aperture)
sharedBytesUsed += queryStatistics.QueryResult
.ProcessSegmentInfo
.BytesCommitted;
ULONGLONG bytesCommitted;
if (!IsWin8OrLater())
bytesCommitted = queryStatistics.QueryResult.ProcessSegmentInfo.Win7.BytesCommitted;
else
dedicatedBytesUsed += queryStatistics.QueryResult
.ProcessSegmentInfo
.BytesCommitted;
bytesCommitted = queryStatistics.QueryResult.ProcessSegmentInfo.Win8.BytesCommitted;
if (aperture)
sharedBytesUsed += bytesCommitted;
else
dedicatedBytesUsed += bytesCommitted;
}
}
}
@ -312,9 +313,7 @@ gfxWindowsPlatform::gfxWindowsPlatform()
UpdateRenderMode();
// This reporter is disabled because it frequently gives bogus values. See
// bug 917496.
//RegisterStrongMemoryReporter(new GPUAdapterReporter());
RegisterStrongMemoryReporter(new GPUAdapterReporter());
}
gfxWindowsPlatform::~gfxWindowsPlatform()