aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorAdam Jackson <[email protected]>2019-10-23 17:07:03 -0400
committerAdam Jackson <[email protected]>2019-10-24 14:21:51 -0400
commit2e9aef4651b5e99c688414d56143ec81a4aaf6a8 (patch)
treedd0c716083dbbd97c844a88e3faae85910d862b6 /src/mesa
parent4b17311e528dcf8268c2903297ab629495da5bc7 (diff)
gallium: Fix a bunch of undefined left-shifts in u_format_*
Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/texcompress_s3tc_tmp.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/main/texcompress_s3tc_tmp.h b/src/mesa/main/texcompress_s3tc_tmp.h
index dbf8c871b7a..904c6765261 100644
--- a/src/mesa/main/texcompress_s3tc_tmp.h
+++ b/src/mesa/main/texcompress_s3tc_tmp.h
@@ -59,7 +59,7 @@ static void dxt135_decode_imageblock ( const GLubyte *img_block_src,
const GLushort color0 = img_block_src[0] | (img_block_src[1] << 8);
const GLushort color1 = img_block_src[2] | (img_block_src[3] << 8);
const GLuint bits = img_block_src[4] | (img_block_src[5] << 8) |
- (img_block_src[6] << 16) | (img_block_src[7] << 24);
+ (img_block_src[6] << 16) | ((GLuint)img_block_src[7] << 24);
/* What about big/little endian? */
GLubyte bit_pos = 2 * (j * 4 + i) ;
GLubyte code = (GLubyte) ((bits >> bit_pos) & 3);
@@ -430,7 +430,7 @@ static void storedxtencodedblock( GLubyte *blkaddr, GLubyte srccolors[4][4][4],
}
}
testerror += pixerrorbest;
- bits |= enc << (2 * (j * 4 + i));
+ bits |= (uint32_t)enc << (2 * (j * 4 + i));
}
}
/* some hw might disagree but actually decoding should always use 4-color encoding
@@ -470,7 +470,7 @@ static void storedxtencodedblock( GLubyte *blkaddr, GLubyte srccolors[4][4][4],
}
}
testerror2 += pixerrorbest;
- bits2 |= enc << (2 * (j * 4 + i));
+ bits2 |= (uint32_t)enc << (2 * (j * 4 + i));
}
}
} else {