Module: Mesa
Branch: main
Commit: 06d17fccfbb53c1fd3272670d5a5d42ad0a57b70
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=06d17fccfbb53c1fd3272670d5a5d42ad0a57b70

Author: Samuel Pitoiset <[email protected]>
Date:   Wed Feb  8 15:09:09 2023 +0100

radv: make sure to disable MRT compaction when compiling a PS epilog with GPL

Signed-off-by: Samuel Pitoiset <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>

---

 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);

Reply via email to