You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UBSAN failure when storing a negative color channel into a unorm8 texture format #611
The current decompressor has orthogonal handling of the internal format (LDR, HDR) and the output pixel format. It is therefore possible to store an HDR texture, which can represent values outside of the [0.0-1.0] range, into a UNORM8 output. The intent is that we can store [0.0 - 1.0] float range in the data, mapping it into the [0-255] uint8 range used by a unorm texture, clamping values outside of that to the limits.
The current code clamps the max value to 255, but does not clamp the lower limit to 0. This works for normal ASTC blocks, as the LNS encoding use for HDR values cannot represent negative values, but the HDR void-extent blocks use a raw FP16 color that can be negative. In this situation the color value stored will be incorrect.
Activity
Clamp negative texel values when storing to unorm8 output
Clamp negative texel values when storing to unorm8 output
Clamp negative texel values when storing to unorm8 output
Clamp negative texel values when storing to unorm8 output