From 47324895250974c88fc36d84c289cb643c881446 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 20 Aug 2018 15:52:27 +0200 Subject: [PATCH] shader: do not redeclare built-ins as precise In 47387e4 (emit precise keyword), I added code to try to declare outputs as 'precise' if an instruction flagged as precise wrote to it. Turns out, redeclaring built-ins as 'precise' isn't allowed, so that bit was a mistake. And because mesa transforms "invariant" into instructions with the precise-flag set, we can end up writing to built-ins with the precise-flag, leading to shaders that doesn't compile correctly. So let's remove the code that emits the precise-keyword when re-declaring built-ins. This fixes a regression in dEQP-GLES2.functional.shaders.algorithm.hsl_to_rgb_vertex when ran right after dEQP-GLES2.functional.shaders.invariance.highp.subexpression_precision_lowp. Signed-off-by: Erik Faye-Lund Reviewed-by: Gurchetan Singh Signed-off-by: Dave Airlie --- src/vrend_shader.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/vrend_shader.c b/src/vrend_shader.c index 552bc89..59e3b48 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -4565,9 +4565,8 @@ static char *emit_ios(struct dump_ctx *ctx, char *glsl_hdr) ctx->outputs[i].fbfetch_used ? "inout" : "out", ctx->outputs[i].glsl_name); STRCAT_WITH_RET(glsl_hdr, buf); - } else if (ctx->outputs[i].invariant || ctx->outputs[i].precise) { - snprintf(buf, 255, "%s%s %s;\n", - ctx->outputs[i].precise ? "precise " : "", + } else if (ctx->outputs[i].invariant) { + snprintf(buf, 255, "%s %s;\n", ctx->outputs[i].invariant ? "invariant " : "", ctx->outputs[i].glsl_name); STRCAT_WITH_RET(glsl_hdr, buf);