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 <jakob@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
Gert Wollny 6 years ago committed by Jakob Bornecrantz
parent b7eccdf410
commit 3bb14a39af
  1. 24
      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) { if (gles_ver > 0) {
caps->v1.glsl_level = 120; caps->v1.glsl_level = 120;
if (gles_ver >= 31) { if (gles_ver >= 31)
caps->v1.glsl_level = 310; 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) else if (gles_ver >= 30)
caps->v1.glsl_level = 130; 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) else if (gl_ver >= 43)
caps->v1.glsl_level = 430; 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_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); vrend_renderer_fill_caps_v1(gl_ver, gles_ver, caps);
if (!fill_capset2) if (!fill_capset2)

Loading…
Cancel
Save