Trying to extend the memory counter

This commit is contained in:
samcake 2016-10-31 16:40:15 -07:00
parent 91d878666c
commit a23bbd1e4e
2 changed files with 6 additions and 3 deletions

View file

@ -10,6 +10,7 @@
#include <QtCore/QtGlobal>
#ifdef Q_OS_WIN
#include <atlbase.h>
#include <Wbemidl.h>
@ -139,7 +140,7 @@ GPUIdent* GPUIdent::ensureQuery(const QString& vendor, const QString& renderer)
var.ChangeType(CIM_UINT64); // We're going to receive some integral type, but it might not be uint.
// We might be hosed here. The parameter is documented to be UINT32, but that's only 4 GB!
const ULONGLONG BYTES_PER_MEGABYTE = 1024 * 1024;
_dedicatedMemoryMB = (uint) (var.ullVal / BYTES_PER_MEGABYTE);
_dedicatedMemoryMB = (uint64_t) (var.ullVal / BYTES_PER_MEGABYTE);
}
else {
qCDebug(shared) << "Unable to get video AdapterRAM";

View file

@ -14,17 +14,19 @@
#ifndef hifi_GPUIdent_h
#define hifi_GPUIdent_h
#include <cstdint>
class GPUIdent
{
public:
unsigned int getMemory() { return _dedicatedMemoryMB; }
uint64_t getMemory() { return _dedicatedMemoryMB; }
QString getName() { return _name; }
QString getDriver() { return _driver; }
bool isValid() { return _isValid; }
// E.g., GPUIdent::getInstance()->getMemory();
static GPUIdent* getInstance(const QString& vendor = "", const QString& renderer = "") { return _instance.ensureQuery(vendor, renderer); }
private:
uint _dedicatedMemoryMB { 0 };
uint64_t _dedicatedMemoryMB { 0 };
QString _name { "" };
QString _driver { "" };
bool _isQueried { false };