aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/version.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-09-18 08:21:05 +0200
committermarha <marha@users.sourceforge.net>2012-09-18 08:21:05 +0200
commitd7ddd6ead83965a10d450a580a9b6042c7b86f38 (patch)
tree9ca8c23b6aa54418990c4d851e8da97c577636a7 /mesalib/src/mesa/main/version.c
parentc72f683c50e774b21967f0121245a286539fa555 (diff)
parent52213f2cd11c6cc7210cea6896ed464fddfe3fec (diff)
downloadvcxsrv-d7ddd6ead83965a10d450a580a9b6042c7b86f38.tar.gz
vcxsrv-d7ddd6ead83965a10d450a580a9b6042c7b86f38.tar.bz2
vcxsrv-d7ddd6ead83965a10d450a580a9b6042c7b86f38.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/main/version.c')
-rw-r--r--mesalib/src/mesa/main/version.c58
1 files changed, 24 insertions, 34 deletions
diff --git a/mesalib/src/mesa/main/version.c b/mesalib/src/mesa/main/version.c
index 7b67765a2..7ee662714 100644
--- a/mesalib/src/mesa/main/version.c
+++ b/mesalib/src/mesa/main/version.c
@@ -55,6 +55,27 @@ override_version(struct gl_context *ctx)
}
/**
+ * Builds the MESA version string.
+ */
+static void
+create_version_string(struct gl_context *ctx, const char *prefix)
+{
+ static const int max = 100;
+
+ ctx->VersionString = malloc(max);
+ if (ctx->VersionString) {
+ _mesa_snprintf(ctx->VersionString, max,
+ "%s%u.%u Mesa " MESA_VERSION_STRING
+#ifdef MESA_GIT_SHA1
+ " (" MESA_GIT_SHA1 ")"
+#endif
+ ,
+ prefix,
+ ctx->Version / 10, ctx->Version % 10);
+ }
+}
+
+/**
* Override the context's GLSL version if the environment variable
* MESA_GLSL_VERSION_OVERRIDE is set. Valid values for
* MESA_GLSL_VERSION_OVERRIDE are integers, such as "130".
@@ -85,7 +106,6 @@ static void
compute_version(struct gl_context *ctx)
{
GLuint major, minor;
- static const int max = 100;
const GLboolean ver_1_3 = (ctx->Extensions.ARB_texture_border_clamp &&
ctx->Extensions.ARB_texture_cube_map &&
@@ -224,23 +244,12 @@ compute_version(struct gl_context *ctx)
override_version(ctx);
- ctx->VersionString = malloc(max);
- if (ctx->VersionString) {
- _mesa_snprintf(ctx->VersionString, max,
- "%u.%u Mesa " MESA_VERSION_STRING
-#ifdef MESA_GIT_SHA1
- " (" MESA_GIT_SHA1 ")"
-#endif
- ,
- ctx->Version / 10, ctx->Version % 10);
- }
+ create_version_string(ctx, "");
}
static void
compute_version_es1(struct gl_context *ctx)
{
- static const int max = 100;
-
/* OpenGL ES 1.0 is derived from OpenGL 1.3 */
const GLboolean ver_1_0 = (ctx->Extensions.ARB_texture_env_combine &&
ctx->Extensions.ARB_texture_env_dot3);
@@ -256,23 +265,12 @@ compute_version_es1(struct gl_context *ctx)
_mesa_problem(ctx, "Incomplete OpenGL ES 1.0 support.");
}
- ctx->VersionString = malloc(max);
- if (ctx->VersionString) {
- _mesa_snprintf(ctx->VersionString, max,
- "OpenGL ES-CM 1.%d Mesa " MESA_VERSION_STRING
-#ifdef MESA_GIT_SHA1
- " (" MESA_GIT_SHA1 ")"
-#endif
- ,
- ctx->Version % 10);
- }
+ create_version_string(ctx, "OpenGL ES-CM ");
}
static void
compute_version_es2(struct gl_context *ctx)
{
- static const int max = 100;
-
/* OpenGL ES 2.0 is derived from OpenGL 2.0 */
const GLboolean ver_2_0 = (ctx->Extensions.ARB_texture_cube_map &&
ctx->Extensions.EXT_blend_color &&
@@ -289,15 +287,7 @@ compute_version_es2(struct gl_context *ctx)
_mesa_problem(ctx, "Incomplete OpenGL ES 2.0 support.");
}
- ctx->VersionString = malloc(max);
- if (ctx->VersionString) {
- _mesa_snprintf(ctx->VersionString, max,
- "OpenGL ES 2.0 Mesa " MESA_VERSION_STRING
-#ifdef MESA_GIT_SHA1
- " (" MESA_GIT_SHA1 ")"
-#endif
- );
- }
+ create_version_string(ctx, "OpenGL ES ");
}
/**