Mesa (main): pvr: Handle vdm degen_cull_enable.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 24 09:25:12 UTC 2022


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

Author: Karmjit Mahil <Karmjit.Mahil at imgtec.com>
Date:   Tue May 17 09:52:02 2022 +0100

pvr: Handle vdm degen_cull_enable.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil at imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal at imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17206>

---

 src/imagination/common/pvr_device_info.c | 2 ++
 src/imagination/common/pvr_device_info.h | 1 +
 src/imagination/vulkan/pvr_cmd_buffer.c  | 9 +++++++++
 3 files changed, 12 insertions(+)

diff --git a/src/imagination/common/pvr_device_info.c b/src/imagination/common/pvr_device_info.c
index 69cdb0c6dc1..6e3799b386b 100644
--- a/src/imagination/common/pvr_device_info.c
+++ b/src/imagination/common/pvr_device_info.c
@@ -156,6 +156,7 @@ const struct pvr_device_features pvr_device_features_33_V_11_3 = {
    .has_uvs_pba_entries = true,
    .has_uvs_vtx_entries = true,
    .has_vdm_cam_size = true,
+   .has_vdm_degenerate_culling = true,
 
    .common_store_size_in_dwords = 512U * 4U * 4U,
    .isp_max_tiles_in_flight = 1U,
@@ -235,6 +236,7 @@ const struct pvr_device_features pvr_device_features_36_V_104_796 = {
    .has_uvs_pba_entries = true,
    .has_uvs_vtx_entries = true,
    .has_vdm_cam_size = true,
+   .has_vdm_degenerate_culling = true,
    .has_xpu_max_slaves = true,
 
    .common_store_size_in_dwords = 1344U * 4U * 4U,
diff --git a/src/imagination/common/pvr_device_info.h b/src/imagination/common/pvr_device_info.h
index 3dd65ba1977..a9098cb1621 100644
--- a/src/imagination/common/pvr_device_info.h
+++ b/src/imagination/common/pvr_device_info.h
@@ -291,6 +291,7 @@ struct pvr_device_features {
    bool has_uvs_pba_entries : 1;
    bool has_uvs_vtx_entries : 1;
    bool has_vdm_cam_size : 1;
+   bool has_vdm_degenerate_culling : 1;
    bool has_xpu_max_slaves : 1;
    bool has_xt_top_infrastructure : 1;
    bool has_zls_subtile : 1;
diff --git a/src/imagination/vulkan/pvr_cmd_buffer.c b/src/imagination/vulkan/pvr_cmd_buffer.c
index c33486288f4..ee87483a496 100644
--- a/src/imagination/vulkan/pvr_cmd_buffer.c
+++ b/src/imagination/vulkan/pvr_cmd_buffer.c
@@ -4503,6 +4503,10 @@ static void pvr_emit_vdm_index_list(struct pvr_cmd_buffer *cmd_buffer,
    unsigned int index_stride = 0;
 
    pvr_csb_emit (csb, VDMCTRL_INDEX_LIST0, list0) {
+      const bool vertex_shader_has_side_effects =
+         cmd_buffer->state.gfx_pipeline->vertex_shader_state.stage_state
+            .has_side_effects;
+
       list0.primitive_topology = pvr_get_hw_primitive_topology(topology);
 
       /* First instance is not handled in the VDM state, it's implemented as
@@ -4541,6 +4545,11 @@ static void pvr_emit_vdm_index_list(struct pvr_cmd_buffer *cmd_buffer,
          list0.index_base_addrmsb = index_buffer_addr;
       }
 
+      list0.degen_cull_enable =
+         PVR_HAS_FEATURE(&cmd_buffer->device->pdevice->dev_info,
+                         vdm_degenerate_culling) &&
+         !vertex_shader_has_side_effects;
+
       list_hdr = list0;
    }
 



More information about the mesa-commit mailing list