mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 13:53:38 +02:00
Trying to extend the memory counter
This commit is contained in:
parent
91d878666c
commit
a23bbd1e4e
2 changed files with 6 additions and 3 deletions
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
#include <QtCore/QtGlobal>
|
#include <QtCore/QtGlobal>
|
||||||
|
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
#include <atlbase.h>
|
#include <atlbase.h>
|
||||||
#include <Wbemidl.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.
|
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!
|
// 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;
|
const ULONGLONG BYTES_PER_MEGABYTE = 1024 * 1024;
|
||||||
_dedicatedMemoryMB = (uint) (var.ullVal / BYTES_PER_MEGABYTE);
|
_dedicatedMemoryMB = (uint64_t) (var.ullVal / BYTES_PER_MEGABYTE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qCDebug(shared) << "Unable to get video AdapterRAM";
|
qCDebug(shared) << "Unable to get video AdapterRAM";
|
||||||
|
|
|
@ -14,17 +14,19 @@
|
||||||
#ifndef hifi_GPUIdent_h
|
#ifndef hifi_GPUIdent_h
|
||||||
#define hifi_GPUIdent_h
|
#define hifi_GPUIdent_h
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
class GPUIdent
|
class GPUIdent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
unsigned int getMemory() { return _dedicatedMemoryMB; }
|
uint64_t getMemory() { return _dedicatedMemoryMB; }
|
||||||
QString getName() { return _name; }
|
QString getName() { return _name; }
|
||||||
QString getDriver() { return _driver; }
|
QString getDriver() { return _driver; }
|
||||||
bool isValid() { return _isValid; }
|
bool isValid() { return _isValid; }
|
||||||
// E.g., GPUIdent::getInstance()->getMemory();
|
// E.g., GPUIdent::getInstance()->getMemory();
|
||||||
static GPUIdent* getInstance(const QString& vendor = "", const QString& renderer = "") { return _instance.ensureQuery(vendor, renderer); }
|
static GPUIdent* getInstance(const QString& vendor = "", const QString& renderer = "") { return _instance.ensureQuery(vendor, renderer); }
|
||||||
private:
|
private:
|
||||||
uint _dedicatedMemoryMB { 0 };
|
uint64_t _dedicatedMemoryMB { 0 };
|
||||||
QString _name { "" };
|
QString _name { "" };
|
||||||
QString _driver { "" };
|
QString _driver { "" };
|
||||||
bool _isQueried { false };
|
bool _isQueried { false };
|
||||||
|
|
Loading…
Reference in a new issue