From fcfdb1bb6ce95b38cd79e860ac9ff10c7a3c1177 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 28 Feb 2023 09:42:17 +0100 Subject: [PATCH] radv: determine if smooth lines can be used in the pipeline key Really complicated to reduce the scope because everything can be dynamic and with GPL you can't even know if the pipeline draws lines when compiling the fragment shader. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_pipeline_graphics.c | 9 +++++++++ src/amd/vulkan/radv_shader.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/src/amd/vulkan/radv_pipeline_graphics.c b/src/amd/vulkan/radv_pipeline_graphics.c index 9f7c8e8dd99..6f8176bd85d 100644 --- a/src/amd/vulkan/radv_pipeline_graphics.c +++ b/src/amd/vulkan/radv_pipeline_graphics.c @@ -2113,6 +2113,15 @@ radv_generate_graphics_pipeline_key(const struct radv_device *device, key.enable_remove_point_size = true; } + if (device->smooth_lines) { + if (pipeline->dynamic_states & RADV_DYNAMIC_LINE_RASTERIZATION_MODE) { + key.dynamic_line_rast_mode = true; + } else { + key.ps.line_smooth_enabled = + state->rs && state->rs->line.mode == VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT; + } + } + return key; } diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index 96fc1422819..1d2e4853e3c 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -77,6 +77,7 @@ struct radv_pipeline_key { uint32_t dynamic_rasterization_samples : 1; uint32_t dynamic_color_write_mask : 1; uint32_t dynamic_provoking_vtx_mode : 1; + uint32_t dynamic_line_rast_mode : 1; uint32_t tex_non_uniform : 1; uint32_t enable_remove_point_size : 1; @@ -111,6 +112,8 @@ struct radv_pipeline_key { bool dynamic_ps_epilog; bool has_epilog; + + bool line_smooth_enabled; } ps; struct {