[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/kwin/lib
From: Fredrik Höglund <fredrik () kde ! org>
Date: 2010-11-18 21:47:29
Message-ID: 20101118214729.65F33AC8A0 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1198553 by fredrik:
Add detection of limited texture NPOT support.
M +20 -1 kwinglplatform.cpp
M +19 -0 kwinglplatform.h
--- trunk/KDE/kdebase/workspace/kwin/lib/kwinglplatform.cpp #1198552:1198553
@@ -364,6 +364,8 @@
m_extensions.contains("GL_ARB_vertex_shader") &&
m_glslVersion >= kVersionNumber(1, 0);
+ m_textureNPOT = m_extensions.contains("GL_ARB_texture_non_power_of_two");
+
m_chipset = "Unknown";
@@ -493,8 +495,18 @@
if (m_chipClass < R300)
m_supportsGLSL = false;
- m_limitedGLSL = m_supportsGLSL && m_chipClass < R600;
+ m_limitedGLSL = false;
+ m_limitedNPOT = false;
+ if (m_chipClass < R600) {
+ if (driver() == Driver_Catalyst)
+ m_textureNPOT = m_limitedNPOT = false; // Software fallback
+ else if (driver() == Driver_R300G)
+ m_limitedNPOT = m_textureNPOT;
+
+ m_limitedGLSL = m_supportsGLSL;
+ }
+
if (driver() == Driver_R600G ||
(driver() == Driver_R600C && m_renderer.contains("DRI2")))
{
@@ -509,6 +521,7 @@
if (m_driver == Driver_NVidia)
m_looseBinding = true;
+ m_limitedNPOT = m_textureNPOT && m_chipClass < NV40;
m_limitedGLSL = m_supportsGLSL && m_chipClass < G80;
}
@@ -532,6 +545,12 @@
case LimitedGLSL:
return m_limitedGLSL;
+ case TextureNPOT:
+ return m_textureNPOT;
+
+ case LimitedNPOT:
+ return m_limitedNPOT;
+
default:
return false;
}
--- trunk/KDE/kdebase/workspace/kwin/lib/kwinglplatform.h #1198552:1198553
@@ -65,6 +65,23 @@
* - Max 4 texture indirections
*/
LimitedGLSL,
+
+ /**
+ * Set when the driver supports GL_ARB_texture_non_power_of_two.
+ */
+ TextureNPOT,
+
+ /**
+ * If set, the driver supports GL_ARB_texture_non_power_of_two with the
+ * GL_ARB_texture_rectangle limitations.
+ *
+ * This means no support for mipmap filters, and that only the following
+ * wrap modes are supported:
+ * - GL_CLAMP
+ * - GL_CLAMP_TO_EDGE
+ * - GL_CLAMP_TO_BORDER
+ */
+ LimitedNPOT
};
enum Driver {
@@ -234,6 +251,8 @@
bool m_directRendering:1;
bool m_supportsGLSL:1;
bool m_limitedGLSL:1;
+ bool m_textureNPOT:1;
+ bool m_limitedNPOT:1;
static GLPlatform *s_platform;
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic