Stefan Dösinger : wined3d: Standardize pshader_hw_texkill.

Alexandre Julliard julliard at winehq.org
Mon May 11 09:10:48 CDT 2009


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Thu May  7 18:22:16 2009 +0200

wined3d: Standardize pshader_hw_texkill.

Use shader_arb_get_dst_param instead of get_register_name to find the register
name. Even though this adds support for modifiers(which aren't allowed by
native), this shouldn't hurt. If an app passes in an incorrect shader it
should be caught in the frontend.

---

 dlls/wined3d/arb_program_shader.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index c77c664..56ee162 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -1016,13 +1016,11 @@ static void pshader_hw_texkill(const struct wined3d_shader_instruction *ins)
     const struct wined3d_shader_dst_param *dst = &ins->dst[0];
     SHADER_BUFFER *buffer = ins->ctx->buffer;
     char reg_dest[40];
-    BOOL is_color;
 
     /* No swizzles are allowed in d3d's texkill. PS 1.x ignores the 4th component as documented,
      * but >= 2.0 honors it(undocumented, but tested by the d3d9 testsuit)
      */
-    shader_arb_get_register_name(ins->ctx->shader, dst->reg.type,
-            dst->reg.idx, !!dst->reg.rel_addr, reg_dest, &is_color);
+    shader_arb_get_dst_param(ins, dst, reg_dest);
 
     if (ins->ctx->reg_maps->shader_version.major >= 2)
     {
@@ -1032,8 +1030,7 @@ static void pshader_hw_texkill(const struct wined3d_shader_instruction *ins)
         /* ARB fp doesn't like swizzles on the parameter of the KIL instruction. To mask the 4th component,
          * copy the register into our general purpose TMP variable, overwrite .w and pass TMP to KIL
          */
-        shader_addline(buffer, "MOV TMP, %s;\n", reg_dest);
-        shader_addline(buffer, "MOV TMP.w, one.w;\n");
+        shader_addline(buffer, "SWZ TMP, %s, x, y, z, 1;\n", reg_dest);
         shader_addline(buffer, "KIL TMP;\n");
     }
 }




More information about the wine-cvs mailing list