vrend, feature: Add GLSL version information for GLES 3.1 host

v2: use the glsl version from the caps
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Gert Wollny 6 years ago committed by Dave Airlie
parent 3d6213cc8b
commit 5e630741f5
  1. 4
      src/vrend_renderer.c
  2. 4
      src/vrend_shader.c

@ -7795,7 +7795,9 @@ 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 >= 30) if (gles_ver >= 31)
caps->v1.glsl_level = 310;
else if (gles_ver >= 30)
caps->v1.glsl_level = 130; caps->v1.glsl_level = 130;
} }

@ -3940,7 +3940,9 @@ prolog(struct tgsi_iterate_context *iter)
static char *emit_header(struct dump_ctx *ctx, char *glsl_hdr) static char *emit_header(struct dump_ctx *ctx, char *glsl_hdr)
{ {
if (ctx->cfg->use_gles) { if (ctx->cfg->use_gles) {
STRCAT_WITH_RET(glsl_hdr, "#version 300 es\n"); char buf[32];
snprintf(buf, sizeof(buf), "#version %d es\n", ctx->cfg->glsl_version);
STRCAT_WITH_RET(glsl_hdr, buf);
if (ctx->shader_req_bits & SHADER_REQ_SAMPLER_MS) if (ctx->shader_req_bits & SHADER_REQ_SAMPLER_MS)
STRCAT_WITH_RET(glsl_hdr, "#extension GL_OES_texture_storage_multisample_2d_array : require\n"); STRCAT_WITH_RET(glsl_hdr, "#extension GL_OES_texture_storage_multisample_2d_array : require\n");
PAD_GPU_SHADER5(glsl_hdr); PAD_GPU_SHADER5(glsl_hdr);

Loading…
Cancel
Save