Skip to content

llvmpipe: adjust rounding for viewport scissoring

Roland Scheidegger requested to merge sroland/mesa:llvmpipe_vpscissor_fix into main

Some apps may try to use a viewport adjusted by 0.5 pixels (among other things) to emulate d3d9 pixel center, and in this case we would end up with incorrect "fake scissor" box (shifted by 1 pixel), hence pixels being incorrectly scissored away when permit_linear_rasterizer is set (this happens even if the linear rasterizer is not used in the end).

So adjust the offset so that the half-way points get rounded down instead of up. (This is all a bit iffy I think since we don't use fractional boxes (with 8 subpixel bits) anywhere yet, but at least without msaa it should work out.)

Merge request reports