summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-12-21 16:21:05 +1000
committerDave Airlie <airlied@redhat.com>2016-01-18 15:35:56 +1000
commitc0f03d35ca2adebb7da702752c9d62309f260555 (patch)
tree8c7a042649633e1735a802ac7ad324c2f33e8910
parent3378e6bea3244e3e600f9170c8c736821934b805 (diff)
fix imul/umul
-rw-r--r--src/vrend_shader.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/vrend_shader.c b/src/vrend_shader.c
index 19d7975..2dc5732 100644
--- a/src/vrend_shader.c
+++ b/src/vrend_shader.c
@@ -2129,13 +2129,17 @@ iter_instruction(struct tgsi_iterate_context *iter,
ctx->uses_gpu_shader5 = true;
break;
case TGSI_OPCODE_UMUL_HI:
- snprintf(buf, 255, "umulExtended(%s, %s, %s, mul_temp);\n", srcs[0], srcs[1], dsts[0]);
+ snprintf(buf, 255, "umulExtended(%s, %s, umul_temp, mul_temp);\n", srcs[0], srcs[1]);
+ EMIT_BUF_WITH_RET(ctx, buf);
+ snprintf(buf, 255, "%s = %s(%s(umul_temp));\n", dsts[0], dstconv, dtypeprefix);
EMIT_BUF_WITH_RET(ctx, buf);
ctx->uses_gpu_shader5 = true;
ctx->write_mul_temp = true;
break;
case TGSI_OPCODE_IMUL_HI:
- snprintf(buf, 255, "imulExtended(%s, %s, %s, mul_temp);\n", srcs[0], srcs[1], dsts[0]);
+ snprintf(buf, 255, "imulExtended(%s, %s, imul_temp, mul_temp);\n", srcs[0], srcs[1]);
+ EMIT_BUF_WITH_RET(ctx, buf);
+ snprintf(buf, 255, "%s = %s(%s(imul_temp));\n", dsts[0], dstconv, dtypeprefix);
EMIT_BUF_WITH_RET(ctx, buf);
ctx->uses_gpu_shader5 = true;
ctx->write_mul_temp = true;
@@ -2466,7 +2470,11 @@ static char *emit_ios(struct dump_ctx *ctx, char *glsl_hdr)
}
if (ctx->write_mul_temp) {
- snprintf(buf, 255, "vec4 mul_temp;\n");
+ snprintf(buf, 255, "uvec4 mul_temp;\n");
+ STRCAT_WITH_RET(glsl_hdr, buf);
+ snprintf(buf, 255, "uvec4 umul_temp;\n");
+ STRCAT_WITH_RET(glsl_hdr, buf);
+ snprintf(buf, 255, "ivec4 imul_temp;\n");
STRCAT_WITH_RET(glsl_hdr, buf);
}