diff --git a/libraries/gl/src/gl/Config.cpp b/libraries/gl/src/gl/Config.cpp index ab1dfac97c..2d6e3db8d2 100644 --- a/libraries/gl/src/gl/Config.cpp +++ b/libraries/gl/src/gl/Config.cpp @@ -96,7 +96,7 @@ void gl::initModuleGl() { wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)getGlProcessAddress("wglCreateContextAttribsARB"); #endif -#if defined(Q_OS_LINUX) +#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) QueryCurrentRendererIntegerMESA = (PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC)getGlProcessAddress("glXQueryCurrentRendererIntegerMESA"); #endif @@ -134,7 +134,7 @@ void gl::setSwapInterval(int interval) { } bool gl::queryCurrentRendererIntegerMESA(int attr, unsigned int *value) { - #if defined(Q_OS_LINUX) + #if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) if (QueryCurrentRendererIntegerMESA) { return QueryCurrentRendererIntegerMESA(attr, value); } diff --git a/libraries/gpu-gl-common/src/gpu/gl/GLBackend.cpp b/libraries/gpu-gl-common/src/gpu/gl/GLBackend.cpp index 602ab1c320..ef247b0835 100644 --- a/libraries/gpu-gl-common/src/gpu/gl/GLBackend.cpp +++ b/libraries/gpu-gl-common/src/gpu/gl/GLBackend.cpp @@ -153,9 +153,11 @@ void GLBackend::init() { if (vendor.contains("NVIDIA") ) { qCDebug(gpugllogging) << "NVIDIA card detected"; +#if !defined(Q_OS_ANDROID) GL_GET_INTEGER(GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX); GL_GET_INTEGER(GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX); GL_GET_INTEGER(GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX); +#endif qCDebug(gpugllogging) << "GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX: " << GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX; qCDebug(gpugllogging) << "GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX: " << GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX; @@ -168,7 +170,9 @@ void GLBackend::init() { } else if (vendor.contains("ATI")) { qCDebug(gpugllogging) << "ATI card detected"; +#if !defined(Q_OS_ANDROID) GL_GET_INTEGER(TEXTURE_FREE_MEMORY_ATI); +#endif _totalMemory = TEXTURE_FREE_MEMORY_ATI * BYTES_PER_KIB; _dedicatedMemory = _totalMemory; @@ -219,10 +223,14 @@ size_t GLBackend::getAvailableMemory() { switch( _videoCard ) { case NVIDIA: +#if !defined(Q_OS_ANDROID) glGetIntegerv(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, &mem); +#endif return mem * BYTES_PER_KIB; case ATI: +#if !defined(Q_OS_ANDROID) glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, &mem); +#endif return mem * BYTES_PER_KIB; case MESA: return 0; // Don't know the current value