radv: do not create a noop FS when the FS is imported from a library
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 10 Oct 2022 14:11:50 +0000 (16:11 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 17 Oct 2022 06:13:24 +0000 (08:13 +0200)
The entrypoint can be NULL even if the FS is imported from a library,
but we shouldn't overwrite the pre-compiled FS by a noop.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19019>

src/amd/vulkan/radv_pipeline.c

index 7b3229b..96971e9 100644 (file)
@@ -4079,7 +4079,8 @@ radv_create_shaders(struct radv_pipeline *pipeline, struct radv_pipeline_layout
       goto done;
    }
 
-   if (pipeline->type == RADV_PIPELINE_GRAPHICS && !stages[MESA_SHADER_FRAGMENT].entrypoint) {
+   if (pipeline->type == RADV_PIPELINE_GRAPHICS &&
+       !(radv_pipeline_to_graphics(pipeline)->active_stages & VK_SHADER_STAGE_FRAGMENT_BIT)) {
       nir_builder fs_b = radv_meta_init_shader(device, MESA_SHADER_FRAGMENT, "noop_fs");
 
       stages[MESA_SHADER_FRAGMENT] = (struct radv_pipeline_stage) {