From 147dcdaccae02a562a2f1c0c71d02380f9e6a8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Mon, 1 Feb 2016 00:14:39 +0100 Subject: [PATCH] wined3d: Fix SM4 exp, log and rsq instructions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/glsl_shader.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index bf11a91ac25..3b5513bc86f 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -3325,6 +3325,8 @@ static void shader_glsl_nrm(const struct wined3d_shader_instruction *ins) static void shader_glsl_scalar_op(const struct wined3d_shader_instruction *ins) { + DWORD shader_version = WINED3D_SHADER_VERSION(ins->ctx->reg_maps->shader_version.major, + ins->ctx->reg_maps->shader_version.minor); struct wined3d_string_buffer *buffer = ins->ctx->buffer; struct glsl_src_param src0_param; const char *prefix, *suffix; @@ -3334,7 +3336,10 @@ static void shader_glsl_scalar_op(const struct wined3d_shader_instruction *ins) dst_write_mask = shader_glsl_append_dst(buffer, ins); dst_size = shader_glsl_get_write_mask_size(dst_write_mask); - shader_glsl_add_src_param(ins, &ins->src[0], WINED3DSP_WRITEMASK_3, &src0_param); + if (shader_version < WINED3D_SHADER_VERSION(4, 0)) + dst_write_mask = WINED3DSP_WRITEMASK_3; + + shader_glsl_add_src_param(ins, &ins->src[0], dst_write_mask, &src0_param); switch (ins->handler_idx) { @@ -3367,7 +3372,7 @@ static void shader_glsl_scalar_op(const struct wined3d_shader_instruction *ins) break; } - if (dst_size > 1) + if (dst_size > 1 && shader_version < WINED3D_SHADER_VERSION(4, 0)) shader_addline(buffer, "vec%u(%s%s%s));\n", dst_size, prefix, src0_param.param_str, suffix); else shader_addline(buffer, "%s%s%s);\n", prefix, src0_param.param_str, suffix);