Skip to content
  • Roland Scheidegger's avatar
    llvmpipe: fix snorm blending · b5957cee
    Roland Scheidegger authored
    
    
    The blend math gets a bit funky due to inverse blend factors being
    in range [0,2] rather than [-1,1], our normalized math can't really
    cover this.
    src_alpha_saturate blend factor has a similar problem too.
    (Note that piglit fbo-blending-formats test is mostly useless for
    anything but unorm formats, since not just all src/dst values are
    between [0,1], but the tests are crafted in a way that the results
    are between [0,1] too.)
    
    v2: some formatting fixes, and fix a fairly obscure (to debug)
    issue with alpha-only formats (not related to snorm at all), where
    blend optimization would think it could simplify the blend equation
    if the blend factors were complementary, however was using the
    completely unrelated rgb blend factors instead of the alpha ones...
    
    Reviewed-by: default avatarJose Fonseca <jfonseca@vmware.com>
    b5957cee