From 8fa6ebbbb87c1e6af814b8b36e7a5cbb9b09ce3e Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Fri, 23 Aug 2019 10:13:37 +0200 Subject: [PATCH] shader: Force emission of front/backcolor pairs if a backcolor is found in VS Sometime the shader key "color_is_twosided" is not set, but the vertex shader only emits a back color and the fragment shader expects a front color. So if a back color is found set the "twoside" key to force the emission of the declaration for both, the front and the back color. Fixes the piglits: vertex-program-two-side Fixes #123 Signed-off-by: Gert Wollny Reviewed-by: Gurchetan Singh --- src/vrend_shader.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vrend_shader.c b/src/vrend_shader.c index 845103a..385a8bd 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -5931,6 +5931,9 @@ emit_ios_generic_outputs(struct dump_ctx *ctx, ctx->front_back_color_emitted_flags[ctx->outputs[i].sid] |= FRONT_COLOR_EMITTED; if (ctx->outputs[i].name == TGSI_SEMANTIC_BCOLOR) { + // We have a back color so we must force the output emission to declare + // two sides + ctx->key->color_two_side = 1; ctx->front_back_color_emitted_flags[ctx->outputs[i].sid] |= BACK_COLOR_EMITTED; }