Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run the es3 code path on travis / CI. #741

Closed
glennw opened this issue Jan 18, 2017 · 4 comments
Closed

Run the es3 code path on travis / CI. #741

glennw opened this issue Jan 18, 2017 · 4 comments

Comments

@glennw
Copy link
Member

glennw commented Jan 18, 2017

No description provided.

@jrmuizel
Copy link
Collaborator

jrmuizel commented Jan 18, 2017

It looks OSMesa doesn't support ES so this might be a bit more tricky. However, it may not be that hard to add support for this to OSMesa.

@jrmuizel
Copy link
Collaborator

jrmuizel commented Jan 18, 2017

This might be sufficient to make it work:

diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h
index 39cd54e..2acfe57 100644
--- a/include/GL/osmesa.h
+++ b/include/GL/osmesa.h
@@ -101,16 +101,17 @@ extern "C" {
 #define OSMESA_DEPTH_BITS            0x30
 #define OSMESA_STENCIL_BITS          0x31
 #define OSMESA_ACCUM_BITS            0x32
 #define OSMESA_PROFILE               0x33
 #define OSMESA_CORE_PROFILE          0x34
 #define OSMESA_COMPAT_PROFILE        0x35
 #define OSMESA_CONTEXT_MAJOR_VERSION 0x36
 #define OSMESA_CONTEXT_MINOR_VERSION 0x37
+#define OSMESA_ES2_PROFILE           0x38
 
 
 typedef struct osmesa_context *OSMesaContext;
 
 
 /*
  * Create an Off-Screen Mesa rendering context.  The only attribute needed is
  * an RGBA vs Color-Index mode flag.
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index 356ba71..4487bda 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -713,16 +713,18 @@ OSMesaCreateContextAttribs(const int *attribList, OSMesaContext sharelist)
             return NULL;
          break;
       case OSMESA_PROFILE:
          profile = attribList[i+1];
          if (profile == OSMESA_COMPAT_PROFILE)
             api_profile = API_OPENGL_COMPAT;
          else if (profile == OSMESA_CORE_PROFILE)
             api_profile = API_OPENGL_CORE;
+         else if (profile == OSMESA_ES2_PROFILE)
+            api_profile = API_OPENGLES2;
          else
             return NULL;
          break;
       case OSMESA_CONTEXT_MAJOR_VERSION:
          version_major = attribList[i+1];
          if (version_major < 1)
             return NULL;
          break;

@jrmuizel
Copy link
Collaborator

Here's a patch that actually works:

diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h
index 39cd54e..2acfe57 100644
--- a/include/GL/osmesa.h
+++ b/include/GL/osmesa.h
@@ -106,6 +106,7 @@ extern "C" {
 #define OSMESA_COMPAT_PROFILE        0x35
 #define OSMESA_CONTEXT_MAJOR_VERSION 0x36
 #define OSMESA_CONTEXT_MINOR_VERSION 0x37
+#define OSMESA_ES2_PROFILE           0x38
 
 
 typedef struct osmesa_context *OSMesaContext;
diff --git a/src/gallium/state_trackers/osmesa/osmesa.c b/src/gallium/state_trackers/osmesa/osmesa.c
index 18f1b88..7422de8 100644
--- a/src/gallium/state_trackers/osmesa/osmesa.c
+++ b/src/gallium/state_trackers/osmesa/osmesa.c
@@ -621,7 +621,8 @@ OSMesaCreateContextAttribs(const int *attribList, OSMesaContext sharelist)
       case OSMESA_PROFILE:
          profile = attribList[i+1];
          if (profile != OSMESA_CORE_PROFILE &&
-             profile != OSMESA_COMPAT_PROFILE)
+             profile != OSMESA_COMPAT_PROFILE &&
+	     profile != OSMESA_ES2_PROFILE)
             return NULL;
          break;
       case OSMESA_CONTEXT_MAJOR_VERSION:
@@ -668,8 +669,13 @@ OSMesaCreateContextAttribs(const int *attribList, OSMesaContext sharelist)
     * Create the rendering context
     */
    memset(&attribs, 0, sizeof(attribs));
-   attribs.profile = (profile == OSMESA_CORE_PROFILE)
-      ? ST_PROFILE_OPENGL_CORE : ST_PROFILE_DEFAULT;
+   if (profile == OSMESA_CORE_PROFILE) {
+      attribs.profile = ST_PROFILE_OPENGL_CORE;
+   } else if (profile == OSMESA_ES2_PROFILE) {
+      attribs.profile = ST_PROFILE_OPENGL_ES2;
+   } else {
+      attribs.profile = ST_PROFILE_DEFAULT;
+   }
    attribs.major = version_major;
    attribs.minor = version_minor;
    attribs.flags = 0;  /* ST_CONTEXT_FLAG_x */
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index 356ba71..4487bda 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -718,6 +718,8 @@ OSMesaCreateContextAttribs(const int *attribList, OSMesaContext sharelist)
             api_profile = API_OPENGL_COMPAT;
          else if (profile == OSMESA_CORE_PROFILE)
             api_profile = API_OPENGL_CORE;
+         else if (profile == OSMESA_ES2_PROFILE)
+            api_profile = API_OPENGLES2;
          else
             return NULL;
          break;

@glennw
Copy link
Member Author

glennw commented May 3, 2018

We now run the Windows reftests on CI, via ANGLE, which exercises the ES3 code path. 🎉

@glennw glennw closed this as completed May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants