[virglrenderer-devel] [PATCH 3/8] vrend: Get the glsl version return by OpenGL ES

Jakob Bornecrantz jakob.bornecrantz at collabora.com
Tue Feb 13 14:27:25 UTC 2018


From: Elie Tournier <tournier.elie at gmail.com>

Signed-off-by: Elie Tournier <elie.tournier at collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob.bornecrantz at collabora.com>
---
 src/vrend_renderer.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index eea7422..abb8779 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -6265,9 +6265,16 @@ static void vrender_get_glsl_version(int *glsl_version)
    int version;
 
    version_str = glGetString(GL_SHADING_LANGUAGE_VERSION);
-   c = sscanf((const char *)version_str, "%i.%i",
-              &major_local, &minor_local);
-   assert(c == 2);
+   if (vrend_state.use_gles) {
+      char tmp[20];
+      c = sscanf((const char *)version_str, "%s %s %s %s %i.%i",
+                  tmp, tmp, tmp, tmp, &major_local, &minor_local);
+      assert(c == 6);
+   } else {
+      c = sscanf((const char *)version_str, "%i.%i",
+                  &major_local, &minor_local);
+      assert(c == 2);
+   }
 
    version = (major_local * 100) + minor_local;
    if (glsl_version)
-- 
2.14.1



More information about the virglrenderer-devel mailing list