Module: Mesa
Branch: master
Commit: 1d5ce66b02016a8c985e3e3cc44df65ccfacca48
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1d5ce66b02016a8c985e3e3cc44df65ccfacca48

Author: Eric Anholt <[email protected]>
Date:   Wed Jan 20 11:55:12 2021 -0800

mesa/st: Always precompile the first shader variant.

Every driver wants the chance to see the default variant of the shader in
the hopes of avoiding draw-time shader compiles, even if they have some
NOS compiled into the shader by st/mesa.  Before, every driver had to
avoid st/mesa lowering options to get this behavior, even if they would
like to have the shared lowering code, and some drivers were just missing
the behavior because nobody had debugged that it was missing yet.

Reviewed-by: Alyssa Rosenzweig <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>

---

 src/mesa/state_tracker/st_debug.c   | 1 -
 src/mesa/state_tracker/st_debug.h   | 5 ++---
 src/mesa/state_tracker/st_program.c | 6 ++----
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/mesa/state_tracker/st_debug.c 
b/src/mesa/state_tracker/st_debug.c
index 786e1cf0906..b651499181c 100644
--- a/src/mesa/state_tracker/st_debug.c
+++ b/src/mesa/state_tracker/st_debug.c
@@ -50,7 +50,6 @@ static const struct debug_named_value st_debug_flags[] = {
    { "fallback", DEBUG_FALLBACK, NULL },
    { "buffer",   DEBUG_BUFFER, NULL },
    { "wf",       DEBUG_WIREFRAME, NULL },
-   { "precompile",  DEBUG_PRECOMPILE, NULL },
    { "gremedy",  DEBUG_GREMEDY, "Enable GREMEDY debug extensions" },
    { "noreadpixcache", DEBUG_NOREADPIXCACHE, NULL },
    DEBUG_NAMED_VALUE_END
diff --git a/src/mesa/state_tracker/st_debug.h 
b/src/mesa/state_tracker/st_debug.h
index 520ee995165..5aba19d3bd6 100644
--- a/src/mesa/state_tracker/st_debug.h
+++ b/src/mesa/state_tracker/st_debug.h
@@ -39,9 +39,8 @@ struct st_context;
 #define DEBUG_FALLBACK        BITFIELD_BIT(2)
 #define DEBUG_BUFFER          BITFIELD_BIT(3)
 #define DEBUG_WIREFRAME       BITFIELD_BIT(4)
-#define DEBUG_PRECOMPILE      BITFIELD_BIT(5)
-#define DEBUG_GREMEDY         BITFIELD_BIT(6)
-#define DEBUG_NOREADPIXCACHE  BITFIELD_BIT(7)
+#define DEBUG_GREMEDY         BITFIELD_BIT(5)
+#define DEBUG_NOREADPIXCACHE  BITFIELD_BIT(6)
 
 extern int ST_DEBUG;
 
diff --git a/src/mesa/state_tracker/st_program.c 
b/src/mesa/state_tracker/st_program.c
index e1783e47b5e..ef6bfd61d89 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -2035,8 +2035,6 @@ st_finalize_program(struct st_context *st, struct 
gl_program *prog)
       st_serialize_nir(st_program(prog));
    }
 
-   /* Create Gallium shaders now instead of on demand. */
-   if (ST_DEBUG & DEBUG_PRECOMPILE ||
-       st->shader_has_one_variant[prog->info.stage])
-      st_precompile_shader_variant(st, prog);
+   /* Always create the default variant of the program. */
+   st_precompile_shader_variant(st, prog);
 }

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to