summaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2015-01-06 21:07:17 +0000
committerJosé Fonseca <jfonseca@vmware.com>2015-01-06 21:07:17 +0000
commitf28a5be12a45c94ab99b3407bf352443cfc9c5f8 (patch)
tree84feb4b70461d2fc17d21025e5d4b9aca58a263e /helpers
parentb35b11aa61fe534e99368501b68ad21aa19fb822 (diff)
helpers: Fix matching for OpenGL 3.1 contexts.
It's OK to return 3.2 core when 3.1 is requested.
Diffstat (limited to 'helpers')
-rw-r--r--helpers/glprofile.hpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/helpers/glprofile.hpp b/helpers/glprofile.hpp
index 78fcca96..7e81b756 100644
--- a/helpers/glprofile.hpp
+++ b/helpers/glprofile.hpp
@@ -77,9 +77,21 @@ struct Profile {
inline bool
matches(const Profile expected) const {
+ /*
+ * GLX_ARB_create_context/WGL_ARB_create_context specs state that
+ *
+ * "If version 3.1 is requested, the context returned may implement
+ * any of the following versions:
+ *
+ * * Version 3.1. The GL_ARB_compatibility extension may or may not
+ * be implemented, as determined by the implementation.
+ *
+ * * The core profile of version 3.2 or greater."
+ */
return api == expected.api &&
versionGreaterOrEqual(expected.major, expected.minor) &&
- core == expected.core;
+ (core == expected.core ||
+ (expected.major == 3 && expected.minor == 1));
}
// Comparison operator, mainly for use in std::map