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

Author: Alyssa Rosenzweig <[email protected]>
Date:   Thu Jan 12 21:43:29 2023 -0500

mesa: Set info.separate_shader for ARB programs

ARB programs are logically separate, and Mesa will happily mix and match them.
We need to alert backends of this fact, by setting nir->info.separate_shader.
Otherwise, backends may link shaders invalidly.

Fixes fp-abs-01 on Bifrost. (We don't use separate_shader for anything on
Valhall, so the issue doesn't appear there.)

Compare 151aa19c215 ("ttn: Set nir->info.separate_shader"), which fixed a
similar issue with TGSI.

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Reviewed-by: Emma Anholt <[email protected]>
Reviewed-by: Adam Jackson <[email protected]>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20688>

---

 src/mesa/program/prog_to_nir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/program/prog_to_nir.c b/src/mesa/program/prog_to_nir.c
index 16116f62ec3..a86df264a82 100644
--- a/src/mesa/program/prog_to_nir.c
+++ b/src/mesa/program/prog_to_nir.c
@@ -1036,7 +1036,7 @@ prog_to_nir(const struct gl_context *ctx, const struct 
gl_program *prog,
    s->info.uses_texture_gather = false;
    s->info.clip_distance_array_size = 0;
    s->info.cull_distance_array_size = 0;
-   s->info.separate_shader = false;
+   s->info.separate_shader = true;
    s->info.io_lowered = false;
    s->info.internal = false;
 

Reply via email to