[Mesa-dev] [PATCH 3/4] mesa: Only change version in compute_version() if it's better.

Eric Anholt eric at anholt.net
Thu Jul 26 17:27:45 PDT 2012


This should allow a driver to assert support for a version of the API without
supporting parts of component extensions that didn't get rolled into core.
---
 src/mesa/main/version.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
index 697758e..34919e8 100644
--- a/src/mesa/main/version.c
+++ b/src/mesa/main/version.c
@@ -218,8 +218,10 @@ compute_version(struct gl_context *ctx)
       minor = 2;
    }
 
-   ctx->VersionMajor = major;
-   ctx->VersionMinor = minor;
+   if (ctx->Version < major * 10 + minor) {
+      ctx->VersionMajor = major;
+      ctx->VersionMinor = minor;
+   }
 
    override_version(ctx, &ctx->VersionMajor, &ctx->VersionMinor);
 
-- 
1.7.10.4



More information about the mesa-dev mailing list