Merge pull request #8668 from ZappoMan/hacktest

automatic (runtime) disabling of sparse textures systems with 4 or less cores
This commit is contained in:
Brad Hefta-Gaub 2016-09-28 09:13:33 -07:00 committed by GitHub
commit ff73fa322e

View file

@ -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