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 <gert.wollny@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Gert Wollny 5 years ago
parent e2737b86ef
commit 8fa6ebbbb8
  1. 3
      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;
}

Loading…
Cancel
Save