From 860347164c964ea7edc520e88fe3113ef9f6f092 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Mon, 15 Oct 2018 08:24:01 +0200 Subject: [PATCH] shader: Don't emit 'precise' when 'invariant' is already given in declaration It is not necessary to emit both statements, and on a GLES 3.1 host that doesn't support ARB_gpu_shader5 this actually breaks some shaders. Fixes: 36c919e139f4a shader: rework precise-emitting for built-ins Fixes on the softpipe host driver: dEQP-GLES3.functional.shaders.qualification_order.variables. valid.invariant_interp_storage valid.invariant_interp_storage_precision valid.invariant_storage valid.invariant_storage_precision Reviewed-by: Erik Faye-Lund Reviewed-by: Gurchetan Singh Signed-off-by: Gert Wollny Signed-off-by: Jakob Bornecrantz --- src/vrend_shader.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vrend_shader.c b/src/vrend_shader.c index a7e4e4f..23a4a37 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -2784,8 +2784,10 @@ get_destination_info(struct dump_ctx *ctx, if (ctx->outputs[j].first == dst_reg->Register.Index) { if (inst->Instruction.Precise) { - ctx->outputs[j].precise = true; - ctx->shader_req_bits |= SHADER_REQ_GPU_SHADER5; + if (!ctx->outputs[j].invariant) { + ctx->outputs[j].precise = true; + ctx->shader_req_bits |= SHADER_REQ_GPU_SHADER5; + } } if (ctx->glsl_ver_required >= 140 && ctx->outputs[j].name == TGSI_SEMANTIC_CLIPVERTEX) {