Skip to content
  • Francisco Jerez's avatar
    gallium/tgsi: Treat UCMP sources as floats to match the GLSL-to-TGSI pass expectations. · e6469ec4
    Francisco Jerez authored
    Currently the GLSL-to-TGSI translation pass assumes it can use
    floating point source modifiers on the UCMP instruction.  See the bug
    report linked below for an example where an unrelated change in the
    GLSL built-in lowering code for atan2 (e9ffd128
    
    )
    caused the generation of floating-point ir_unop_neg instructions
    followed by ir_triop_csel, which is translated into UCMP with a negate
    modifier on back-ends with native integer support.
    
    Allowing floating-point source modifiers on an integer instruction
    seems like rather dubious design for a transport IR, since the same
    semantics could be represented as a sequence of MOV+UCMP instructions
    instead, but supposedly this matches the expectations of TGSI
    back-ends other than tgsi_exec, and the expectations of the DX10 API.
    I take no responsibility for future headaches caused by this
    inconsistency.
    
    Fixes a regression of piglit glsl-fs-tan-1 on softpipe introduced by
    the above-mentioned glsl front-end commit.  Even though the commit
    that triggered the regression doesn't seem to have made it to any
    stable branches yet, this might be worth back-porting since I don't
    see any reason why the bug couldn't have been reproduced before that
    point.
    
    Suggested-by: default avatarRoland Scheidegger <sroland@vmware.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99817
    
    
    Reviewed-by: default avatarRoland Scheidegger <sroland@vmware.com>
    e6469ec4