mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
st/nine: Fix setting of the shift modifier in nine_shader
It is an sint_4, but it was stored in a uint_8... The code using it was acting as if it was signed. Problem found thanks to Coverity Cc: "10.4" <mesa-stable@lists.freedesktop.org> Tested-by: David Heidelberg <david@ixit.cz> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Axel Davy <axel.davy@ens.fr>
This commit is contained in:
parent
90fea6b3e0
commit
d52328fc39
1 changed files with 4 additions and 2 deletions
|
|
@ -239,7 +239,7 @@ struct sm1_dst_param
|
|||
BYTE file;
|
||||
BYTE mask;
|
||||
BYTE mod;
|
||||
BYTE shift; /* sint4 */
|
||||
int8_t shift; /* sint4 */
|
||||
BYTE type;
|
||||
};
|
||||
|
||||
|
|
@ -2527,6 +2527,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;
|
||||
dst->file =
|
||||
(tok & D3DSP_REGTYPE_MASK) >> D3DSP_REGTYPE_SHIFT |
|
||||
(tok & D3DSP_REGTYPE_MASK2) >> D3DSP_REGTYPE_SHIFT2;
|
||||
|
|
@ -2535,7 +2536,8 @@ sm1_parse_dst_param(struct sm1_dst_param *dst, DWORD tok)
|
|||
dst->rel = NULL;
|
||||
dst->mask = (tok & NINED3DSP_WRITEMASK_MASK) >> NINED3DSP_WRITEMASK_SHIFT;
|
||||
dst->mod = (tok & D3DSP_DSTMOD_MASK) >> D3DSP_DSTMOD_SHIFT;
|
||||
dst->shift = (tok & D3DSP_DSTSHIFT_MASK) >> D3DSP_DSTSHIFT_SHIFT;
|
||||
shift = (tok & D3DSP_DSTSHIFT_MASK) >> D3DSP_DSTSHIFT_SHIFT;
|
||||
dst->shift = (shift & 0x8) ? -(shift & 0x7) : shift & 0x7;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue