summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2014-12-28 14:56:02 +0100
committerEmil Velikov <[email protected]>2015-01-22 22:16:23 +0000
commitbce94ce831492333dae1b85d4387c66fdbfabf57 (patch)
treead3d0de1c66f9816b0b08df57fe759af3c5f9677 /src/gallium/state_trackers/nine
parent9e23b64c15927225042b8caf7fdc549194610051 (diff)
st/nine: Implement TEXREG2AR, TEXREG2GB and TEXREG2RGB
Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine')
-rw-r--r--src/gallium/state_trackers/nine/nine_shader.c39
1 files changed, 36 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c
index 5d0fd91361e..f20140d33a5 100644
--- a/src/gallium/state_trackers/nine/nine_shader.c
+++ b/src/gallium/state_trackers/nine/nine_shader.c
@@ -2127,12 +2127,34 @@ DECL_SPECIAL(TEXBEML)
DECL_SPECIAL(TEXREG2AR)
{
- 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;
+ const int n = tx->insn.src[0].idx;
+ assert(m >= 0 && m > n);
+
+ sample = ureg_DECL_sampler(ureg, m);
+ tx->info->sampler_mask |= 1 << m;
+ ureg_TEX(ureg, dst, ps1x_sampler_type(tx->info, m), ureg_swizzle(ureg_src(tx->regs.tS[n]), NINE_SWIZZLE4(W,X,X,X)), sample);
+
+ return D3D_OK;
}
DECL_SPECIAL(TEXREG2GB)
{
- 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;
+ const int n = tx->insn.src[0].idx;
+ assert(m >= 0 && m > n);
+
+ sample = ureg_DECL_sampler(ureg, m);
+ tx->info->sampler_mask |= 1 << m;
+ ureg_TEX(ureg, dst, ps1x_sampler_type(tx->info, m), ureg_swizzle(ureg_src(tx->regs.tS[n]), NINE_SWIZZLE4(Y,Z,Z,Z)), sample);
+
+ return D3D_OK;
}
DECL_SPECIAL(TEXM3x2PAD)
@@ -2212,7 +2234,18 @@ DECL_SPECIAL(TEXM3x3SPEC)
DECL_SPECIAL(TEXREG2RGB)
{
- 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;
+ const int n = tx->insn.src[0].idx;
+ assert(m >= 0 && m > n);
+
+ sample = ureg_DECL_sampler(ureg, m);
+ tx->info->sampler_mask |= 1 << m;
+ ureg_TEX(ureg, dst, ps1x_sampler_type(tx->info, m), ureg_src(tx->regs.tS[n]), sample);
+
+ return D3D_OK;
}
DECL_SPECIAL(TEXDP3TEX)