gallium: fix various undefined left shifts into sign bit
Funnily enough, some of these were turned into a compile-time error by gcc with -fsanitize=undefined ("initializer is not a constant"). Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
@@ -1121,7 +1121,7 @@ st_translate_program_common(struct st_context *st,
|
||||
|
||||
/* Also add patch inputs. */
|
||||
for (attr = 0; attr < 32; attr++) {
|
||||
if (prog->PatchInputsRead & (1 << attr)) {
|
||||
if (prog->PatchInputsRead & (1u << attr)) {
|
||||
GLuint slot = num_inputs++;
|
||||
GLuint patch_attr = VARYING_SLOT_PATCH0 + attr;
|
||||
|
||||
@@ -1240,7 +1240,7 @@ st_translate_program_common(struct st_context *st,
|
||||
|
||||
/* Also add patch outputs. */
|
||||
for (attr = 0; attr < 32; attr++) {
|
||||
if (prog->PatchOutputsWritten & (1 << attr)) {
|
||||
if (prog->PatchOutputsWritten & (1u << attr)) {
|
||||
GLuint slot = num_outputs++;
|
||||
GLuint patch_attr = VARYING_SLOT_PATCH0 + attr;
|
||||
|
||||
|
Reference in New Issue
Block a user