[waffle] [PATCH] utils/wflinfo: allow requesting a compat profile without a version

Jordan Justen jordan.l.justen at intel.com
Sat Mar 1 21:25:26 PST 2014


From: Jordan Justen <jljusten at gmail.com>

Similar to the behavior of --profile=core, we will now
scan a list of 'known' profile supporting GL versions
when the user requests a compat profile, but does not
specify a version.

Tested on the NVIDIA 310.44 driver. It exposes GL_ARB_compatibility
as expected when --profile=compat is used, and does not when
--profile=core is used.

Signed-off-by: Jordan Justen <jljusten at gmail.com>
---
NOTE: This depends on the similar patch for CORE profiles.

 src/utils/wflinfo.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c
index ee0a50b..c8d490a 100644
--- a/src/utils/wflinfo.c
+++ b/src/utils/wflinfo.c
@@ -695,19 +695,19 @@ wflinfo_create_context(struct options *opts,
 {
     struct waffle_context *ctx;
 
-    if (opts->context_profile == WAFFLE_CONTEXT_CORE_PROFILE &&
+    if (opts->context_profile != WAFFLE_NONE &&
         opts->context_api == WAFFLE_CONTEXT_OPENGL &&
         opts->context_version == -1) {
 
-        // If the user requested OpenGL and a CORE profile, but
-        // they didn't specify a version, then we'll try a set
+        // If the user requested OpenGL and a CORE or COMPAT profile,
+        // but they didn't specify a version, then we'll try a set
         // of known versions from highest to lowest.
 
-        static int known_gl_core_versions[] =
+        static int known_gl_profile_versions[] =
             { 32, 33, 40, 41, 42, 43, 44 };
 
-        for (int i = ARRAY_SIZE(known_gl_core_versions) - 1; i >= 0; i--) {
-            opts->context_version = known_gl_core_versions[i];
+        for (int i = ARRAY_SIZE(known_gl_profile_versions) - 1; i >= 0; i--) {
+            opts->context_version = known_gl_profile_versions[i];
             ctx = wflinfo_try_create_context(opts, config, dpy);
             opts->context_version = -1;
             if (ctx)
-- 
1.9.rc1



More information about the waffle mailing list