Skip to content

microsoft/clc: Fix 8-bit integer casts that involve floats

Jesse Natalie requested to merge jenatali/mesa:8bit-casts into msclc-d3d12

Before this change, the lower_bit_size pass could insert spurious casts when going to 8-bit integers: e.g. f2u8 would first generate a f2f16. Obviously we don't need to lower bit sizes if we're about to run another cast.

It also piles onto the 8bit lowering we already have, which avoids round-tripping through 8bit integers before returning back to larger bit sizes by just clamping instead, and prevents going through 8bit integers when coming from floats, instead casting to a larger integer size and clamping, or just clamping and changing bit sizes for float->float.

/cc @kusma @bbrezillon

Edited by Jesse Natalie

Merge request reports