From 803e90e76a6bf891f4ecd3aadb147e2c1c8ceae4 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 13 Mar 2015 11:13:20 +1000 Subject: [PATCH] renderer: fix frontfacing conversion from TGSI->GLSL TGSI expects -1.0, 1.0, GLSL is 0.0, 1.0 so convert. Alternate fix to Marc-Andre's fix. --- src/vrend_shader.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vrend_shader.c b/src/vrend_shader.c index 884bf77..15a015f 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -1296,7 +1296,9 @@ iter_instruction(struct tgsi_iterate_context *iter, } else if (ctx->inputs[j].name == TGSI_SEMANTIC_PRIMID) snprintf(srcs[i], 255, "%s(vec4(intBitsToFloat(%s)))", stypeprefix, ctx->inputs[j].glsl_name); - else + else if (ctx->inputs[j].name == TGSI_SEMANTIC_FACE) + snprintf(srcs[i], 255, "%s(%s ? 1.0 : -1.0)", stypeprefix, ctx->inputs[j].glsl_name); + else snprintf(srcs[i], 255, "%s(%s%s%s%s)", stypeprefix, prefix, ctx->inputs[j].glsl_name, arrayname, swizzle); override_no_wm[i] = ctx->inputs[j].override_no_wm; break;