mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 07:50:11 +01:00
st/nine: Fix SINCOS input
SINCOS takes an input with replicated swizzle. the swizzle can be on any component, not just x. Enable it to read from any component, but also use a temporary register to avoid dst/src aliasing. No known game is fixed by this change as it seems the input swizzle is commonly on x for this instruction, and src and dst don't alias. Signed-off-by: Axel Davy <davyaxel0@gmail.com>
This commit is contained in:
parent
f4ae483c44
commit
4ca6b1dfd1
1 changed files with 7 additions and 2 deletions
|
|
@ -1807,14 +1807,19 @@ DECL_SPECIAL(SINCOS)
|
|||
struct ureg_program *ureg = tx->ureg;
|
||||
struct ureg_dst dst = tx_dst_param(tx, &tx->insn.dst[0]);
|
||||
struct ureg_src src = tx_src_param(tx, &tx->insn.src[0]);
|
||||
struct ureg_dst tmp = tx_scratch_scalar(tx);
|
||||
|
||||
assert(!(dst.WriteMask & 0xc));
|
||||
|
||||
/* Copying to a temporary register avoids src/dst aliasing.
|
||||
* src is supposed to have replicated swizzle. */
|
||||
ureg_MOV(ureg, tmp, src);
|
||||
|
||||
/* z undefined, w untouched */
|
||||
ureg_COS(ureg, ureg_writemask(dst, TGSI_WRITEMASK_X),
|
||||
ureg_scalar(src, TGSI_SWIZZLE_X));
|
||||
tx_src_scalar(tmp));
|
||||
ureg_SIN(ureg, ureg_writemask(dst, TGSI_WRITEMASK_Y),
|
||||
ureg_scalar(src, TGSI_SWIZZLE_X));
|
||||
tx_src_scalar(tmp));
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue