st/mesa: fix incorrect version checking code
authorBrian Paul <brianp@vmware.com>
Sat, 5 Mar 2011 18:08:57 +0000 (11:08 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 7 Mar 2011 21:58:39 +0000 (14:58 -0700)
src/mesa/state_tracker/st_manager.c

index 5c8853c..d85bcd4 100644 (file)
@@ -684,8 +684,9 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
    if (attribs->major > 1 || attribs->minor > 0) {
       _mesa_compute_version(st->ctx);
 
-      if (st->ctx->VersionMajor < attribs->major ||
-          st->ctx->VersionMajor < attribs->minor) {
+      /* is the actual version less than the requested version? */
+      if (st->ctx->VersionMajor * 10 + st->ctx->VersionMinor <
+          attribs->major * 10 + attribs->minor) {
          st_destroy_context(st);
          return NULL;
       }