summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2014-12-28 14:21:15 +0100
committerEmil Velikov <[email protected]>2015-01-23 00:47:24 +0000
commit7ecd0f9528c16018c675de41811a6eedd17a9e57 (patch)
tree5c149cde1b7f363c2e803e1edc46f78099daffe1
parent336887bca1c239665c19ecd2da32e62e40a2a61c (diff)
st/nine: Implement TEXM3x2TEX
Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]> (cherry picked from commit 2b9f079ae3ebd1dcd50d1816d7835ec62f3a7782)
-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 93ca6390036..c84a78c5ab2 100644
--- a/src/gallium/state_trackers/nine/nine_shader.c
+++ b/src/gallium/state_trackers/nine/nine_shader.c
@@ -2136,7 +2136,25 @@ DECL_SPECIAL(TEXM3x2PAD)
DECL_SPECIAL(TEXM3x2TEX)
{
- STUB(D3DERR_INVALIDCALL);
+ struct ureg_program *ureg = tx->ureg;
+ struct ureg_dst dst = tx_dst_param(tx, &tx->insn.dst[0]);
+ struct ureg_src sample;
+ const int m = tx->insn.dst[0].idx - 1;
+ const int n = tx->insn.src[0].idx;
+ assert(m >= 0 && m > n);
+
+ tx_texcoord_alloc(tx, m);
+ tx_texcoord_alloc(tx, m+1);
+
+ /* performs the matrix multiplication */
+ ureg_DP3(ureg, ureg_writemask(dst, TGSI_WRITEMASK_X), tx->regs.vT[m], ureg_src(tx->regs.tS[n]));
+ ureg_DP3(ureg, ureg_writemask(dst, TGSI_WRITEMASK_Y), tx->regs.vT[m+1], ureg_src(tx->regs.tS[n]));
+
+ sample = ureg_DECL_sampler(ureg, m + 1);
+ tx->info->sampler_mask |= 1 << (m + 1);
+ ureg_TEX(ureg, dst, ps1x_sampler_type(tx->info, m + 1), ureg_src(dst), sample);
+
+ return D3D_OK;
}
DECL_SPECIAL(TEXM3x3PAD)