Module: Mesa
Branch: main
Commit: 79a58cb79bc75b54e7bf5dfe7bd607e4e6057961
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=79a58cb79bc75b54e7bf5dfe7bd607e4e6057961

Author: Väinö Mäkelä <[email protected]>
Date:   Sat Nov 19 21:06:20 2022 +0200

hasvk: Enable PixelShaderKillsPixel when omask is used

>From the Haswell PRM Vol. 2b, 3DSTATE_WM::Pixel Shader Kill Pixel:
    "This bit is required to be ENABLED in the following situations:
     - The API pixel shader program contains "killpix" or "discard"
       instructions, or other code in the pixel shader kernel that can
       cause the final pixel mask to differ from the pixel mask received
       on dispatch.
     - A sampler with chroma key enabled with kill pixel mode is used by
       the pixel shader.
     - Any render target has Alpha Test Enable or AlphaToCoverage Enable
       enabled.
     - The pixel shader kernel generates and outputs oMask."

Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19876>

---

 src/intel/vulkan_hasvk/genX_pipeline.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/intel/vulkan_hasvk/genX_pipeline.c 
b/src/intel/vulkan_hasvk/genX_pipeline.c
index 39da75d377e..4255b2abf77 100644
--- a/src/intel/vulkan_hasvk/genX_pipeline.c
+++ b/src/intel/vulkan_hasvk/genX_pipeline.c
@@ -1597,7 +1597,8 @@ emit_3dstate_wm(struct anv_graphics_pipeline *pipeline,
        */
       wm.PixelShaderKillsPixel         = rp->depth_self_dependency ||
                                          rp->stencil_self_dependency ||
-                                         wm_prog_data->uses_kill;
+                                         wm_prog_data->uses_kill ||
+                                         wm_prog_data->uses_omask;
 
       pipeline->force_fragment_thread_dispatch =
          wm.PixelShaderComputedDepthMode != PSCDEPTH_OFF ||

Reply via email to