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

Author: Samuel Pitoiset <[email protected]>
Date:   Fri May 12 12:57:30 2023 +0200

radv: rework the checks for implicit exports with GPL

No logical changes but this allows us to distinguish between noop FS
and unknown FS with GPL.

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

---

 src/amd/vulkan/radv_pipeline_graphics.c | 3 ++-
 src/amd/vulkan/radv_shader_info.c       | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline_graphics.c 
b/src/amd/vulkan/radv_pipeline_graphics.c
index 654481f2696..ca1bb9e72c3 100644
--- a/src/amd/vulkan/radv_pipeline_graphics.c
+++ b/src/amd/vulkan/radv_pipeline_graphics.c
@@ -1299,7 +1299,8 @@ radv_should_export_multiview(const struct 
radv_pipeline_stage *producer,
     * (with graphics pipeline library), the layer is exported unconditionally.
     */
    return pipeline_key->has_multiview_view_index &&
-          (!consumer || consumer->stage == MESA_SHADER_FRAGMENT) &&
+          ((consumer && consumer->stage == MESA_SHADER_FRAGMENT) ||
+           !(pipeline_key->lib_flags & 
VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT)) &&
           !(producer->nir->info.outputs_written & VARYING_BIT_LAYER);
 }
 
diff --git a/src/amd/vulkan/radv_shader_info.c 
b/src/amd/vulkan/radv_shader_info.c
index 8564b1230bd..7da74cc8714 100644
--- a/src/amd/vulkan/radv_shader_info.c
+++ b/src/amd/vulkan/radv_shader_info.c
@@ -1438,7 +1438,8 @@ radv_link_shaders_info(struct radv_device *device,
    /* Export primitive ID and clip/cull distances if read by the FS, or export 
unconditionally when
     * the next stage is unknown (with graphics pipeline library).
     */
-   if (!consumer || consumer->stage == MESA_SHADER_FRAGMENT) {
+   if ((consumer && consumer->stage == MESA_SHADER_FRAGMENT) ||
+       !(pipeline_key->lib_flags & 
VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT)) {
       struct radv_vs_output_info *outinfo = &producer->info.outinfo;
       const bool ps_prim_id_in = !consumer || consumer->info.ps.prim_id_input;
       const bool ps_clip_dists_in = !consumer || 
!!consumer->info.ps.num_input_clips_culls;

Reply via email to