Module: wine
Branch: master
Commit: 601030cfa9ec3d035093fc0f11fb5b124405bc57
URL: http://source.winehq.org/git/wine.git/?a=commit;h=601030cfa9ec3d035093fc0f1…
Author: Stefan Dösinger <stefan(a)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");
}
}
Module: wine
Branch: master
Commit: 48c2b0d66960790fcd781c391f0a4abe915a8f9e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=48c2b0d66960790fcd781c391…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Thu May 7 17:42:16 2009 +0200
wined3d: Merge shader_arb_add_src_param and pshader_gen_input_modifier_line.
Mostly based on the code of pshader_gen_input_modifier_line. The space-adding
behavior of shader_arb_add_src_param was removed because the plurality of
instruction handlers passes an uninitialized buffer in and expects a register
name written to its start, and only map2gl and rcp_rsq use the space-adding
stuff. I'll change rcp_rsq in a later patch anyway. I changed the name to
shader_arb_get_src_param to reflect this behavior.
---
dlls/wined3d/arb_program_shader.c | 103 ++++++++++++++++---------------------
1 files changed, 44 insertions(+), 59 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=48c2b0d66960790fcd781…