mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-16 15:50:19 +01:00
gallium: Add a uif() helper function to complement fui()
I found myself often wanting this when I'm printing out a uint32_t mapping of some GPU data, and I want to put in an interpretation of that value as a float. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
This commit is contained in:
parent
bf3a26266d
commit
bfb0da9fa7
1 changed files with 8 additions and 0 deletions
|
|
@ -616,6 +616,14 @@ fui( float f )
|
|||
return fi.ui;
|
||||
}
|
||||
|
||||
static INLINE float
|
||||
uif(uint32_t ui)
|
||||
{
|
||||
union fi fi;
|
||||
fi.ui = ui;
|
||||
return fi.f;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert ubyte to float in [0, 1].
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue