diff options
author | Axel Davy <[email protected]> | 2016-03-12 12:24:51 +0100 |
---|---|---|
committer | Axel Davy <[email protected]> | 2016-05-18 23:37:14 +0200 |
commit | ca7c78a88ecc828a1b08dc18667d2a70d9d0e09d (patch) | |
tree | 6efd9cd4bb349ce0296205435b822eff10197704 /src/gallium | |
parent | b8d95d40872dafbd372c071455d26ab078cdd170 (diff) |
st/nine: Fix output shift calculation
We were getting it wrong for negative values.
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/state_trackers/nine/nine_shader.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c index 972245f4753..2e822ce80c9 100644 --- a/src/gallium/state_trackers/nine/nine_shader.c +++ b/src/gallium/state_trackers/nine/nine_shader.c @@ -3005,7 +3005,7 @@ sm1_parse_get_param(struct shader_translator *tx, DWORD *reg, DWORD *rel) static void sm1_parse_dst_param(struct sm1_dst_param *dst, DWORD tok) { - uint8_t shift; + int8_t shift; dst->file = (tok & D3DSP_REGTYPE_MASK) >> D3DSP_REGTYPE_SHIFT | (tok & D3DSP_REGTYPE_MASK2) >> D3DSP_REGTYPE_SHIFT2; @@ -3015,7 +3015,7 @@ sm1_parse_dst_param(struct sm1_dst_param *dst, DWORD tok) dst->mask = (tok & NINED3DSP_WRITEMASK_MASK) >> NINED3DSP_WRITEMASK_SHIFT; dst->mod = (tok & D3DSP_DSTMOD_MASK) >> D3DSP_DSTMOD_SHIFT; shift = (tok & D3DSP_DSTSHIFT_MASK) >> D3DSP_DSTSHIFT_SHIFT; - dst->shift = (shift & 0x8) ? -(shift & 0x7) : shift & 0x7; + dst->shift = (shift & 0x7) - (shift & 0x8); } static void |