summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2014-12-28 14:46:01 +0100
committerEmil Velikov <[email protected]>2015-01-22 22:16:23 +0000
commit9e23b64c15927225042b8caf7fdc549194610051 (patch)
tree5472faac5639b4a6453d0ffa47db555cebb4b902 /src
parent09eb1e901f4d8e8b18675eb92e5f43dcbd831501 (diff)
st/nine: Implement TEXDP3TEX
Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/nine/nine_shader.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c
index 0585362619d..5d0fd91361e 100644
--- a/src/gallium/state_trackers/nine/nine_shader.c
+++ b/src/gallium/state_trackers/nine/nine_shader.c
@@ -2217,7 +2217,25 @@ DECL_SPECIAL(TEXREG2RGB)
DECL_SPECIAL(TEXDP3TEX)
{
- STUB(D3DERR_INVALIDCALL);
+ struct ureg_program *ureg = tx->ureg;
+ struct ureg_dst dst = tx_dst_param(tx, &tx->insn.dst[0]);
+ struct ureg_dst tmp;
+ struct ureg_src sample;
+ const int m = tx->insn.dst[0].idx;
+ const int n = tx->insn.src[0].idx;
+ assert(m >= 0 && m > n);
+
+ tx_texcoord_alloc(tx, m);
+
+ tmp = tx_scratch(tx);
+ ureg_DP3(ureg, ureg_writemask(tmp, TGSI_WRITEMASK_X), tx->regs.vT[m], ureg_src(tx->regs.tS[n]));
+ ureg_MOV(ureg, ureg_writemask(tmp, TGSI_WRITEMASK_YZ), ureg_imm1f(ureg, 0.0f));
+
+ sample = ureg_DECL_sampler(ureg, m);
+ tx->info->sampler_mask |= 1 << m;
+ ureg_TEX(ureg, dst, ps1x_sampler_type(tx->info, m), ureg_src(tmp), sample);
+
+ return D3D_OK;
}
DECL_SPECIAL(TEXM3x2DEPTH)