mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Use a union to return NaN constant from ConvertFromHalf. Refs #274
This commit is contained in:
@@ -121,7 +121,12 @@ inline float ConvertFromHalf(uint16_t comp)
|
||||
}
|
||||
else // if(exponent = 0x1f)
|
||||
{
|
||||
int nan = 0x7F800001;
|
||||
return *(float *)&nan;
|
||||
union
|
||||
{
|
||||
int i;
|
||||
float f;
|
||||
} nan;
|
||||
nan.i = 0x7F800001;
|
||||
return nan.f;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user