On 10/13/2015 09:35 AM, Boyan Ding wrote:
2015-10-13 13:49 GMT+08:00 Tapani Pälli <tapani.pa...@intel.com>:
Otherwise there are problems when user overrides version and application
such as Piglit wants to detect used api with glGetString(GL_VERSION).

Below is example when using MESA_GLES_VERSION_OVERRIDE=3.1.

Before:
         "3.1 Mesa 11.1.0-devel (git-24a1a15)"

After:
         "OpenGL ES 3.1 Mesa 11.1.0-devel (git-78042ff)"

Signed-off-by: Tapani Pälli <tapani.pa...@intel.com>
---
  src/mesa/main/version.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
index 498b2f8..a1b1db5 100644
--- a/src/mesa/main/version.c
+++ b/src/mesa/main/version.c
@@ -24,6 +24,7 @@


  #include <stdio.h>
+#include "context.h"
  #include "imports.h"
  #include "mtypes.h"
  #include "version.h"
@@ -181,7 +182,7 @@ _mesa_override_gl_version(struct gl_context *ctx)
  {
     if (_mesa_override_gl_version_contextless(&ctx->Const, &ctx->API,
                                               &ctx->Version)) {
-      create_version_string(ctx, "");
+      create_version_string(ctx, _mesa_is_gles(ctx) ? "OpenGL ES " : "OpenGL 
");


Things are a little bit funny here, because the version strings of
OpenGL and ES are different.

 From OpenGL 4.5 (Core Profile) spec, Page 541:

"""
The VERSION and SHADING_LANGUAGE_VERSION strings are laid out as
follows:
     <version number><space><vendor-specific information>
"""

 From OpenGL ES 3.2 spec, Page 436:

"""
The VERSION string is laid out as follows:
     "OpenGL ES N.M vendor-specific information"
"""

So I don't think the "OpenGL" prefix is necessary on desktop GL.

ok, I was not a aware of such inconsistency. I guess it should be ok then to change "OpenGL " as "" in the patch.

Thanks for pointing this out!

Regards,
Boyan Ding

     }
  }

--
2.4.3

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to