[virglrenderer-devel] [PATCH] vrend: fix writemask/swizzle on conversion functions.
Gurchetan Singh
gurchetansingh at chromium.org
Wed Feb 14 01:18:47 UTC 2018
Verified this fixes
dEQP-GLES2.functional.shaders.swizzles.vector_swizzles.* on CrOS +
Nvidia host drivers
Reviewed-by: Gurchetan Singh <gurchetansingh at chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh at chromium.org>
On Tue, Feb 13, 2018 at 5:07 PM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> 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.*
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
> 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:
> --
> 2.14.3
>
> _______________________________________________
> virglrenderer-devel mailing list
> virglrenderer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/virglrenderer-devel
More information about the virglrenderer-devel
mailing list