Skip to content

ir3: Do 16b tex dst folding only for floats

Folding signed or unsigned i32 -> i16 conversion into sampling instruction causes it to behave differently with out-of-bounds values. The conversion expects higher bits being masked, however folded variant does clamp the value.

A concrete example is that:

 isaml.base0 (u16)(x)hr0.x

is not equal this:

 isaml.base0 (u32)(x)r0.w
 (sy)cov.u32u16 hr0.x, r0.w

Fixes misrendering in "Injustice 2".

Closes: #7869 (closed)

Merge request reports