[Bug 45375] Halo Online: Weird black display problems.

wine-bugs at winehq.org wine-bugs at winehq.org
Mon Jul 9 17:16:11 CDT 2018


https://bugs.winehq.org/show_bug.cgi?id=45375

--- Comment #3 from Connor McAdams <conmanx360 at gmail.com> ---
This is due to a division by 0 in the conversion of an RCP function to GLSL.
D3D9 handles inf and NaN differently than OpenGL, so to fix it, that issue will
need to be resolved. However, as a temporary hack, you can do this:

in the file glsl_shader.c, function "shader_glsl_scalar_op", at the bottom,
replace the regular else with:
    else {
        shader_addline(buffer, "%s%s%s);\n", prefix, src0_param.param_str,
suffix);
        if (ins->handler_idx == WINED3DSIH_RCP) {
            struct glsl_dst_param dst_param;
            shader_glsl_add_dst_param(ins, &ins->dst[0], &dst_param);
            shader_addline(buffer, "%s%s = ((isinf(%s%s)) ? 0.0 : %s%s);\n",
dst_param.reg_name, dst_param.mask_str,
                    dst_param.reg_name, dst_param.mask_str, dst_param.reg_name,
dst_param.mask_str);
        }
    }

This will add a check after every RCP conversion. It works fine for me, and
doesn't seem to effect performance much. However, this is a hack. Not sure if
it will cause issues in other games.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list