pvr: Handle vdm degen_cull_enable.
authorKarmjit Mahil <Karmjit.Mahil@imgtec.com>
Tue, 17 May 2022 08:52:02 +0000 (09:52 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 24 Jun 2022 09:15:53 +0000 (09:15 +0000)
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17206>

src/imagination/common/pvr_device_info.c
src/imagination/common/pvr_device_info.h
src/imagination/vulkan/pvr_cmd_buffer.c

index 69cdb0c..6e3799b 100644 (file)
@@ -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,
index 3dd65ba..a9098cb 100644 (file)
@@ -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;
index c334862..ee87483 100644 (file)
@@ -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;
    }