summaryrefslogtreecommitdiff
path: root/src/vrend_shader.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vrend_shader.c')
-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);
}