Stefan Dösinger : wined3d: Don't write to result. color in arb_add_sRGB_correction.

Alexandre Julliard julliard at winehq.org
Thu Oct 8 08:57:12 CDT 2009


Module: wine
Branch: master
Commit: 7f6ae94c0ad0590b5be1cbef49495523ca3abbfc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7f6ae94c0ad0590b5be1cbef49495523ca3abbfc

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Wed Oct  7 16:54:49 2009 +0200

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 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index f1218ad..c3d0a1a 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);
     }




More information about the wine-cvs mailing list