mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:35:08 +02:00
Merge pull request #8668 from ZappoMan/hacktest
automatic (runtime) disabling of sparse textures systems with 4 or less cores
This commit is contained in:
commit
ff73fa322e
1 changed files with 16 additions and 1 deletions
|
@ -16,6 +16,7 @@
|
|||
#include <unordered_map>
|
||||
#include <glm/gtx/component_wise.hpp>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QThread>
|
||||
#include <QtCore/QProcessEnvironment>
|
||||
|
||||
|
@ -26,8 +27,22 @@ using namespace gpu::gl;
|
|||
using namespace gpu::gl45;
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#define MIN_CORES_FOR_SPARSE_TEXTURES 5
|
||||
static const QString DEBUG_FLAG("HIFI_DISABLE_SPARSE_TEXTURES");
|
||||
static bool enableSparseTextures = !QProcessEnvironment::systemEnvironment().contains(DEBUG_FLAG);
|
||||
static bool enableSparseTextures = !QProcessEnvironment::systemEnvironment().contains(DEBUG_FLAG) &&
|
||||
QThread::idealThreadCount() >= MIN_CORES_FOR_SPARSE_TEXTURES;
|
||||
|
||||
class SparseTextureDebug {
|
||||
public:
|
||||
SparseTextureDebug() {
|
||||
qDebug() << "[SPARSE TEXTURE SUPPORT]"
|
||||
<< "HIFI_DISABLE_SPARSE_TEXTURES:" << QProcessEnvironment::systemEnvironment().contains(DEBUG_FLAG)
|
||||
<< "idealThreadCount:" << QThread::idealThreadCount()
|
||||
<< "enableSparseTextures:" << enableSparseTextures;
|
||||
}
|
||||
};
|
||||
SparseTextureDebug sparseTextureDebugInfo;
|
||||
|
||||
#else
|
||||
static bool enableSparseTextures = false;
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue