Commit 71c0a71b authored by Jason Ekstrand's avatar Jason Ekstrand
Browse files

fix a bug in snorm conversion

parent 6439a031
......@@ -259,7 +259,7 @@ unorm_to_snorm(unsigned x, unsigned src_bits, unsigned dst_bits)
static inline int
snorm_to_snorm(int x, unsigned src_bits, unsigned dst_bits)
{
if (x == -MAX_INT(src_bits))
if (x < -MAX_INT(src_bits))
return -MAX_INT(dst_bits);
else if (src_bits < dst_bits)
return EXTEND_NORMALIZED_INT(x, src_bits - 1, dst_bits - 1);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment