Bug 107306

Summary: [GEN8+] Hang when discarding a fragment if dual source blending is enabled but shader doesn't support it
Product: Mesa Reporter: Denis <denys.kostin>
Component: Drivers/Vulkan/intelAssignee: Intel 3D Bugs Mailing List <intel-3d-bugs>
Status: RESOLVED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium CC: jason
Version: git   
Hardware: Other   
OS: All   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=107088
Whiteboard:
i915 platform: i915 features:
Bug Depends on: 107088    
Bug Blocks:    

Description Denis 2018-07-20 11:10:08 UTC
Hi, as we found out, the same issue exists and for Vulkan (original description can be found in this issue -> https://bugs.freedesktop.org/show_bug.cgi?id=107088 )
Patch was also sent for review:

https://patchwork.freedesktop.org/patch/239979/
Comment 1 Kenneth Graunke 2018-10-30 20:00:39 UTC
Fixed by:

commit 00fc56a68d21d7aa91b95f0eaacba59a96c466f5 (HEAD -> master)
Author: Danylo Piliaiev <danylo.piliaiev@gmail.com>
Date:   Fri Jul 20 12:54:42 2018 +0300

    anv: Disable dual source blending when shader doesn't support it on gen8+
    
    Dual source blending behaviour is undefined when shader doesn't
    have second color output.
    
     "If SRC1 is included in a src/dst blend factor and
      a DualSource RT Write message is not used, results
      are UNDEFINED. (This reflects the same restriction in DX APIs,
      where undefined results are produced if “o1” is not written
      by a PS – there are no default values defined)."
    
    Dismissing fragment in such situation leads to a hang on gen8+
    if depth test in enabled.
    
    Since blending cannot be gracefully fixed in such case and the result
    is undefined - blending is simply disabled.
    
    v2 (Jason Ekstrand):
     - Apply the workaround to each individual entry
     - Emit a warning through debug_report
    
    Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
    Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.