summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2014-12-26 11:14:05 +0100
committerEmil Velikov <[email protected]>2015-01-22 22:16:22 +0000
commit30704bbc6e56e27b0dac325165133e84351db884 (patch)
tree1b86a269616c9b0e2ff462ad07f0646245afaedc /src
parent6378d749379f7fedd668148e09dd032b8ce9a212 (diff)
st/nine: Fix CALLNZ implementation
Nothing seems to indicates the negation modifier would be stored in the instruction flags instead of the source modifier. tx_src_param has already handled it if it is in the source modifier. In addition, when the card supports native integers, the boolean are stored in 32 bits int and are equal to 0 or 0xFFFFFFFF. Given 0xFFFFFFFF is NaN if it was a float, better use UIF than IF. Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/nine/nine_shader.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c
index 883743eb39e..2b418232eb0 100644
--- a/src/gallium/state_trackers/nine/nine_shader.c
+++ b/src/gallium/state_trackers/nine/nine_shader.c
@@ -1427,17 +1427,12 @@ DECL_SPECIAL(CALL)
DECL_SPECIAL(CALLNZ)
{
struct ureg_program *ureg = tx->ureg;
- struct ureg_dst tmp = tx_scratch_scalar(tx);
struct ureg_src src = tx_src_param(tx, &tx->insn.src[1]);
- /* NOTE: source should be const bool, so we can use NOT/SUB instead of [U]SNE 0 */
- if (!tx->insn.flags) {
- if (tx->native_integers)
- ureg_NOT(ureg, tmp, src);
- else
- ureg_SUB(ureg, tmp, ureg_imm1f(ureg, 1.0f), src);
- }
- ureg_IF(ureg, tx->insn.flags ? src : tx_src_scalar(tmp), tx_cond(tx));
+ if (!tx->native_integers)
+ ureg_IF(ureg, src, tx_cond(tx));
+ else
+ ureg_UIF(ureg, src, tx_cond(tx));
ureg_CAL(ureg, &tx->inst_labels[tx->insn.src[0].idx]);
tx_endcond(tx);
ureg_ENDIF(ureg);