Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • mesa mesa
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 3.2k
    • Issues 3.2k
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1k
    • Merge requests 1k
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • MesaMesa
  • mesamesa
  • Merge requests
  • !156

i965,anv: Fix fractional viewport coordinates handling

  • Review changes

  • Download
  • Patches
  • Plain diff
Open Danylo Piliaiev requested to merge GL/mesa:fix/fractional-viewport-coordinates into main Jan 25, 2019
  • Overview 21
  • Commits 2
  • Pipelines 1
  • Changes 2

On gen8+ fractional translation of viewport moved it by a whole integer. The behaviour in this case isn't defined anywhere but some apps like Wine may depend on viewport's width and height being ceiled.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106526

There is a similar bug filed for Nvidia driver https://devtalk.nvidia.com/default/topic/971005/linux/glviewportindexedf-wrongly-rounding-down-x-and-y-parameters/ . I wasn't able to find the exact specification for such case but e.g. Wine expects coordinates not to be shifted (see wined3d_caps_gl_ctx_test_viewport_subpixel_bits function in Wine).

The closest line in specs is in the specification of ARB_viewport_array extension:

Direct3D 11 specifies that rasterization along the one-pixel edges of fractional viewports to be undefined. If implementations want defined behavior with fractional viewports, they can program a slightly wider viewport and scissor away the pixels along the edge of the expanded viewport.

Viewport's width and height are already ceiled on radeon driver (e50e1f86) and i965 behaves the same before gen8.

This patch was moved from the mailing lists. It passes CI https://mesa-ci.01.org/global_logic/builds/58/group/63a9f0ea7bb98050796b649e85481845

Edited May 05, 2021 by Jordan Justen
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix/fractional-viewport-coordinates