[virglrenderer-devel] [PATCH 4/5] vrend: Detect OpenGL GLES being used
Jakob Bornecrantz
jakob.bornecrantz at collabora.com
Mon Nov 27 11:44:44 UTC 2017
Signed-off-by: Jakob Bornecrantz <jakob.bornecrantz at collabora.com>
---
src/vrend_renderer.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 088b815..9d4e1a6 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -98,6 +98,7 @@ struct global_renderer_state {
struct list_head waiting_query_list;
bool inited;
+ bool use_gles;
bool use_core_profile;
bool have_mesa_invert;
@@ -3829,6 +3830,7 @@ static void vrend_debug_cb(GLenum source, GLenum type, GLuint id,
int vrend_renderer_init(struct vrend_if_cbs *cbs, uint32_t flags)
{
+ bool gles;
int gl_ver;
virgl_gl_context gl_context;
struct virgl_gl_ctx_param ctx_params;
@@ -3854,9 +3856,18 @@ int vrend_renderer_init(struct vrend_if_cbs *cbs, uint32_t flags)
glDisable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
}
+ /* make sure you have the latest version of libepoxy */
+ gles = epoxy_is_desktop_gl() == 0;
+
vrend_state.gl_major_ver = gl_ver / 10;
vrend_state.gl_minor_ver = gl_ver % 10;
- if (gl_ver > 30 && !epoxy_has_gl_extension("GL_ARB_compatibility")) {
+
+ if (gles) {
+ fprintf(stderr, "gl_version %d - es profile enabled\n", gl_ver);
+ vrend_state.use_gles = true;
+ /* for now, makes the rest of the code use the most GLES 3.x like path */
+ vrend_state.use_core_profile = 1;
+ } else if (gl_ver > 30 && !epoxy_has_gl_extension("GL_ARB_compatibility")) {
fprintf(stderr, "gl_version %d - core profile enabled\n", gl_ver);
vrend_state.use_core_profile = 1;
} else {
--
2.11.0
More information about the virglrenderer-devel
mailing list