This changes emitting pipelines to pregenerate the PM$ sequences to bind the pipeline at pipeline creation time, so we can just memcpy it in the command buffer. This gives minor CPU improvements on dota2.
In the process I also refactored stuff to: 1) Not have all the state in the pipeline struct anymore, since it is not needed anymore. 2) Reduce the size of radv_pipeline_init 3) Make dependency between subroutines in radv_pipeline_init more clear, by more explicitly returning the changed data and only using the passed in pipeline readonly. I left the multisample state for now, because it is kind of a mess what it is used for, and I'll probably significantly change it soon with the sample location extension. Patches 1-3 are small behavioral changes that make the fololowing changes easier. Patches 4-6 implement the PM$ pregeneration. Then 7-23 are just refactoring and should not be functional changes. I found no regressions on a CTS run on GFX9, and you can find a branch at https://github.com/BNieuwenhuizen/mesa/tree/pipeline-optimize Bas Nieuwenhuizen (23): radv: emit pa_sc_mode_cntl_0 with multisample state. radv: Always re-emit the sample position offset user SGPR. radv: Determine unneeded dynamic states. radv: Add a PM4 sequence data structure + utils. radv: Record a PM4 sequence for graphics pipeline switches. radv: Add PM4 pregeneration for compute pipelines. radv: Constify some pipeline helpers. radv: Merge binning state generation with pm4 emission. radv: Merge vs state computation with PM4 generation. radv: Merge vtx_reuse_depth computation with PM4 generation. radv: Merge ps_input_cntl computation with PM4 generation. radv: Merge depth stencil state with PM4 generation. radv: Compute shader_z_format when emitting it. radv: Split out db_shader_control computation. radv: Split out the ia_multi_vgt_param precomputation. radv: Split out generating VGT_SHADER_STAGES_EN. radv: Move blend state out of pipeline. radv: Move tessellation state out of pipeline. radv: Split out processing the vertex input state. radv: Merge VGT_GS_MODE computation with PM4 generation. radv: Split out cliprect rule generation. radv: Move gs state out of pipeline. radv: Merge raster state with PM4 generation. src/amd/vulkan/radv_cmd_buffer.c | 566 +------------ src/amd/vulkan/radv_pipeline.c | 1629 +++++++++++++++++++++++++++----------- src/amd/vulkan/radv_private.h | 108 +-- src/amd/vulkan/si_cmd_buffer.c | 12 +- 4 files changed, 1210 insertions(+), 1105 deletions(-) -- 2.15.1 _______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
