From 1086585559fe5017ee9664f8e26619bbf860c49b Mon Sep 17 00:00:00 2001 From: samcake Date: Thu, 3 Nov 2016 15:15:05 -0700 Subject: [PATCH] fixing the test to actually capture ati correctly and add the report to the ui --- interface/src/ui/Stats.cpp | 2 +- libraries/gpu-gl/src/gpu/gl/GLBackend.h | 4 ++-- libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp | 2 +- libraries/gpu/src/gpu/Context.h | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/interface/src/ui/Stats.cpp b/interface/src/ui/Stats.cpp index 11660a332d..05632cb1e6 100644 --- a/interface/src/ui/Stats.cpp +++ b/interface/src/ui/Stats.cpp @@ -302,7 +302,7 @@ void Stats::updateStats(bool force) { STAT_UPDATE(gpuTextureVirtualMemory, (int)BYTES_TO_MB(gpu::Texture::getTextureGPUVirtualMemoryUsage())); STAT_UPDATE(gpuTextureFramebufferMemory, (int)BYTES_TO_MB(gpu::Texture::getTextureGPUFramebufferMemoryUsage())); STAT_UPDATE(gpuTextureSparseMemory, (int)BYTES_TO_MB(gpu::Texture::getTextureGPUSparseMemoryUsage())); - STAT_UPDATE(gpuSparseTextureEnabled, gpu::Texture::getEnableSparseTextures() ? 1 : 0); + STAT_UPDATE(gpuSparseTextureEnabled, qApp->getGPUContext()->getBackend()->isTextureManagementSparseEnabled() ? 1 : 0); STAT_UPDATE(gpuFreeMemory, (int)BYTES_TO_MB(gpu::Context::getFreeGPUMemory())); STAT_UPDATE(rectifiedTextureCount, (int)RECTIFIED_TEXTURE_COUNT.load()); STAT_UPDATE(decimatedTextureCount, (int)DECIMATED_TEXTURE_COUNT.load()); diff --git a/libraries/gpu-gl/src/gpu/gl/GLBackend.h b/libraries/gpu-gl/src/gpu/gl/GLBackend.h index fad433d4a2..1be279b375 100644 --- a/libraries/gpu-gl/src/gpu/gl/GLBackend.h +++ b/libraries/gpu-gl/src/gpu/gl/GLBackend.h @@ -176,8 +176,8 @@ public: virtual void releaseQuery(GLuint id) const; virtual void queueLambda(const std::function lambda) const; - bool isTextureManagementSparseEnabled() const { return (_textureManagement._sparseCapable && Texture::getEnableSparseTextures()); } - bool isTextureManagementIncrementalTransferEnabled() const { return (_textureManagement._incrementalTransferCapable && Texture::getEnableIncrementalTextureTransfers()); } + bool isTextureManagementSparseEnabled() const override { return (_textureManagement._sparseCapable && Texture::getEnableSparseTextures()); } + bool isTextureManagementIncrementalTransferEnabled() const override { return (_textureManagement._incrementalTransferCapable && Texture::getEnableIncrementalTextureTransfers()); } protected: diff --git a/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp b/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp index 6e2e7ca62b..ac9a84513e 100644 --- a/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp +++ b/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp @@ -158,7 +158,7 @@ void GL45Backend::initTextureManagementStage() { // But now let s refine the behavior based on vendor std::string vendor { (const char*)glGetString(GL_VENDOR) }; - if ((vendor.compare("AMD") <= 0) || (vendor.compare("INTEL") <= 0)) { + if ((vendor.find("AMD") != std::string::npos) || (vendor.find("ATI") != std::string::npos) || (vendor.find("INTEL") != std::string::npos)) { qCDebug(gpugllogging) << "GPU is sparse capable but force it off, vendor = " << vendor.c_str(); _textureManagement._sparseCapable = false; } else { diff --git a/libraries/gpu/src/gpu/Context.h b/libraries/gpu/src/gpu/Context.h index 56d1930c94..e174e9d728 100644 --- a/libraries/gpu/src/gpu/Context.h +++ b/libraries/gpu/src/gpu/Context.h @@ -85,7 +85,8 @@ public: void getStats(ContextStats& stats) const { stats = _stats; } - + virtual bool isTextureManagementSparseEnabled() const = 0; + virtual bool isTextureManagementIncrementalTransferEnabled() const = 0; // These should only be accessed by Backend implementation to repport the buffer and texture allocations, // they are NOT public calls @@ -215,7 +216,7 @@ public: static Size getTextureGPUFramebufferMemoryUsage(); static Size getTextureGPUSparseMemoryUsage(); static uint32_t getTextureGPUTransferCount(); - + protected: Context(const Context& context);