From 465109d4be5c9709e91b8eeebc34aea4c75dec23 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 14 Feb 2018 11:05:36 +1000 Subject: [PATCH] vrend: fix writemask/swizzle on conversion functions. These weren't adding the writemask component selection properly, F2I TEMP[0].y, IN[1].xyyy was getting incorrectly translated. Fixes: dEQP-GLES2.functional.shaders.swizzles.vector_swizzles.* Reviewed-by: Gurchetan Singh Tested-by: Gurchetan Singh Signed-off-by: Dave Airlie --- src/vrend_shader.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vrend_shader.c b/src/vrend_shader.c index 420bc83..6e1517e 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -1937,19 +1937,19 @@ iter_instruction(struct tgsi_iterate_context *iter, return FALSE; break; case TGSI_OPCODE_I2F: - snprintf(buf, 255, "%s = %s(ivec4(%s));\n", dsts[0], dstconv, srcs[0]); + snprintf(buf, 255, "%s = %s(ivec4(%s)%s);\n", dsts[0], dstconv, srcs[0], writemask); EMIT_BUF_WITH_RET(ctx, buf); break; case TGSI_OPCODE_U2F: - snprintf(buf, 255, "%s = %s(uvec4(%s));\n", dsts[0], dstconv, srcs[0]); + snprintf(buf, 255, "%s = %s(uvec4(%s)%s);\n", dsts[0], dstconv, srcs[0], writemask); EMIT_BUF_WITH_RET(ctx, buf); break; case TGSI_OPCODE_F2I: - snprintf(buf, 255, "%s = %s(%s(ivec4(%s)));\n", dsts[0], dstconv, dtypeprefix, srcs[0]); + snprintf(buf, 255, "%s = %s(%s(ivec4(%s))%s);\n", dsts[0], dstconv, dtypeprefix, srcs[0], writemask); EMIT_BUF_WITH_RET(ctx, buf); break; case TGSI_OPCODE_F2U: - snprintf(buf, 255, "%s = %s(%s(uvec4(%s)));\n", dsts[0], dstconv, dtypeprefix, srcs[0]); + snprintf(buf, 255, "%s = %s(%s(uvec4(%s))%s);\n", dsts[0], dstconv, dtypeprefix, srcs[0], writemask); EMIT_BUF_WITH_RET(ctx, buf); break; case TGSI_OPCODE_NOT: