wined3d: Use 3 component norm for 'nrm' opcode in GLSL backend.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=8848
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 447c9523f8)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
oldstable
Paul Gofman 2019-06-13 16:56:59 +03:00 committed by Michael Stefaniuc
parent f46d69c9bb
commit dc3cb001af
1 changed files with 6 additions and 2 deletions

View File

@ -4390,8 +4390,12 @@ static void shader_glsl_nrm(const struct wined3d_shader_instruction *ins)
mask_size = shader_glsl_get_write_mask_size(write_mask);
shader_glsl_add_src_param(ins, &ins->src[0], write_mask, &src_param);
shader_addline(buffer, "tmp0.x = dot(%s, %s);\n",
src_param.param_str, src_param.param_str);
if (mask_size > 3)
shader_addline(buffer, "tmp0.x = dot(vec3(%s), vec3(%s));\n",
src_param.param_str, src_param.param_str);
else
shader_addline(buffer, "tmp0.x = dot(%s, %s);\n",
src_param.param_str, src_param.param_str);
shader_glsl_append_dst(buffer, ins);
if (mask_size > 1)