mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 10:43:21 +02:00
testing gpu ident changes
This commit is contained in:
parent
19a7d91aef
commit
47a612b195
2 changed files with 22 additions and 2 deletions
|
@ -15,7 +15,7 @@ using namespace platform;
|
||||||
static void getLCpuId( uint32_t* p, uint32_t ax )
|
static void getLCpuId( uint32_t* p, uint32_t ax )
|
||||||
{
|
{
|
||||||
|
|
||||||
#if Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
__asm __volatile
|
__asm __volatile
|
||||||
( "movl %%ebx, %%esi\n\t"
|
( "movl %%ebx, %%esi\n\t"
|
||||||
"cpuid\n\t"
|
"cpuid\n\t"
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
#include <QtCore/QtGlobal>
|
#include <QtCore/QtGlobal>
|
||||||
|
|
||||||
#include "SharedLogging.h"
|
#include "SharedLogging.h"
|
||||||
|
@ -83,7 +84,26 @@ GPUIdent* GPUIdent::ensureQuery(const QString& vendor, const QString& renderer)
|
||||||
|
|
||||||
_dedicatedMemoryMB = bestVRAM;
|
_dedicatedMemoryMB = bestVRAM;
|
||||||
CGLDestroyRendererInfo(rendererInfo);
|
CGLDestroyRendererInfo(rendererInfo);
|
||||||
|
#elif defined(Q_OS_LINUX)
|
||||||
|
//get gpu name
|
||||||
|
FILE* stream = popen("system_profiler SPDisplaysDataType | grep Chipset", "r");
|
||||||
|
|
||||||
|
std::ostringstream hostStream;
|
||||||
|
while (!feof(stream) && !ferror(stream)) {
|
||||||
|
char buf[128];
|
||||||
|
int bytesRead = fread(buf, 1, 128, stream);
|
||||||
|
hostStream.write(buf, bytesRead);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString result = QString::fromStdString(hostStream.str());
|
||||||
|
QStringList parts = result.split('\n');
|
||||||
|
std::string name;
|
||||||
|
|
||||||
|
for (int i = 0; i < parts.size(); ++i) {
|
||||||
|
if (parts[i].toLower().contains("radeon") || parts[i].toLower().contains("nvidia")) {
|
||||||
|
_name=parts[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
#elif defined(Q_OS_WIN)
|
#elif defined(Q_OS_WIN)
|
||||||
|
|
||||||
struct ConvertLargeIntegerToQString {
|
struct ConvertLargeIntegerToQString {
|
||||||
|
|
Loading…
Reference in a new issue