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 <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Erik Faye-Lund 6 years ago committed by Dave Airlie
parent 964d08aa3b
commit 4732489525
  1. 5
      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].fbfetch_used ? "inout" : "out",
ctx->outputs[i].glsl_name); ctx->outputs[i].glsl_name);
STRCAT_WITH_RET(glsl_hdr, buf); STRCAT_WITH_RET(glsl_hdr, buf);
} else if (ctx->outputs[i].invariant || ctx->outputs[i].precise) { } else if (ctx->outputs[i].invariant) {
snprintf(buf, 255, "%s%s %s;\n", snprintf(buf, 255, "%s %s;\n",
ctx->outputs[i].precise ? "precise " : "",
ctx->outputs[i].invariant ? "invariant " : "", ctx->outputs[i].invariant ? "invariant " : "",
ctx->outputs[i].glsl_name); ctx->outputs[i].glsl_name);
STRCAT_WITH_RET(glsl_hdr, buf); STRCAT_WITH_RET(glsl_hdr, buf);

Loading…
Cancel
Save