mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
pan/midgard: avoid implicit cast-warning on Clang
BITFIELD_MASK() returns a 32-bit unsigned integer, and Clang complains if we assign it to a 16-bit unsigned integer without a cast. Let's add that cast. While we're at it, add an assert() to make it clear to the compiler that the condition in BITFIELD_MASK() can be optimized away. Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Tested-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Eric R. Smith <eric.smith@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36606>
This commit is contained in:
parent
e5fda871fd
commit
03b7054c30
1 changed files with 2 additions and 1 deletions
|
|
@ -1642,7 +1642,8 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
|
|||
|
||||
ins.dest_type = ins.src_types[1] = nir_type_uint | instr->def.bit_size;
|
||||
|
||||
ins.mask = BITFIELD_MASK(instr->def.num_components);
|
||||
assert(instr->def.num_components <= 4);
|
||||
ins.mask = (uint16_t)BITFIELD_MASK(instr->def.num_components);
|
||||
emit_mir_instruction(ctx, &ins);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue