From d096a3f1a6541bbaeb7678730815bcbd7a295f4c Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 24 May 2023 08:20:33 +0200 Subject: [PATCH] radv: fix smooth lines with graphics pipeline library Need to be defensive here. Fixes recent CTS dEQP-VK.pipeline.fast_linked_library.extended_dynamic_state.*.line_raster_mode_smooth. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_pipeline_graphics.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_pipeline_graphics.c b/src/amd/vulkan/radv_pipeline_graphics.c index 8a40645e9d2..e7b16fc553a 100644 --- a/src/amd/vulkan/radv_pipeline_graphics.c +++ b/src/amd/vulkan/radv_pipeline_graphics.c @@ -2119,7 +2119,13 @@ radv_generate_graphics_pipeline_key(const struct radv_device *device, } if (device->smooth_lines) { - if (pipeline->dynamic_states & RADV_DYNAMIC_LINE_RASTERIZATION_MODE) { + /* For GPL, when the fragment shader is compiled without any pre-rasterization information, + * ensure the line rasterization mode is considered dynamic because we can't know if it's + * going to draw lines or not. + */ + if (pipeline->dynamic_states & RADV_DYNAMIC_LINE_RASTERIZATION_MODE || + ((lib_flags & VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT) && + !(lib_flags & VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT))) { key.dynamic_line_rast_mode = true; } else { key.ps.line_smooth_enabled =