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:
@@ -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].
|
||||
|
||||
Reference in New Issue
Block a user