Mesa (staging/20.0): radeonsi: fix compilation of monolithic PS

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu May 7 17:08:26 UTC 2020


Module: Mesa
Branch: staging/20.0
Commit: 9109f99add0593d2496d1bfc78afd5c1b9761623
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9109f99add0593d2496d1bfc78afd5c1b9761623

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Wed May  6 09:42:55 2020 -0400

radeonsi: fix compilation of monolithic PS

This was totally broken. Monolithic PS is only used if FBFETCH or
interpolateAtSample are used.

When the PS prolog was built, it overwrote ctx->main_fn.

Discovered by @eefano.

Fixes: 8832a884345686e6a8b2c0c8aa7515ad3f775b9e "radeonsi: move PS LLVM code into si_shader_llvm_ps.c"
Closes: #2814

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4918>
(cherry picked from commit 29da52128090a1ef8ef782188c0f67c7f5ec8d19)

---

 .pick_status.json                                | 2 +-
 src/gallium/drivers/radeonsi/si_shader_llvm_ps.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 5150e5e3144..ca57c965209 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -283,7 +283,7 @@
         "description": "radeonsi: fix compilation of monolithic PS",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "8832a884345686e6a8b2c0c8aa7515ad3f775b9e"
     },
diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm_ps.c b/src/gallium/drivers/radeonsi/si_shader_llvm_ps.c
index 4a704e615cb..c7fa445862e 100644
--- a/src/gallium/drivers/radeonsi/si_shader_llvm_ps.c
+++ b/src/gallium/drivers/radeonsi/si_shader_llvm_ps.c
@@ -1031,6 +1031,7 @@ void si_llvm_build_monolithic_ps(struct si_shader_context *ctx,
 {
    LLVMValueRef parts[3];
    unsigned num_parts = 0, main_index;
+   LLVMValueRef main_fn = ctx->main_fn;
 
    union si_shader_part_key prolog_key;
    si_get_ps_prolog_key(shader, &prolog_key, false);
@@ -1041,7 +1042,7 @@ void si_llvm_build_monolithic_ps(struct si_shader_context *ctx,
    }
 
    main_index = num_parts;
-   parts[num_parts++] = ctx->main_fn;
+   parts[num_parts++] = main_fn;
 
    union si_shader_part_key epilog_key;
    si_get_ps_epilog_key(shader, &epilog_key);



More information about the mesa-commit mailing list