On Thu, 13 Jun 2019 at 14:48, Paul Gofman gofmanp@gmail.com wrote:
@@ -4268,7 +4268,12 @@ static void shader_glsl_nrm(const struct wined3d_shader_instruction *ins) src_param.param_str, src_param.param_str); shader_glsl_append_dst(buffer, ins);
- if (mask_size > 1)
- if (mask_size == 4)
- {
shader_addline(buffer, "tmp0.x == 0.0 ? vec4(vec3(0.0), %s[3]) : (%s * inversesqrt(tmp0.x)));\n",
src_param.param_str, src_param.param_str);
- }
- else if (mask_size > 1) { shader_addline(buffer, "tmp0.x == 0.0 ? vec%u(0.0) : (%s * inversesqrt(tmp0.x)));\n", mask_size, src_param.param_str);
--
This should work, but the following is perhaps more straightforward:
shader_addline(buffer, "tmp0.x == 0.0 ? %s : (%s * inversesqrt(tmp0.x)));\n", src_param.param_str, src_param.param_str);
I.e., simply dropping the mask_size dependency.