From 7f6ae94c0ad0590b5be1cbef49495523ca3abbfc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20D=C3=B6singer?= Date: Wed, 7 Oct 2009 16:54:49 +0200 Subject: [PATCH] wined3d: Don't write to result.color in arb_add_sRGB_correction. add_sRGB_correction and the generate_pshader function generate the same MOV. There's no need to do it in two places. --- dlls/wined3d/arb_program_shader.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index f1218adc50..c3d0a1ab68 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -3137,7 +3137,6 @@ static void arbfp_add_sRGB_correction(struct wined3d_shader_buffer *buffer, cons * not allocated from one of our registers that were used earlier. */ } - shader_addline(buffer, "MOV result.color, %s;\n", fragcolor); /* [0.0;1.0] clamping. Not needed, this is done implicitly */ } @@ -3513,7 +3512,9 @@ static GLuint shader_arb_generate_pshader(IWineD3DPixelShaderImpl *This, struct if(args->super.srgb_correction) { arbfp_add_sRGB_correction(buffer, fragcolor, srgbtmp[0], srgbtmp[1], srgbtmp[2], srgbtmp[3], priv_ctx.target_version >= NV2); - } else if(reg_maps->shader_version.major < 2) { + } + + if(strcmp(fragcolor, "result.color")) { shader_addline(buffer, "MOV result.color, %s;\n", fragcolor); } shader_addline(buffer, "END\n"); @@ -5776,6 +5777,7 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, IWi if(settings->sRGB_write) { shader_addline(&buffer, "MAD ret, fragment.color.secondary, specular_enable, %s;\n", final_combiner_src); arbfp_add_sRGB_correction(&buffer, "ret", "arg0", "arg1", "arg2", "tempreg", FALSE); + shader_addline(&buffer, "MOV result.color, ret;\n"); } else { shader_addline(&buffer, "MAD result.color, fragment.color.secondary, specular_enable, %s;\n", final_combiner_src); } -- 2.32.0.93.g670b81a890