From dac4578a37f240b896d11416013819442adb725d Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 11 Mar 2015 14:32:58 +1000 Subject: [PATCH] renderer: make sure to get glsl 1.50 for interface blocks we can't emit an interface block in glsl 1.40 --- src/vrend_shader.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/vrend_shader.c b/src/vrend_shader.c index 3273c62..9df1916 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -210,6 +210,11 @@ iter_declaration(struct tgsi_iterate_context *iter, if (ctx->prog_type == -1) ctx->prog_type = iter->processor.Processor; + + if (iter->processor.Processor == TGSI_PROCESSOR_VERTEX && + ctx->key->gs_present && ctx->key->clip_plane_enable) + ctx->glsl_ver_required = 150; + switch (decl->Declaration.File) { case TGSI_FILE_INPUT: i = ctx->num_inputs++; @@ -1971,8 +1976,8 @@ static char *emit_ios(struct dump_ctx *ctx, char *glsl_hdr) } if (ctx->prog_type == TGSI_PROCESSOR_GEOMETRY) { - if (ctx->num_in_clip_dist) { - snprintf(buf, 255, "in gl_PerVertex {\n vec4 gl_Position;\n float gl_PointSize; \n float gl_ClipDistance[%d];\n} gl_in[];\n", ctx->num_clip_dist); + if (ctx->num_in_clip_dist || ctx->key->clip_plane_enable) { + snprintf(buf, 255, "in gl_PerVertex {\n vec4 gl_Position;\n float gl_PointSize; \n float gl_ClipDistance[%d];\n} gl_in[];\n", ctx->num_in_clip_dist ? ctx->num_in_clip_dist : 8); STRCAT_WITH_RET(glsl_hdr, buf); } if (ctx->num_clip_dist) {