mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
tgsi/scan: add an assert for the size of the samplers_declared bitfield
The literal 1 is a (signed) int, and shifting into the sign bit is undefined in C, so change occurences of 1 to 1u. Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
cc39879989
commit
4bfcc86bf9
1 changed files with 2 additions and 1 deletions
|
|
@ -464,7 +464,8 @@ scan_declaration(struct tgsi_shader_info *info,
|
|||
}
|
||||
}
|
||||
} else if (file == TGSI_FILE_SAMPLER) {
|
||||
info->samplers_declared |= 1 << reg;
|
||||
STATIC_ASSERT(sizeof(info->samplers_declared) * 8 >= PIPE_MAX_SAMPLERS);
|
||||
info->samplers_declared |= 1u << reg;
|
||||
} else if (file == TGSI_FILE_SAMPLER_VIEW) {
|
||||
unsigned target = fulldecl->SamplerView.Resource;
|
||||
assert(target < TGSI_TEXTURE_UNKNOWN);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue