From 3bb14a39af73523f010d34c28e825a739500dd7c Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Thu, 3 Jan 2019 11:54:36 +0100 Subject: [PATCH] vrend: Also set glsl to at least 400 on D-GL when certain extension are available When the host GL version is < 4.0 then the GLSL shader language level is set to a value below 400, but if geometry shaders, tesselation shaders, and the gpu_shader5 are supported, then we can expect that the GLSL language level 400 is actually supported, so advertice it also on a GL host. Tested-by: Jakob Bornecrantz Reviewed-by: Gurchetan Singh Signed-off-by: Gert Wollny Signed-off-by: Jakob Bornecrantz --- src/vrend_renderer.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 5ef0aa3..60fa37f 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -8024,17 +8024,8 @@ static void vrend_fill_caps_glsl_version(int gl_ver, int gles_ver, if (gles_ver > 0) { caps->v1.glsl_level = 120; - if (gles_ver >= 31) { + if (gles_ver >= 31) caps->v1.glsl_level = 310; - if (has_feature(feat_tessellation) && - has_feature(feat_geometry_shader) && - has_feature(feat_gpu_shader5)) - /* This is probably a lie, but Gallium enables - * OES_geometry_shader and ARB_gpu_shader5 - * based on this value, apart from that it doesn't - * seem to be a crucial value */ - caps->v1.glsl_level = 400; - } else if (gles_ver >= 30) caps->v1.glsl_level = 130; } @@ -8057,6 +8048,17 @@ static void vrend_fill_caps_glsl_version(int gl_ver, int gles_ver, else if (gl_ver >= 43) caps->v1.glsl_level = 430; } + + if (caps->v1.glsl_level < 400) { + if (has_feature(feat_tessellation) && + has_feature(feat_geometry_shader) && + has_feature(feat_gpu_shader5)) + /* This is probably a lie, but Gallium enables + * OES_geometry_shader and ARB_gpu_shader5 + * based on this value, apart from that it doesn't + * seem to be a crucial value */ + caps->v1.glsl_level = 400; + } } /* @@ -8500,6 +8502,8 @@ void vrend_renderer_fill_caps(uint32_t set, UNUSED uint32_t version, } vrend_fill_caps_glsl_version(gl_ver, gles_ver, caps); + VREND_DEBUG(dbg_features, NULL, "GLSL support level: %d", caps->v1.glsl_level); + vrend_renderer_fill_caps_v1(gl_ver, gles_ver, caps); if (!fill_capset2)