[Mesa-dev] [PATCH 10/23] radv: Merge vtx_reuse_depth computation with PM4 generation.

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Wed Jan 17 01:34:19 UTC 2018


---
 src/amd/vulkan/radv_pipeline.c | 13 ++++++-------
 src/amd/vulkan/radv_private.h  |  1 -
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 2f4561d1c2..bd8a2feb8c 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -2832,8 +2832,13 @@ radv_pipeline_generate_vgt_vertex_reuse(struct radv_pm4_builder *builder,
 	if (pipeline->device->physical_device->rad_info.family < CHIP_POLARIS10)
 		return;
 
+	unsigned vtx_reuse_depth = 30;
+	if (radv_pipeline_has_tess(pipeline) &&
+	    radv_get_tess_eval_shader(pipeline)->info.tes.spacing == TESS_SPACING_FRACTIONAL_ODD) {
+		vtx_reuse_depth = 14;
+	}
 	radv_pm4_set_reg(builder, R_028C58_VGT_VERTEX_REUSE_BLOCK_CNTL,
-			       pipeline->graphics.vtx_reuse_depth);
+	                 S_028C58_VTX_REUSE_DEPTH(vtx_reuse_depth));
 }
 
 static void
@@ -3150,12 +3155,6 @@ radv_pipeline_init(struct radv_pipeline *pipeline,
 			pipeline->graphics.vtx_emit_num = 2;
 	}
 
-	pipeline->graphics.vtx_reuse_depth = 30;
-	if (radv_pipeline_has_tess(pipeline) &&
-	    radv_get_tess_eval_shader(pipeline)->info.tes.spacing == TESS_SPACING_FRACTIONAL_ODD) {
-		pipeline->graphics.vtx_reuse_depth = 14;
-	}
-
 	if (device->instance->debug_flags & RADV_DEBUG_DUMP_SHADER_STATS) {
 		radv_dump_pipeline_stats(device, pipeline);
 	}
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 05f953cb7e..c04fb19001 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -1257,7 +1257,6 @@ struct radv_pipeline {
 			bool ia_switch_on_eoi;
 			bool partial_vs_wave;
 			uint8_t vtx_emit_num;
-			uint32_t vtx_reuse_depth;
 			struct radv_prim_vertex_count prim_vertex_count;
  			bool can_use_guardband;
 			uint32_t pa_sc_cliprect_rule;
-- 
2.15.1



More information about the mesa-dev mailing list