mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 09:23:17 +02:00
runtime disabling of sparse textures on less than 4 core systems
This commit is contained in:
parent
9363c4dda6
commit
b5de603921
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