Skip to content
  • Alyssa Rosenzweig's avatar
    mesa,gallium: Make point coord origin a CAP · e749f67f
    Alyssa Rosenzweig authored and Marge Bot's avatar Marge Bot committed
    
    
    When lower_wpos_pntc is used, the state tracker inserts code to
    transform gl_PointCoord.y according to a uniform, to account for
    API-requested point coordinate origin and framebuffer orientation. With
    the transformation, driver-supplied point coordinates are expected to
    have an upper left origin.
    
    If the hardware point coordinate supports (only) a lower left origin,
    the backend has to use lower_wpos_pntc and then lower *again* to flip
    back. This ends up transforming twice, which is wasteful:
    
       a = load point coord Y with lower left origin
       a' = 1.0 - a
       a'' = uniform_transform(a')
    
    However, lower_wpos_pntc is quite capable of transforming for a lower
    left origin too, it just needs to flip the transformation. Add a CAP
    specifying the point coordinate origin convention, rather than assuming
    upper-left. This simplifies the Asahi code greatly.
    
    Signed-off-by: default avatarAlyssa Rosenzweig <alyssa@rosenzweig.io>
    Reviewed-by: default avatarErik Faye-Lund <erik.faye-lund@collabora.com>
    Reviewed-by: default avatarMarek Olšák <marek.olsak@amd.com>
    Part-of: <!16829>
    e749f67f