[Mesa-dev] [PATCH mesa] egl: add helper to combine two u32 into one u64

Daniel Stone daniel at fooishbar.org
Tue Aug 21 09:38:58 UTC 2018

Hi Eric,

On Sat, 18 Aug 2018 at 13:58, Eric Engestrom <eric.engestrom at intel.com> wrote:
> The original issue spotted was an upcast done after a bitwise ops, but
> since the same logic is done in multiple place, Emil suggested adding
> a helper to avoid mistakes.

Works for me. The original issue we had was not so much with the
upcast, but conversion from signed to unsigned. The casts were put in
to prevent sign extension when s32 from attribs or queries were
widened to 64 bits. The helper seems bulletproof: taking the arguments
as u32 guarantees we'll never get sign extension since the arguments
are never treated as signed. Might be worth a note in the commit about

Reviewed-by: Daniel Stone <daniels at collabora.com>


More information about the mesa-dev mailing list