Skip to content

gallium/u_simple_shaders: Optimize out ffloors

Alyssa Rosenzweig requested to merge alyssa/mesa:gallium/blit-opt into main

What does this MR do and why?

gallium/u_simple_shaders: Optimize out ffloors

ffloor(f2i(x)) can't be optimized to f2i(x) due to differing behaviour for negative x, but u_blitter only uses this with nonnegative x so we can instead use ftrunc(f2i(x)) which NIR will optimize to f2i(x) for us. This gets rid of the silly ffloor instructions in blit shaders.

Signed-off-by: Alyssa Rosenzweig alyssa@rosenzweig.io

Merge request reports