From ed7d831525436ef63092b47f465a184fff4eff74 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 14 Apr 2022 17:31:51 +0200 Subject: [PATCH] radv: fix initializing pipeline_key::topology for GFX9 and older This is used to determine the geometry shader info on GFX9, and it looks like it was broken for topologies that use adjacency. This is also used to remove PSIZ from shaders that don't need it. Found by inspection. fossils-db (Polaris10): Totals from 140 (0.10% of 135960) affected shaders: SGPRs: 10448 -> 9696 (-7.20%) VGPRs: 4376 -> 4264 (-2.56%) CodeSize: 164316 -> 161028 (-2.00%) Instrs: 26449 -> 25767 (-2.58%) Latency: 184448 -> 180468 (-2.16%) InvThroughput: 80772 -> 79092 (-2.08%) VClause: 337 -> 328 (-2.67%); split: -2.97%, +0.30% SClause: 859 -> 813 (-5.36%); split: -5.70%, +0.35% Copies: 1027 -> 790 (-23.08%) PreSGPRs: 2751 -> 2331 (-15.27%) PreVGPRs: 3887 -> 3836 (-1.31%) Cc: mesa-stable Signed-off-by: Samuel Pitoiset Reviewed-by: Mike Blumenkrantz Part-of: --- src/amd/vulkan/radv_pipeline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 7e15e763305..2f28beba5a2 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -3058,9 +3058,9 @@ radv_generate_graphics_pipeline_key(const struct radv_pipeline *pipeline, key.ps.is_int10 = blend->col_format_is_int10; } - if (pipeline->device->physical_device->rad_info.chip_class >= GFX10) { - key.vs.topology = pCreateInfo->pInputAssemblyState ? pCreateInfo->pInputAssemblyState->topology : 0; + key.vs.topology = pCreateInfo->pInputAssemblyState ? pCreateInfo->pInputAssemblyState->topology : 0; + if (pipeline->device->physical_device->rad_info.chip_class >= GFX10) { const VkPipelineRasterizationStateCreateInfo *raster_info = pCreateInfo->pRasterizationState; const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT *provoking_vtx_info = vk_find_struct_const(raster_info->pNext,