Skip to content
Snippets Groups Projects
Commit a4c4efad authored by Bas Nieuwenhuizen's avatar Bas Nieuwenhuizen
Browse files

radv: Rework guard band calculation.


We want the guardband_x/y to be the largerst scalars such that each
viewport scaled by that amount is still a subrange of [-32767, 32767].

The old code has a couple of issues:
1) It used scissor instead of viewport_scissor, potentially taking into
   account a viewport that is too small and therefore selecting a scale
   that is too large.
2) Merging the viewports isn't ideal, as for example viewports with
   boundaries [0,1] and [1000, 1001] would allow a guardband scale of ~30k,
   while their union [0, 1001] only allows a scale of ~32.

The new code just determines the guardband per viewport and takes the minimum.

Signed-off-by: default avatarBas Nieuwenhuizen <basni@google.com>
Acked-by: default avatarDave Airlie <airlied@redhat.com>
parent d64f689f
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment