diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 2b5b4a07c05..7d1a3f7e3f6 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -340,7 +340,6 @@ static BOOL need_helper_const(const struct arb_vshader_private *shader_data, if (gl_info->quirks & WINED3D_QUIRK_SET_TEXCOORD_W) return TRUE; /* Have to init texcoords. */ if (!use_nv_clip(gl_info)) return TRUE; /* Init the clip texcoord */ if (reg_maps->usesnrm) return TRUE; /* 0.0 */ - if (reg_maps->usesrcp) return TRUE; /* EPS */ return FALSE; } @@ -2424,8 +2423,6 @@ static void shader_hw_mnxn(const struct wined3d_shader_instruction *ins) static void shader_hw_rcp(const struct wined3d_shader_instruction *ins) { struct wined3d_shader_buffer *buffer = ins->ctx->buffer; - struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; - const char *flt_eps = arb_get_helper_value(ins->ctx->reg_maps->shader_version.type, ARB_EPS); char dst[50]; char src[50]; @@ -2440,23 +2437,7 @@ static void shader_hw_rcp(const struct wined3d_shader_instruction *ins) strcat(src, ".w"); } - /* TODO: If the destination is readable, and not the same as the source, the destination - * can be used instead of TA - */ - if (priv->target_version >= NV2) - { - shader_addline(buffer, "MOVC TA.x, %s;\n", src); - shader_addline(buffer, "MOV TA.x (EQ.x), %s;\n", flt_eps); - shader_addline(buffer, "RCP%s %s, TA.x;\n", shader_arb_get_modifier(ins), dst); - } - else - { - const char *zero = arb_get_helper_value(ins->ctx->reg_maps->shader_version.type, ARB_ZERO); - shader_addline(buffer, "ABS TA.x, %s;\n", src); - shader_addline(buffer, "SGE TA.y, -TA.x, %s;\n", zero); - shader_addline(buffer, "MAD TA.x, TA.y, %s, %s;\n", flt_eps, src); - shader_addline(buffer, "RCP%s %s, TA.x;\n", shader_arb_get_modifier(ins), dst); - } + shader_addline(buffer, "RCP%s %s, %s;\n", shader_arb_get_modifier(ins), dst, src); } static void shader_hw_scalar_op(const struct wined3d_shader_instruction *ins) diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index e2c2dce6941..464fa9a4d58 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -788,7 +788,6 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st else if (ins.handler_idx == WINED3DSIH_MOVA) reg_maps->usesmova = 1; else if (ins.handler_idx == WINED3DSIH_IFC) reg_maps->usesifc = 1; else if (ins.handler_idx == WINED3DSIH_CALL) reg_maps->usescall = 1; - else if (ins.handler_idx == WINED3DSIH_RCP) reg_maps->usesrcp = 1; limit = ins.src_count + (ins.predicate ? 1 : 0); for (i = 0; i < limit; ++i) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index c4509f0f214..288c2db4aa4 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -559,8 +559,7 @@ struct wined3d_shader_reg_maps WORD usestexldl : 1; WORD usesifc : 1; WORD usescall : 1; - WORD usesrcp : 1; - WORD padding : 3; + WORD padding : 4; /* Whether or not loops are used in this shader, and nesting depth */ unsigned loop_depth;