From 06d17fccfbb53c1fd3272670d5a5d42ad0a57b70 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 8 Feb 2023 15:09:09 +0100 Subject: [PATCH] radv: make sure to disable MRT compaction when compiling a PS epilog with GPL Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_pipeline.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index af0f9ed12f1..129d632c555 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -2421,7 +2421,14 @@ radv_generate_graphics_pipeline_key(const struct radv_graphics_pipeline *pipelin !(lib_flags & VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT)) || key.ps.dynamic_ps_epilog); - key.ps.epilog = radv_pipeline_generate_ps_epilog_key(pipeline, state, key.ps.has_epilog); + /* Disable MRT compaction when it's not possible to know both the written color outputs and the + * color blend attachments. + */ + bool disable_mrt_compaction = key.ps.has_epilog || + ((lib_flags & VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT) && + !(lib_flags & VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT)); + + key.ps.epilog = radv_pipeline_generate_ps_epilog_key(pipeline, state, disable_mrt_compaction); key.dynamic_patch_control_points = !!(pipeline->dynamic_states & RADV_DYNAMIC_PATCH_CONTROL_POINTS);