Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-09-07 20:53:48 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-07 21:17:45 +0300
commit58353834f441b8b4ca91dcd4ec94ac49bbbf5ab0 (patch)
tree86d507e7ea388fde34cdc4ae7d874cc1c6f99d46 /source/blender/gpu/intern/gpu_capabilities.cc
parentc5c6b5ddb31c8a79667d6dcd689808efd3dadd8a (diff)
GPUCapabilities: Isolate GL memory statistics
This is part of the Vulkan task T68990 This is a simple cleanup.
Diffstat (limited to 'source/blender/gpu/intern/gpu_capabilities.cc')
-rw-r--r--source/blender/gpu/intern/gpu_capabilities.cc30
1 files changed, 4 insertions, 26 deletions
diff --git a/source/blender/gpu/intern/gpu_capabilities.cc b/source/blender/gpu/intern/gpu_capabilities.cc
index 71bf479b4a8..0ee25ea2569 100644
--- a/source/blender/gpu/intern/gpu_capabilities.cc
+++ b/source/blender/gpu/intern/gpu_capabilities.cc
@@ -28,9 +28,9 @@
#include "GPU_capabilities.h"
-#include "gpu_capabilities_private.hh"
+#include "gpu_context_private.hh"
-#include "gl_backend.hh" /* TODO remove */
+#include "gpu_capabilities_private.hh"
namespace blender::gpu {
@@ -110,34 +110,12 @@ bool GPU_crappy_amd_driver(void)
bool GPU_mem_stats_supported(void)
{
-#ifndef GPU_STANDALONE
- return (GLEW_NVX_gpu_memory_info || GLEW_ATI_meminfo);
-#else
- return false;
-#endif
+ return GCaps.mem_stats_support;
}
void GPU_mem_stats_get(int *totalmem, int *freemem)
{
- /* TODO(merwin): use Apple's platform API to get this info */
-
- if (GLEW_NVX_gpu_memory_info) {
- /* returned value in Kb */
- glGetIntegerv(GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX, totalmem);
-
- glGetIntegerv(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, freemem);
- }
- else if (GLEW_ATI_meminfo) {
- int stats[4];
-
- glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, stats);
- *freemem = stats[0];
- *totalmem = 0;
- }
- else {
- *totalmem = 0;
- *freemem = 0;
- }
+ GPU_context_active_get()->memory_statistics_get(totalmem, freemem);
}
/* Return support for the active context + window. */