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

Author: Tapani Pälli <[email protected]>
Date:   Tue Apr  4 08:40:34 2023 +0300

anv: take primitive ID override to account Wa_14015297576

Commit ca4ec49b0e0 took primitive ID override fields in to use, this
has to be checked as part of Wa_14015297576.

Signed-off-by: Tapani Pälli <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22282>

---

 src/intel/vulkan/anv_private.h     | 1 +
 src/intel/vulkan/genX_pipeline.c   | 1 +
 src/intel/vulkan/gfx8_cmd_buffer.c | 3 ++-
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 2583e81b1a5..94c4e55f54a 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -3115,6 +3115,7 @@ struct anv_graphics_pipeline {
    bool                                         kill_pixel;
    bool                                         force_fragment_thread_dispatch;
    bool                                         uses_xfb;
+   bool                                         primitive_id_override;
 
    /* Number of VERTEX_ELEMENT_STATE input elements used by the shader */
    uint32_t                                     vs_input_elements;
diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c
index e78ff376517..1cfbdf322fa 100644
--- a/src/intel/vulkan/genX_pipeline.c
+++ b/src/intel/vulkan/genX_pipeline.c
@@ -524,6 +524,7 @@ emit_3dstate_sbe(struct anv_graphics_pipeline *pipeline)
          sbe.PrimitiveIDOverrideComponentY = true;
          sbe.PrimitiveIDOverrideComponentZ = true;
          sbe.PrimitiveIDOverrideComponentW = true;
+         pipeline->primitive_id_override = true;
       }
    } else {
       assert(anv_pipeline_is_mesh(pipeline));
diff --git a/src/intel/vulkan/gfx8_cmd_buffer.c 
b/src/intel/vulkan/gfx8_cmd_buffer.c
index b7565ee6975..29dc23ea025 100644
--- a/src/intel/vulkan/gfx8_cmd_buffer.c
+++ b/src/intel/vulkan/gfx8_cmd_buffer.c
@@ -260,7 +260,8 @@ genX(cmd_emit_te)(struct anv_cmd_buffer *cmd_buffer)
           *
           * Disable Tessellation Distribution when primitive Id is enabled.
           */
-         if (geom_or_tess_prim_id_used(pipeline))
+         if (pipeline->primitive_id_override ||
+             geom_or_tess_prim_id_used(pipeline))
             te.TessellationDistributionMode = TEDMODE_OFF;
       }
 

Reply via email to