Mesa (main): i915g: Use the normal compile error path for empty FSes.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 28 22:17:31 UTC 2021


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

Author: Emma Anholt <emma at anholt.net>
Date:   Sun Jun 27 14:10:47 2021 -0700

i915g: Use the normal compile error path for empty FSes.

This means they'll get dumped and you'll see the passthrough FS.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11617>

---

 src/gallium/drivers/i915/i915_fpc_translate.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_fpc_translate.c b/src/gallium/drivers/i915/i915_fpc_translate.c
index 5bfbbc88b26..9f385b70a0d 100644
--- a/src/gallium/drivers/i915/i915_fpc_translate.c
+++ b/src/gallium/drivers/i915/i915_fpc_translate.c
@@ -985,6 +985,13 @@ i915_fini_compile(struct i915_context *i915, struct i915_fp_compile *p)
    if (p->nr_decl_insn > I915_MAX_DECL_INSN)
       i915_program_error(p, "Exceeded max DECL instructions");
 
+   /* hw doesn't seem to like empty frag programs (num_instructions == 1 is just
+    * TGSI_END), even when the depth write fixup gets emitted below - maybe that
+    * one is fishy, too?
+    */
+   if (ifs->info.num_instructions == 1)
+      i915_program_error(p, "Empty fragment shader");
+
    if (p->error) {
       p->NumNativeInstructions = 0;
       p->NumNativeAluInstructions = 0;
@@ -1053,14 +1060,6 @@ i915_translate_fragment_program(struct i915_context *i915,
       tgsi_dump(tokens, 0);
    }
 
-   /* hw doesn't seem to like empty frag programs, even when the depth write
-    * fixup gets emitted below - may that one is fishy, too? */
-   if (fs->info.num_instructions == 1) {
-      i915_use_passthrough_shader(fs);
-
-      return;
-   }
-
    p = i915_init_compile(i915, fs);
 
    i_tokens = i915_optimize(tokens);



More information about the mesa-commit mailing list