summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2014-12-03 15:14:07 +0100
committerEmil Velikov <[email protected]>2015-01-22 22:16:20 +0000
commitc12f8c208882a7e9aac0c488c08ee1771ead5a0d (patch)
treec4769a0354003fbafe0d36ff8214bdea44e8ae00 /src/gallium/state_trackers
parente0dd9ca9854b27104176d961d5c8b37b1e0637e5 (diff)
st/nine: Fix POW implementation
POW doesn't match directly TGSI, since we should take the absolute value of src0. Fixes black textures in some games Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/nine/nine_shader.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c
index 7031063d12e..09846dcd98b 100644
--- a/src/gallium/state_trackers/nine/nine_shader.c
+++ b/src/gallium/state_trackers/nine/nine_shader.c
@@ -1936,6 +1936,17 @@ DECL_SPECIAL(DEFI)
return D3D_OK;
}
+DECL_SPECIAL(POW)
+{
+ struct ureg_dst dst = tx_dst_param(tx, &tx->insn.dst[0]);
+ struct ureg_src src[2] = {
+ tx_src_param(tx, &tx->insn.src[0]),
+ tx_src_param(tx, &tx->insn.src[1])
+ };
+ ureg_POW(tx->ureg, dst, ureg_abs(src[0]), src[1]);
+ return D3D_OK;
+}
+
DECL_SPECIAL(NRM)
{
struct ureg_program *ureg = tx->ureg;
@@ -2278,7 +2289,7 @@ struct sm1_op_info inst_table[] =
_OPI(DCL, NOP, V(0,0), V(3,0), V(0,0), V(3,0), 0, 0, SPECIAL(DCL)),
- _OPI(POW, POW, V(0,0), V(3,0), V(0,0), V(3,0), 1, 2, NULL),
+ _OPI(POW, POW, V(0,0), V(3,0), V(0,0), V(3,0), 1, 2, SPECIAL(POW)),
_OPI(CRS, XPD, V(0,0), V(3,0), V(0,0), V(3,0), 1, 2, NULL), /* XXX: .w */
_OPI(SGN, SSG, V(2,0), V(3,0), V(0,0), V(0,0), 1, 3, SPECIAL(SGN)), /* ignore src1,2 */
_OPI(ABS, ABS, V(0,0), V(3,0), V(0,0), V(3,0), 1, 1, NULL),