OSDN Git Service

radv: Merge vtx_reuse_depth computation with PM4 generation.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 14 Jan 2018 01:46:49 +0000 (02:46 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 30 Jan 2018 21:00:55 +0000 (22:00 +0100)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_private.h

index 32c381b..3862625 100644 (file)
@@ -2860,8 +2860,13 @@ radv_pipeline_generate_vgt_vertex_reuse(struct radeon_winsys_cs *cs,
        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;
+       }
        radeon_set_context_reg(cs, R_028C58_VGT_VERTEX_REUSE_BLOCK_CNTL,
-                              pipeline->graphics.vtx_reuse_depth);
+                              S_028C58_VTX_REUSE_DEPTH(vtx_reuse_depth));
 }
 
 static void
@@ -3178,12 +3183,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);
        }
index e7b9045..d836c95 100644 (file)
@@ -1246,7 +1246,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;